Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

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

Mshajiahmed
Level 8
Level 8

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">

1 Accepted Solution
boser87
Correct answer by
Level 4
Level 4
        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

View solution in original post

2 Replies
boser87
Correct answer by
Level 4
Level 4
        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

View solution in original post

krish1442
Level 2
Level 2

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">