Leiste mit Community-Erfolgen erweitern.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

Diese Konversation wurde aufgrund von Inaktivität geschlossen. Bitte erstellen Sie einen neuen Post.

GELÖST

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

Avatar

Community Advisor

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 Akzeptierte Lösung

Avatar

Korrekte Antwort von
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

Lösung in ursprünglichem Beitrag anzeigen

2 Antworten

Avatar

Korrekte Antwort von
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

Avatar

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