Extra div block in iParsys | Community
Skip to main content
Himanshu_Singhal
New Participant
Nov 21, 2017 12:39 PM UTC
Solved

Extra div block in iParsys

P

Hi,

I've using iParsys in my project. On parent page when I'm dragging component in iParsys, the DOM is like this.

In above snapshot, an extra is coming which is coming below dragged component section. But, in case of child pages, when we see DOM, the div section is coming at the top of the dragged component which is creating extra space.

I need to remove this extra <div class="new section"> or it would be okay if it comes to the dragged component for child pages instead of coming at the top of it.

Thanks,

Himanshu

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
kautuk_sahni
kautuk_sahniAccepted solution
Employee
Nov 22, 2017 8:19 AM UTC

Did you check this Technical Brainstorming : Removing component's auto generated div in AEM

// [Not tested]

For removing these extra divs you have to include these lines of code in your component level. These lines are-

if(WCMMode.fromRequest(request) != WCMMode.EDIT){

        IncludeOptions.getOptions(request,true).setDecorationTagName("");

}

We have to import these two statement for WCMMode and includeOptions-

@page import="com.day.cq.wcm.api.WCMMode"
@page import="com.day.cq.wcm.api.components.IncludeOptions"

And Worth reading:-https://aemcorner.com/aem-how-to-remove-div-wrapper-from-component/

Kautuk Sahni

9 replies

Nikash_Bahadur
Employee
Aug 22, 2018 12:10 PM UTC

Please elaborate on where to include these two lines when the components are developed using HTL.

Iparsys is included in the page component to hold the footer component. The extra div is coming up in the end of the page and it appears on Publish environment as well.

Awaiting your response.

Translate
kautuk_sahni
kautuk_sahniAccepted solution
Employee
Nov 22, 2017 8:19 AM UTC

Did you check this Technical Brainstorming : Removing component's auto generated div in AEM

// [Not tested]

For removing these extra divs you have to include these lines of code in your component level. These lines are-

if(WCMMode.fromRequest(request) != WCMMode.EDIT){

        IncludeOptions.getOptions(request,true).setDecorationTagName("");

}

We have to import these two statement for WCMMode and includeOptions-

@page import="com.day.cq.wcm.api.WCMMode"
@page import="com.day.cq.wcm.api.components.IncludeOptions"

And Worth reading:-https://aemcorner.com/aem-how-to-remove-div-wrapper-from-component/

Translate
Kautuk Sahni
Himanshu_Singhal
New Participant
Nov 22, 2017 3:04 AM UTC

Right. But, for iParsys even when I'm seeing the page in publish mode or "view as published", I can see the empty div there. The snapshot I've attached is from a page viewed as published.

Translate
VeenaVikraman
New Participant
Nov 21, 2017 10:02 PM UTC

himanshusinghal​

        Both are basically same. ANy code intended to run only in publish should be written in a conditional statement where you check the wcmmode as publish.

Translate
smacdonald2008
Level 10
Nov 21, 2017 9:37 PM UTC

You do not want to remove that DIV from Author as components will not be editable.

Translate
Himanshu_Singhal
New Participant
Nov 21, 2017 6:15 PM UTC

Veena, you mean to say in publish instance or when viewed page as published, this empty div won't appear?

Translate
smacdonald2008
Level 10
Nov 21, 2017 4:43 PM UTC

Also - why do you want to remove them anyhow?

Translate
VeenaVikraman
New Participant
Nov 21, 2017 4:42 PM UTC

   For components other than parsys , One suggestion while using the above solutions is to use them only in publish mode , since the additional divs enable the authoring of the component. If these divs are not present around the component in edit mode , it will not be author-able.

Translate
smacdonald2008
Level 10
Nov 21, 2017 3:22 PM UTC

See if this community helps you -- https://aemcorner.com/aem-how-to-remove-div-wrapper-from-component/

Translate