Removing wrapper div in author & publisher view | Community
Skip to main content
Level 3
April 18, 2019

Removing wrapper div in author & publisher view

  • April 18, 2019
  • 2 replies
  • 9183 views

Hi,

I was trying to remove wrapper div on components for a specific page types using following code.

getRequest().setAttribute(ComponentContext.BYPASS_COMPONENT_HANDLING_ON_INCLUDE_ATTRIBUTE, false);

It does remove the wrapper div but it also remove edit functionality on components.  My requirement is to preserve edit functionality and remove wrapper div as well in both author and publish mode.

Anyone has any idea on how to achieve this or it's not possible because the reason for wrapper div is to enable editing on the same page?

Thanks & Regards,

Rachna

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

arunpatidar
Community Advisor
Community Advisor
April 18, 2019

Hi,

Wrapper div allow editing in author mode, so if you want editing then you should't remove wrapper div from author.

Though you can place another custom tag

e.g.

AEM Developer Learning : Useful Properties of a Component in AEM 6.3

Arun Patidar
Ravi_Pampana
Community Advisor
Community Advisor
April 18, 2019

Hi,

Try <div ... data-sly-unwrap="${wcmmode.disabled}" ></div> to remove additional div in non edit mode.

you can try using cq:htmlTag node in your component to generate your custom div with custom class.

cq:tagName

smacdonald2008
Level 10
April 18, 2019

As Arun suggests - removing that wrapper DIV in author will remove the ability for an author to make changes to a component.

WHy do you want to remove this DIV thereby removing author the ability to make changes to the component in the AEM Author server?

Level 3
April 18, 2019

Hi All,

Thanks for your replies. 

We want to remove wrapping div in author because it breaks the grid layout and will require extra css to fix it.  We also don't want to stop edit functionality of the component.

Thanks