I'm trying to add custom class in the <main> element of the page. I tried to search the <main> element location in the crx/de, but could not find it. Can someone help me finding where to locate this file and made changes?
Views
Replies
Total Likes
Hi @PRATHYUSHA_VP
I tried this, but not working for me.
Views
Replies
Total Likes
@arunpatidar Yes I found the body, head elements but not able to locate the <main> element to add the custom class.
From the HTML image you have shared, it appears that the element is loading from your container component added in the editable template.
main/content/jcr_root/conf/yourproject/settings/wcm/templates
@narendiran_ravi Yes you are correct the element is loading from the container component. But my requirement is to add a custom page property(classname) different for every page to be added in the <main> element as a class. I still didn't found the <main> element location and how to add this page property in it.
Thanks
Views
Replies
Total Likes
hi @SahilDh1 ,
If its loading from the container component and the requirement is to add custom classes. I think you can add the styles and select it based on the page type at template level
Recommendation:
Hi,
you can write a sling filter if wants to just add additional class to a component(e.g. container) based on condition
Example -
here is the simplified version of above example : https://github.com/arunpatidar02/aem63app-repo/blob/master/java/XFFilter.java
@SahilDh1 Did you find the suggestions helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!
Views
Replies
Total Likes
Views
Like
Replies
Views
Likes
Replies
Views
Likes
Replies
Views
Like
Replies