コミュニティアチーブメントバーを展開する。

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

この会話は、活動がないためロックされています。新しい投稿を作成してください。

解決済み

Extra DIV Tags in AEM 6.0

Avatar

Level 9

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 受け入れられたソリューション

Avatar

正解者
Level 9

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 返信

Avatar

Level 10

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

Avatar

Level 8

Avatar

Level 9

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

Level 9

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

正解者
Level 9

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.