Unable to get properties in inline style background:url in sightly | Community
Skip to main content
Community Advisor
October 16, 2015
Solved

Unable to get properties in inline style background:url in sightly

  • October 16, 2015
  • 2 replies
  • 3569 views

I am not able to get ${properties.imgUrl2} in the following html tag

<div style="background:url('${properties.imgUrl2}') no-repeat; -webkit-background-size: cover; -moz-background-size: cover; background-size: cover;" class="row-item">

If I print this ${properties.imgUrl2}  outside the background-url and div tag I can see this value on the html page

This style is displayed in browser as

<div style="background:url('') no-repeat; -webkit-background-size: cover; -moz-background-size: cover; background-size: cover;" class="row-item">

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by boser87
        Hello, The Code you try to Output is filtered out by Sightly xss fulters. But you can skip that control in cases like yours. Use context Sightly option. Take a look at this http://docs.adobe.com/docs/en/aem/6-0/develop/sightly/expression-language.html#Display Context

2 replies

boser87Accepted solution
Level 4
October 16, 2015
        Hello, The Code you try to Output is filtered out by Sightly xss fulters. But you can skip that control in cases like yours. Use context Sightly option. Take a look at this http://docs.adobe.com/docs/en/aem/6-0/develop/sightly/expression-language.html#Display Context
krish1442
Level 2
November 11, 2016

Just to be specific

By adding @ context='uri' here solves the problem....

<div style="background:url(${properties.imgUrl2 @ context='uri' }) no-repeat; -webkit-background-size: cover; -moz-background-size: cover; background-size: cover;" class="row-item">