Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

is that possible to Read the value from sightly and set through jQuery


Level 4

Hi All,

i have a requiremnt that read the value from sightly and set through jquery. If we have a alternate way kindly let me know.

Reading the value from author node and displaying on preview/publisher mode

code snippet:

var a = ${pageProperties['pagecontent/offertitle/title']}


3 Replies


Level 4


The variable value you read in sightly can be set in a hidden html input field on the page and the same field can then be accessed in jquery.


Community Advisor


You can directly used the variable in script tag in sightly using sightly context based on your requirement. Or you can also try using JS API as mentioned by smacdonald2008


var variable = '${properties.variablename @ context="scriptString"}'; // This can be used in javascript included after it as it is available as global variable


Hope this helps !