Can't extract Sling model values in Sightly
Hi All,
I am having an issue with extracting a sling model variable in Sightly. Here is the code:
<sly data-sly-use.utilModel="mysite.UtilModel"/>
<div class="image-title" style="background-image: url('${utilModel.imageRef}');">
=== Output ===
<div class="image-title" style="background-image: url('');">
But if I do the following, I will get the value of the variable:
<sly data-sly-use.utilModel="mysite.UtilModel"/>
<div>${utilModel.imageRef}</div>=== Output ===
<div>/content/dam/camera2-3.jpg</div>
I tested a few cases, it looks like the `style=...` has an impact on it. Can someone explain how to extract a value within inline style?
Thanks!
-kt