Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

Issue with parsys div showing up on footer on publish

Avatar

Level 2

Hello,

We need to remove the parsys tag on the publish instance.So far I have done the following for the same.We are on AEM 6.2.

1)Added the cq:htmlTag node at the component level so that the div tags get generated as per the structure mentioned in the cq:htmlTag node.

2)Overlay the parsys.jsp to apps for the following change to render the div without parsys -
if(mode == publish){ IncludeOptions.getOptions(request, true).forceSameContext(Boolean.TRUE).setDecorationTagName("");

3)Added the sly tags to the template by replacing the div tags.

4)Include parsysLimiter on the footer.

The updates do not work for the footer.Please advise.

3 Replies

Avatar

Administrator

Please have a look at this article:- Remove component wrapper divs in CQ/AEM - CoderMagnet - JAVA JCR AEM Sightly Resource

// This article is what you are looking. It helps in Remove enclosing component divs in AEM



Kautuk Sahni

Avatar

Level 2

This issue is resolved.ParsysLimiter worked fine but there was an environmental issue causing the code to not reflect properly.

Avatar

Level 2

@kautuk - we have tried the options suggested in the link you provided but have an issue in the edit mode of the author.

Could you please help reopen this issue.

Option 1 -

We were able to get rid of the parsys tags with following code but not the parbase tags that come along with the editing.

<sly data-sly-test="${wcmmode.edit}">

<sly data-sly-resource="${'par_above' @ resourceType='wcm/foundation/components/parsys'}" ></sly>

</sly>

Option 2 -

We therefore tried but it disables the edit mode on author although it would successfully remove the tags -

<sly data-sly-test = "${wcmmode.preview || wcmmode.disabled}">

<sly data-sly-use.parsysLimiter="${'com.projectname.test.models.ParsysLimiter'}" />

</sly>

Content of the ParsysLimiter File -

public class ParsysLimiter {

@SlingObject

private SlingHttpServletRequest request;

@PostConstruct

public void init() {

if (WCMMode.DISABLED.equals(WCMMode.fromRequest(request))) {

request.setAttribute(ComponentContext.BYPASS_COMPONENT_HANDLING_ON_INCLUDE_ATTRIBUTE, Boolean.FALSE);

}

}