Table of contents Delegation | Community
Skip to main content
Level 2
January 7, 2025
Solved

Table of contents Delegation

  • January 7, 2025
  • 2 replies
  • 833 views

Hi, Table of contents is a core component and it seems to suit our project requirements well. I have created a copy of it with supertype pointing to the ootb component. But, I do not require the page name that's displayed as part of the TOC list. I tried to check  the implementation and seems like a filter is being used which I am unable to delegate. Moreover, the rendering of the component is not in html and I am trying to see how the rendering is done. Any information on the end-end flow of the component functionality will be useful to achieve my requirements. Thanks !

Best answer by arunpatidar

Hi @sahana_s 

Did you triedignoreClasses property from policy to ignore items in the TOC?

https://experienceleague.adobe.com/en/docs/experience-manager-core-components/using/wcm-components/tableofcontents#properties-tab 

2 replies

EstebanBustamante
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
January 7, 2025

Hi,

 

AFAIK, the table of contents doesn't display any "page" information (if we're talking about an AEM page). Instead, it relies on the HTML rendered on the page. It scans the content and based on what it finds, it generates the table of contents. You can check that code here how this is being rendered: https://github.com/adobe/aem-core-wcm-components/blob/main/bundles/core/src/main/java/com/adobe/cq/wcm/core/components/internal/servlets/TableOfContentsFilter.java#L302 

 

So, if you need to change the text in the ToC, you’ll need to update the title of the corresponding element. For example:

 

 

I hope this helps.

 

Esteban Bustamante
Sahana_SAuthor
Level 2
January 8, 2025

Thank you for the reply @estebanbustamante . I understand the functionality works by parsing the h1 - h5 tags, but what about the Title/Pagename "Esteban Demo site". I tried to exclude the class name that page title uses but it didn't work. I want to omit the title it displays.

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
January 8, 2025
Arun Patidar
kautuk_sahni
Community Manager
Community Manager
January 27, 2025

@sahana_s 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!

Kautuk Sahni