How to use dta-sly-test for adaptive image component which is included in another component. | Community
Skip to main content
sureshy2015
Level 4
October 16, 2015
Solved

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

  • October 16, 2015
  • 1 reply
  • 681 views

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>

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Feike_Visser1

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>

1 reply

Feike_Visser1
Adobe Employee
Feike_Visser1Adobe EmployeeAccepted solution
Adobe Employee
October 16, 2015

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>