Extra DIV Tags in AEM 6.0 | Community
Skip to main content
Singaiah_Chintalapudi
New Participant
October 16, 2015
Solved

Extra DIV Tags in AEM 6.0

  • October 16, 2015
  • 6 replies
  • 1548 views

Hi,

We are using sightly. When I drag a component to a parsys, It is appending some div tags to it. For example, it is appending the following the following div tag to my navigation component:

<div class="topnav section">

</div>

I've already used data-sly-unwrap and I don't know why it is appending that tag. Could anybody help to solve this issue?

Thanks.

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 Singaiah_Chintalapudi

leeasling wrote...

Oh sorry.  I think in Sightly it's actually broken.  If you go to /libs/wcm/foundation/components/parsys and replace

  1. <sly data-sly-test="${!paragraph.columns && paragraph.resourceType && !paragraph.cssClasses}" data-sly-resource="${paragraph.resourcePath @ resourceType=paragraph.resourceType, decorationTagName='div'}" />

with

 
  1. <sly data-sly-test="${!paragraph.columns && paragraph.resourceType && !paragraph.cssClasses}" data-sly-resource="${paragraph.resourcePath @ resourceType=paragraph.resourceType, decorationTagName=''}" />

You'll see that even with no decoration, the <div> tag still renders.  Now, if you replace it with

 
  1. <sly data-sly-test="${!paragraph.columns && paragraph.resourceType && !paragraph.cssClasses}" data-sly-resource="${paragraph.resourcePath @ resourceType=paragraph.resourceType, decorationTagName='span'}" />

You'll see that the wrappers are now rendering a <span> rather than a <div>.  So it looks like it's just not possible to do this in Sightly and whether that is intentional or a bug, I have no idea.

 

Perfect. Worked for me. Thanks a lot.

6 replies

Lokesh_Shivalingaiah
New Participant
October 16, 2015

this <div> with class should be included in some other html 

Singaiah_Chintalapudi
New Participant
October 16, 2015

bsloki wrote...

this <div> with class should be included in some other html 

 

We did not include anywhere and we did not this class name in our CSS. We've been trying hard to find why we see this problem.

Singaiah_Chintalapudi
New Participant
October 16, 2015

leeasling wrote...

See this post:

http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manager.topic.3.html/forum__nvpz-when_i_am_usingteas.html

 

Thanks for your reply. This url is related to  make changes in global.jsp but we are not using global.jsp in our components developed by sightly.

New Participant
October 16, 2015

Oh sorry.  I think in Sightly it's actually broken.  If you go to /libs/wcm/foundation/components/parsys and replace

<sly data-sly-test="${!paragraph.columns && paragraph.resourceType && !paragraph.cssClasses}" data-sly-resource="${paragraph.resourcePath @ resourceType=paragraph.resourceType, decorationTagName='div'}" />

with

<sly data-sly-test="${!paragraph.columns && paragraph.resourceType && !paragraph.cssClasses}" data-sly-resource="${paragraph.resourcePath @ resourceType=paragraph.resourceType, decorationTagName=''}" />

You'll see that even with no decoration, the <div> tag still renders.  Now, if you replace it with

<sly data-sly-test="${!paragraph.columns && paragraph.resourceType && !paragraph.cssClasses}" data-sly-resource="${paragraph.resourcePath @ resourceType=paragraph.resourceType, decorationTagName='span'}" />

You'll see that the wrappers are now rendering a <span> rather than a <div>.  So it looks like it's just not possible to do this in Sightly and whether that is intentional or a bug, I have no idea.

Singaiah_Chintalapudi
Singaiah_ChintalapudiAuthorAccepted solution
New Participant
October 16, 2015

leeasling wrote...

Oh sorry.  I think in Sightly it's actually broken.  If you go to /libs/wcm/foundation/components/parsys and replace

  1. <sly data-sly-test="${!paragraph.columns && paragraph.resourceType && !paragraph.cssClasses}" data-sly-resource="${paragraph.resourcePath @ resourceType=paragraph.resourceType, decorationTagName='div'}" />

with

 
  1. <sly data-sly-test="${!paragraph.columns && paragraph.resourceType && !paragraph.cssClasses}" data-sly-resource="${paragraph.resourcePath @ resourceType=paragraph.resourceType, decorationTagName=''}" />

You'll see that even with no decoration, the <div> tag still renders.  Now, if you replace it with

 
  1. <sly data-sly-test="${!paragraph.columns && paragraph.resourceType && !paragraph.cssClasses}" data-sly-resource="${paragraph.resourcePath @ resourceType=paragraph.resourceType, decorationTagName='span'}" />

You'll see that the wrappers are now rendering a <span> rather than a <div>.  So it looks like it's just not possible to do this in Sightly and whether that is intentional or a bug, I have no idea.

 

Perfect. Worked for me. Thanks a lot.