Expand my Community achievements bar.

SOLVED

Extra DIV Tags in AEM 6.0

Avatar

Community Advisor

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.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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.

View solution in original post

6 Replies

Avatar

Level 10

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

Avatar

Community Advisor

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.

Avatar

Community Advisor

leeasling wrote...

See this post:

http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...

 

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.

Avatar

Level 8

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.

Avatar

Correct answer by
Community Advisor

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.