respinar/contao-tableofcontents

Table of Contents for Contao

Maintainers

Package info

github.com/respinar/contao-tableofcontents

Type:contao-bundle

pkg:composer/respinar/contao-tableofcontents

Transparency log

Statistics

Installs: 51

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 0

0.10.0 2026-04-15 18:42 UTC

This package is auto-updated.

Last update: 2026-08-21 18:43:09 UTC


README

This Contao extension adds a table of contents to your page using JavaScript. It scans a container (for example an article with the CSS class layout_full) for h2 and h3 headings and builds a linked list of them.

Based on https://techindetail.com/table-of-contents-javascript/

Table of contents

Table of contents (TOC) is the list of all the headings in a blog post or an article with a link to each of these headings.

TOC is used to navigate faster to a particular heading in a long content webpage: clicking a link in the TOC scrolls directly to that section of the page.

How to use

Add the Table of Contents content element or frontend module to your page and configure its settings:

Setting Description
Title An optional heading shown above the table of contents.
Article selector The CSS id or class of the container to scan for headings. If a matching id exists, it takes priority. Leave empty to use #main.
Headings Which headings to include in the list: h2 only, or h2 and h3.