Testing this a bit more, I'm getting some interesting behavior that I dont quite understand. Here are a few use cases
<div class="img" data-sly-attribute.style="color: red">this is red text</div> <div class="img" data-sly-attribute.id="testid">id should be testid</div> <div class="img" data-sly-attribute.style="background-image: ${item.featuredImage}">image div: ${item.featuredImage}</div> <div class="img" data-bgimg="${item.featuredImage}">image div: ${item.featuredImage}</div>
producing:
<div class="img">this is red text</div> <div class="img" id="testid">id should be testid</div><div class="img">image div: /content/dam/geometrixx/offices/basel roof.jpg</div> <div class="img" data-bgimg="/content/dam/geometrixx/offices/basel roof.jpg">image div: /content/dam/geometrixx/offices/basel roof.jpg</div>
data-sly-attribute doesn't seem to be behaving correctly, at least for the style tag