I'm rendering out a component via a data-sly-resource and I'd like to be able to pass parameters as part of this, for example something like <sly data-sly-resource="${'featuredPost' @ showComments=false}"></sly> or something. I'd rather keep it out of the dialog because it's not something authors need to worry about and I'd rather not create separate resource types to handle different rendering scenarios for the same content. Is there a way to do this?
Views
Replies
Total Likes
This is discussed here:
http://blogs.adobe.com/experiencedelivers/experience-management/sightly-intro-part-3-2/
Use-api
In my second article I explained that you can call methods from your custom-classes via the data-sly-use notation.
In this example I will show that you can also pass in parameters from your components.
However - values are passed from front end to the back end - which is Java.
If you want to get values to the component itself (ie - a String value)- you need to use a dialog.
Views
Replies
Total Likes
smacdonald2008 wrote...
This is discussed here:
http://blogs.adobe.com/experiencedelivers/experience-management/sightly-intro-part-3-2/
Use-api
In my second article I explained that you can call methods from your custom-classes via the data-sly-use notation.
In this example I will show that you can also pass in parameters from your components.
However - values are passed from front end to the back end - which is Java.
If you want to get values to the component itself (ie - a String value)- you need to use a dialog.
Looks like the method shown in that link would just pass parameters into the use file, which is called from within the component, and not into the component itself?
Views
Replies
Total Likes
Correct - that blog talks about getting values to the Java part of the Sightly code.
The way to get values passed to the Sightly component is to use a dialog and code like:
<div id="experiencetext">${properties.contactDescription}</div>
See this Sightly article for more details:
I'd rather not use a dialog because it is not an authorable property.
Views
Replies
Total Likes
Take a look at the following thread - http://stackoverflow.com/questions/25404863/aem-6-0-additional-parameters-when-using-data-sly-resour...
Views
Replies
Total Likes
Another option to explore is using Java and then use OSGi config values:
https://helpx.adobe.com/experience-manager/using/osgi_config.html
You can set values in the JCR which are picked up by Java logic.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies