Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the reason for using #set( $symbol_dollar = '$' )... #54

Closed
insideaem opened this issue Nov 12, 2015 · 2 comments
Closed

What is the reason for using #set( $symbol_dollar = '$' )... #54

insideaem opened this issue Nov 12, 2015 · 2 comments
Labels
question Question to the project committers.

Comments

@insideaem
Copy link

I wonder what is the reason for using #set( $symbol_dollar = '$' ) and then ${symbol_dollar}{properties.text} in the sightly scripts instead of just escaping the $ like this $?
According to http://stackoverflow.com/questions/1878742/how-do-you-suppress-property-replacement-when-creating-a-project-from-an-archety escaping the $ should be fine.

More of a question not an issue!

Cheers,

@rombert rombert added this to the 11 milestone Nov 19, 2015
@rombert rombert added the question Question to the project committers. label Nov 19, 2015
@rombert
Copy link
Contributor

rombert commented Nov 19, 2015

Because otherwise it does not work :-)

I tried the following change

diff --git a/src/main/archetype/ui.apps/src/main/content/jcr_root/apps/__appsFolderName__/components/content/helloworld/helloworld.html b/src/main/archetype/ui.apps/src/main/content/jcr_root/apps/__appsFolderName__/components/content/helloworld/helloworld.html
index d3bb0a8..f49ba58 100644
--- a/src/main/archetype/ui.apps/src/main/content/jcr_root/apps/__appsFolderName__/components/content/helloworld/helloworld.html
+++ b/src/main/archetype/ui.apps/src/main/content/jcr_root/apps/__appsFolderName__/components/content/helloworld/helloworld.html
@@ -13,10 +13,9 @@
     See the License for the specific language governing permissions and
     limitations under the License.
 */-->
-#set( $symbol_dollar = '$' )
-<p data-sly-test="${symbol_dollar}{properties.text}">Text property: ${symbol_dollar}{properties.text}</p>
+<p data-sly-test="\${properties.text}">Text property: \${properties.text}</p>

 <pre data-sly-use.hello="${package}.core.models.HelloWorldModel">
 HelloWorldModel says:
-${symbol_dollar}{hello.message}
+\${hello.message}
 </pre>

And the output included the backslash character, which is undesired. If you have a way of working around it, please submit a pull request and I'd be happy to review and apply it.

@rombert rombert removed this from the 11 milestone Nov 19, 2015
@rombert
Copy link
Contributor

rombert commented Jan 20, 2017

No response, closing

@rombert rombert closed this as completed Jan 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question to the project committers.
Projects
None yet
Development

No branches or pull requests

2 participants