AEM 6.3 PARSYS NO DECORATION

Avatar

Avatar

daniel379379

Avatar

daniel379379

daniel379379

09-03-2018

Hello,

I have a problem in the parsys: for example, in my sidebar, in preview or disabled mode, the wrapper (cq:htmlTag) of the first component is not closed, so it wrap also other components and it brokes my html.

I found several documents and guides (for example this: AEM | Remove wrapper HTML Tags in preview mode – Need is the mother of invention … , but also others), that say to set in my global.jsp this snippet of code:

<c:choose>

  <c:when test="${ requestScope['com.day.cq.wcm.api.WCMMode']=='EDIT' || requestScope['com.day.cq.wcm.api.WCMMode']=='DESIGN'}">

  <c:if test="${componentContext!=null}">

  <% componentContext.setDefaultDecorationTagName("div"); %>

  </c:if>

  </c:when>

  <c:otherwise>

  <c:if test="${componentContext!=null}">

  <% componentContext.setDefaultDecorationTagName(""); %>

  </c:if>

  </c:otherwise>

</c:choose>

The problem is that I already have a similar snipper of code, that disable decoration if it's not edit or design mode, but it not working.

I have AEM 6.3.

Thanks in advance, Daniel

Replies

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K
smacdonald2008

09-03-2018

Please provide more information, Are you referring to custom components in the parsys?  Do you see this behavior with OOTB components? If you opened the We Retail sample site and dropped a few OOTB Core components - do you see this issue?

Avatar

Avatar

Siva_Chanduluri

Avatar

Siva_Chanduluri

Siva_Chanduluri

10-03-2018

Hi,

You may implement a  javax.servlet.Filter and Disable CQ Decoration on cq:includes or sling:includes, only in Publish mode, it is required in edit mode to edit the component.

if (includeOptions != null &&  ((mode == null || WCMMode.DISABLED.equals(mode)))) {

            includeOptions.setDecorationTagName("");

        }

Avatar

Avatar

puradawid

Avatar

puradawid

puradawid

11-03-2018

Hey,

are you sure that nothing else is stopping parsys to render properly? I had the same problem with older version of AEM (6.1 SP1) but it turns out that there is an exception within one of components inside.