Expand my Community achievements bar.

Adobe Summit 2025: AEM Session Recordings Are Live! Missed a session or want to revisit your favorites? Watch the latest recordings now.

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

SOLVED

Add attribute in Parsys Div

Avatar

Level 6

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>

1 Accepted Solution

Avatar

Correct answer by
Level 10

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

View solution in original post

5 Replies

Avatar

Employee Advisor

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

Avatar

Level 10

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.

Avatar

Level 6

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

Avatar

Level 6

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

Avatar

Correct answer by
Level 10

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