Missing the wrapper element that contains the "section" class | Community
Skip to main content
Level 3
December 8, 2017
Solved

Missing the wrapper element that contains the "section" class

  • December 8, 2017
  • 8 replies
  • 3272 views

We have been using AEM since CQ 5.4 when a component gets rendered it gets a generated div that wraps the component and in that div it gets some classes like "section". Usually people post to the community asking how to get rid of these. We have the opposite problem, we're trying to figure how to get them back.

We're in the process of upgrading from 6.1 to 6.3. When we upgrade our publish instance it no longer renders the wrapping DIVs and completely messes with the designs that are in place.

Any ideas would be appreciated

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

Adding a cq:htmlTag didn't work.

One of my coworkers was tracing code and he he finally nailed the issue. During the upgrade process an ACL node was created under /apps with a "deny everyone read" setting which was done by the upgrade process and not removed.

When the session attempted to read data under the /apps structure it was denied and that resulted in the no wrapper being put on the components.

8 replies

smacdonald2008
Level 10
December 8, 2017

If you look at the components in We.Retail - are you seeing these DIVS?

VeenaVikraman
Community Advisor
Community Advisor
December 8, 2017

What is the exact requirement of having this classes ?

JE_BaileyAuthor
Level 3
December 8, 2017

I'm not sure what you mean by we.retail is that a new demo site in 6.3?

JE_BaileyAuthor
Level 3
December 8, 2017

Veena - We have 70+ sites representing over 500k pages that each one is now structurally different. The requirement for having these is so that existing styles, that are managed by a different team, are not screwed up. Now conceivably it may be better at some point to get rid of this wrapping div but we would want to do so in a controlled manner. If I'm unable to determine why they disappeared in the first place I have no level of confidence that they won't re-appear at some point.

VeenaVikraman
Community Advisor
Community Advisor
December 8, 2017

I am checking the we.retail demo site (shipped as a sample site , as geometrixx used to be) now. Meanwhile can you send me a mock up of your components HTML as of now. I will let you know what we can do to achieve that

VeenaVikraman
Community Advisor
Community Advisor
December 8, 2017

Good News for you and thanks for bringing up this .. I also got to learn a new thing.

So what you have to do is add a cq:htmlTag under your cq:component node like below

Reference which helped me

Custom Node Types - Check cq:component section in this

Does anyone have official documentation of cq:htmlTag?

Remove component wrapper divs in CQ/AEM - CoderMagnet - JAVA JCR AEM Sightly Resource

Happy coding

JE_BaileyAuthorAccepted solution
Level 3
December 8, 2017

Adding a cq:htmlTag didn't work.

One of my coworkers was tracing code and he he finally nailed the issue. During the upgrade process an ACL node was created under /apps with a "deny everyone read" setting which was done by the upgrade process and not removed.

When the session attempted to read data under the /apps structure it was denied and that resulted in the no wrapper being put on the components.

VeenaVikraman
Community Advisor
Community Advisor
December 8, 2017

Good to hear you got that working and cq:htmlTag was not the issue. May be i understood your question wrong . Anyway it was a good learning for me . Tried something which I neva took the pain to try