Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
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>