web_table_of_contents Shortcode
The web_table_of_contents shortcode renders the table of contents component.
The attributes below match the current Page Builder controls and public output. Use raw syntax only for reviewed content that cannot be maintained through the visual controls.
Usage
Place the shortcode in the content whose headings you want to list. It indexes the rendered headings in that content, including nested blocks and shortcodes. In a standalone template call, it uses the current page's saved content. With no usable source or matching headings, it renders nothing.
[web_table_of_contents]
Attributes
| Attribute | Default | Accepted values | Purpose |
|---|---|---|---|
table_of_contents_title |
— | String unless stated otherwise | Enter table of contents title. |
table_of_contents_style |
numerated |
numerated, dotted, none |
Choose list style. |
table_of_contents_included_headers |
1,2,3,4,5,6 |
Comma-separated levels 1–6 | Select heading levels, for example 2,3. |
accessible_name |
Table of contents | Plain text | Optional navigation landmark label. |
device_visibility |
— | String unless stated otherwise | Applies the selected responsive visibility rule. |
el_id |
— | Valid unique HTML ID | Enter section ID (Note: make sure it is unique and valid according to w3c specification). |
el_class |
— | String unless stated otherwise | If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file. |
Verification
Verify web_table_of_contents with representative content, its empty state and every enabled responsive range. Pay particular attention to table_of_contents_title and table_of_contents_style.
Unique authored heading anchors are preserved; missing or conflicting IDs receive distinct generated destinations. Set explicit heading anchors for stable external deep links. Renaming a heading can change its generated destination. Headings removed by permission rules are not indexed.
The shortcode shares its rendering and existing conditional scrolling script with Gutenberg Table of Contents. Ordinary visible-heading links work without JavaScript. Cached Legacy indexes whose headings have no generated IDs retain their title-based links through the shared scrolling script. The script respects reduced motion and optional headers; interactive containers need their normal scripts. No index-specific frontend stylesheet is added.