


I'm using/customizing AEM core components but they generate a bunch of unused divs, is there a way to turn these off or remove them.
Thanks
Views
Replies
Sign in to like this content
Total Likes
Hi @aemFrontend,
The automatically rendered HTML element can be controlled via Decoration Tag, out of the box behavior by AEM.
Visit Adobe's documentation about Decoration Tags here - https://docs.adobe.com/content/help/en/experience-manager-64/developing/components/decoration-tag.ht...
Thanks for the quick response.
Tried the cq:noDecoration = true this method works but you cannot edit the component in the edit mode, is there another way to use/access the property in the HTL directly
Views
Replies
Sign in to like this content
Total Likes
You can create a java model to check preview/publish mode and add decoration tag.
Example -
https://aemlab.blogspot.com/2018/11/aem-restrict-component-editing-and.html
Hello Shawn,
Here's a quick fix, try this:
1. use cq:noDecoration
2. add custom code into HTL as follows:
<div data-sly-unwrap="${wcmmode.disabled}"
class="section" style="user-select: auto;"> <<<<YOUR_CODE_GOES_HERE>>>> </div>
Views
Replies
Sign in to like this content
Total Likes
Thanks, @BrianKasingli but no luck I still cannot edit the component in the template
Views
Replies
Sign in to like this content
Total Likes
What does the rendered code look like after you apply this?
Try this:
// show div when in edit mode, else hide.
// I've added the section class && changed the conditional
<div data-sly-unwrap="${wcmmode.edit}"
class="section" style="user-select: auto;"> <<<<YOUR_CODE_GOES_HERE>>>> </div>
Views
Replies
Sign in to like this content
Total Likes
Finally, got back to this; found `${wcmmode.disabled}` removes the wrapper `div` in publish mode only way I was able to get it done...
<div data-sly-unwrap="${wcmmode.disabled}" class="section" style="user-select: auto;"> <<<<YOUR_CODE_GOES_HERE>>>> </div>
ref: http://aemconcepts.blogspot.com/2017/03/wcmmodes-aem.html
Views
Replies
Sign in to like this content
Total Likes