Add attribute in Parsys Div | Community
Skip to main content
selvaganesh
New Participant
October 16, 2015
Solved

Add attribute in Parsys Div

  • October 16, 2015
  • 5 replies
  • 2057 views

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.
Best answer by edubey

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

Kunal_Gaba_
New Participant
October 16, 2015

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

edubey
New Participant
October 16, 2015

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.

selvaganesh
New Participant
October 16, 2015

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

selvaganesh
New Participant
October 16, 2015

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

edubey
edubeyAccepted solution
New Participant
October 16, 2015

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