Removal of auto generated wrapping div tag around the components in AEM 6.4
Hi Everyone,
I tried removal of wrapping div around the components in AEM 6.4 using these options below , but it did not work either in edit mode or preview mode.
Requirement : It should be removed on both the publisher as well as author/edit mode.
Author mode should also work properly and I should be able to edit the components.
I am using HTL and NOT JSP.
Options tried :
- Using <div ... data-sly-unwrap="${wcmmode.disabled}" ></div> to remove additional div in non edit mode. --> Doesn't work for edit mode. Cannot edit the component anymore.
- Tried adding getRequest().setAttribute(ComponentContext.BYPASS_COMPONENT_HANDLING_ON_INCLUDE_ATTRIBUTE, false); code in activate method of java class extending WcmUse class --> But this removed the wrapping div for all components added on the page except the first component.
- Explicitly tell AEM not to wrap the component using cq:noDecoration. --> Doesn't work for edit mode. Cannot edit the component anymore.
Create cq:htmlTag node as nt:unstructured, create property cq:tagName and leave it blank. --> Doesn't work for edit mode. Cannot edit the component anymore.
Please help on this matter.
Thanks.