Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

How to use dta-sly-test for adaptive image component which is included in another component.

Avatar

Level 4

I included adaptive image component in another component.

 

 I do not want this div to be generated if the image is not authored.how can i use data-sly-test in this context?

<div class="col-content-inner">

                <div data-sly-resource="${@path='adaptiveimage', resourceType='/apps/mda/components/content/adaptiveimage'}">
                </div>

1 Accepted Solution

Avatar

Correct answer by
Employee

This should unwrap the image when you are not in edit-mode.

 

<div class="col-content-inner">

                <div data-sly-unwrap="${!wcmmode.edit}" data-sly-resource="${@path='adaptiveimage', resourceType='/apps/mda/components/content/adaptiveimage'}">
                </div>

View solution in original post

1 Reply

Avatar

Correct answer by
Employee

This should unwrap the image when you are not in edit-mode.

 

<div class="col-content-inner">

                <div data-sly-unwrap="${!wcmmode.edit}" data-sly-resource="${@path='adaptiveimage', resourceType='/apps/mda/components/content/adaptiveimage'}">
                </div>