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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

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

sureshy2015
Level 4
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
Feike_Visser1
Correct answer by
Employee
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
Feike_Visser1
Correct answer by
Employee
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