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
Views
Replies
Total Likes
Hi @SahilDh1
If you're using latest archetype version, below is the structure where you can find <main> section in index.html
Hope this helps
Thanks
Views
Replies
Total Likes
Hi @PRATHYUSHA_VP
I tried this, but not working for me.
Views
Replies
Total Likes
Hi @SahilDh1
Please check your page component. The HTML tags are derived from there, example head, body etc.
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:
Views
Replies
Total Likes
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
Views
Replies
Total Likes