In AnQiCMS (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 user's reading experience, help readers quickly locate the chapters they are interested in, which is particularly important for long content, but also optimize the page's SEO performance to some extent.AnQi 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.

Understand how AnQi CMS retrieves the article title structure

To build a catalog, you first need to retrieve information about all the titles in the article. AnQi CMS document details tagarchiveDetailProvided a very critical field -ContentTitlesThis field can automatically parse the titles (such as H1, H2, H3, etc.) in the article content and return an array in a structured format, each item of which includes the text of the title, the HTML tag type (such as "H2"), and the level (such as H2