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']}
jQuery("#title").text(a);
Views
Replies
Total Likes
Have you tried using JS API with HTL?
Hi,
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.
Views
Replies
Total Likes
Hi,
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
<script>
var variable = '${properties.variablename @ context="scriptString"}'; // This can be used in javascript included after it as it is available as global variable
</script>
Hope this helps !
Views
Replies
Total Likes
Views
Likes
Replies
Views
Like
Replies