What this solution does
Automatic Table of Contents module for 1C-Bitrix websites. The component scans the HTML code of a page within a specified container, identifies headings from h2 to h6, and generates a clickable menu with anchor links. The solution is compatible with all 1C-Bitrix 'Site Management' licenses.
Configuration of nesting levels allows selection of specific heading types to include in the table of contents. By default, levels h2 through h6 are active. To prevent interface clutter, a quantity limit is enforced: if more than 20 headings are found on a page, the module automatically displays only h2 elements. The table of contents block is hidden automatically when the number of headings is low.
The component's appearance is customizable via style parameters, including background color and font size. Installation requires no complex configuration and is performed using standard administrative panel tools.
The module automatically generates a table of contents based on h2 headings. If the text contains fewer than two such headings or the count falls below a specified minimum, the block remains hidden, leaving the page clean.
Appearance Configuration
Users can set the background, font size, and other basic CSS properties for the table of contents block. Other styles, including margins, link colors, and hover effects, are automatically inherited from the active site template, ensuring no conflicts with the overall design.
Technical Details
This solution is a standalone component. Scripts run on the client side, placing no load on the site database or server. It is compatible with all 1C-Bitrix license editions: Start, Standard, Expert, and Enterprise. The module functions correctly in both the visual editor and HTML mode without requiring any core modifications.
Anchors are generated automatically based on the heading ID and text using transliteration. The content container where headings are searched is configurable within the component settings. Each heading included in the table of contents is automatically wrapped in a div or p tag (configurable), guaranteeing reliable anchor link functionality even on complex layouts. Clicking a table of contents item triggers a scroll to the corresponding heading. The list automatically updates when new headings are added or existing text is modified.
The Exiterra 'Automatic Table of Contents' module generates tables of contents for pages on websites running on the 1C-Bitrix platform. The tool automatically creates a document structure based on article headings, simplifying navigation and improving content readability. The solution integrates into the existing infrastructure without requiring manual configuration of individual elements.
General iT can install and configure this module and check how it works on your website.