How to remove the wrapping div when using data-sly-resource? | Community
Skip to main content
Level 2
May 18, 2016
Solved

How to remove the wrapping div when using data-sly-resource?

  • May 18, 2016
  • 11 replies
  • 9192 views

Hi all,

currently we have a setup that includes a page using the following snippet:

<sly data-sly-resource="${item.path @ selectors='link', wcmmode='disabled'}"></sly>

this results in

<div class="base-page case-detail-page page">        <a href="">Name</a> </div>

Is there a way to remove the div and just keep the a href?

Much appreciated!

Regards

 

Mario

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

Ok..., here comes a black-magic Sightly trick....

Use this (resourceType) in case you are referring to a page...

  1. <sly data-sly-resource="${item.path @ selectors='link', wcmmode='disabled', appendPath='jcr:content',  resourceType=item.contentResource.resourceType}"></sly>

 

Basically to remove the div you need to specify the resourceType...

11 replies

Feike_Visser1
Adobe Employee
Adobe Employee
May 1, 2017

This only applies when you have a page you want to render via data-sly-resource