Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Author uses "Span" component, becomes "Block"

Avatar

Level 2

I have several components that are "span" type components. When a author drags them onto a page, the system creates a "div" around those components making them "block".
Is there any way to prevent AEM from automatically creating the surrounding DIV. It is extra markup that is not needed.
The component is built using Sightly and Java Use.

This is using AEM 6.1 and the Touch UI. I am not able to use "data-sly-unwrap" as the div is not part of the sightly, yet I don't want it to render.

Expected Code

<a href="#" class="class-name">Label of Button</a>

Output Code

<div class="name-of-component"> <a href="#" class="class-name">Label of Button</a> </div>

Thanks.

1 Accepted Solution

Avatar

Correct answer by
Level 2

The HTML file does not have the DIV. Any component a Author places on a page, they generate a div surrounding it. I just want to prevent that.

I can do the CSS you showed, but I am trying to reduce page weight by not having too, and not having the extra DIV. This is my fallback plan. I would rather tell the component not to render the outer div.

View solution in original post

3 Replies

Avatar

Level 4

Hi.

So your dropping these components into a parsys? Is it broken just in the author experience and not when the page renders with wcmmode disabled? (disabled wcmmode via the param, for exampled.. if your working on http://host:4502/cf#/content/myProject/en.html go to http://host:4502/content/myProject/en.html?wcmmode=disabled 

Avatar

Correct answer by
Level 2

The HTML file does not have the DIV. Any component a Author places on a page, they generate a div surrounding it. I just want to prevent that.

I can do the CSS you showed, but I am trying to reduce page weight by not having too, and not having the extra DIV. This is my fallback plan. I would rather tell the component not to render the outer div.

Avatar

Level 4

I wonder if it has something to do with the xtype that is being rendered.

What kind of xtype is being used in the dialog? 

While I am working on some dialogs I noticed that many of the different xtypes have a 'CLS' configuration. That might be set which is causing the component to render like that.

https://docs.adobe.com/docs/en/cq/5-6/widgets-api/index.html?class=CQ.html5.form.SmartImage (look at the CLS configuration).