In AnQiCMS, generating a clickable table of contents (Table of Contents, TOC) for your article detail page is a very practical feature.It can not only significantly improve the reading experience of users, help readers quickly locate the chapters of interest, especially important for long content, but also optimize the page SEO performance to a certain extent.The Auto CMS provides a very practical mechanism to help us achieve this, the core lies in the clever use of the title structure of the article content.
Understanding how to get the article title structure in AnQi CMS
To build a catalog, you first need to obtain information about all the titles in the article. Document details label in AnQi CMSarchiveDetailProvided a very critical field -ContentTitles。This field can automatically parse the article content for titles (such as H1, H2, H3, etc.) and return an array of structured data, with each item containing the text of the title, the HTML tag type (such as "H2"), and the level (such as H2