Skip to main content
selvaganesh
Level 5
Oct 16, 2015 2:28 AM UTC
Solved

Add attribute in Parsys Div

I want to add one extra attribute in AEM generated divs

Eg: Normally I get as below

<div class="parbase component section"></div>

I want to add an attribute like

<div class="parbase component section" newattribute> </div>

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
edubey
edubeyAccepted solution
Level 10
Oct 16, 2015 2:28 AM UTC

I dont think so this provides an options to add attribute instead of class.

I would suggest you to create extra DIV in your HTML for this attribute.

OR

Write a 3-4 lines of JS code to Add this attribute.

Could you please elaborate your use case?

thanks

5 replies

edubey
edubeyAccepted solution
Level 10
Oct 16, 2015 2:28 AM UTC

I dont think so this provides an options to add attribute instead of class.

I would suggest you to create extra DIV in your HTML for this attribute.

OR

Write a 3-4 lines of JS code to Add this attribute.

Could you please elaborate your use case?

thanks

Translate
selvaganesh
Level 5
Oct 16, 2015 2:28 AM UTC

I want to use IncludeOptions to add attribute instead of class. Is it possible ?

Translate
selvaganesh
Level 5
Oct 16, 2015 2:28 AM UTC

I wanted to add in <div class="parbase target section"></div> 

Not for the component , but if it is  targeted, i  need to add the attribute in above div which is not a part of component

Translate
edubey
Level 10
Oct 16, 2015 2:28 AM UTC

If you are looking to avoid these automatic div's denerated by AEM, use "cq:noDecoration" property. This way extra div's, apart from your html will not be generated.

Translate
Kunal_Gaba_
New Member
Oct 16, 2015 2:28 AM UTC

You need to create cq:HtmlTag for this use case. Check this article - http://dev.day.com/cemblog/en/experiencedelivers/2013/04/modify_the_auto-generateddivs.html

Translate