PHPackages                             bluebranch/inhaltsverzeichnis - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. bluebranch/inhaltsverzeichnis

ActiveContao-bundle[Utility &amp; Helpers](/categories/utility)

bluebranch/inhaltsverzeichnis
=============================

Automatically generates a hierarchical table of contents from headline content elements in Contao.

1.0.3(3mo ago)07↓92.9%[1 issues](https://github.com/BlueBranch-GmbH/contao-inhaltsverzeichnis/issues)MITPHPPHP ^8.1

Since Feb 24Pushed 1mo agoCompare

[ Source](https://github.com/BlueBranch-GmbH/contao-inhaltsverzeichnis)[ Packagist](https://packagist.org/packages/bluebranch/inhaltsverzeichnis)[ RSS](/packages/bluebranch-inhaltsverzeichnis/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (2)Versions (5)Used By (0)

Inhaltsverzeichnis für Contao (DE)
==================================

[](#inhaltsverzeichnis-für-contao-de)

Generiere automatisch ein hierarchisches Inhaltsverzeichnis aus den Überschriften deiner Contao-Seite – als Content-Element oder Frontend-Modul, mit Anker-Links zu jeder Überschrift.

Installation
------------

[](#installation)

```
composer require bluebranch/inhaltsverzeichnis
php vendor/bin/contao-console contao:migrate
```

Danach steht das Element unter **Inhaltselemente → Einschlüsse → Inhaltsverzeichnis** sowie als Frontend-Modul zur Verfügung.

Verwendung
----------

[](#verwendung)

1. Inhaltsverzeichnis-Element in einen Artikel einfügen (oder als Frontend-Modul ins Layout einbinden)
2. Quellen-Modus wählen (siehe unten)
3. Start- und Endebene der Überschriften festlegen (Standard: h2–h4)
4. Listentyp wählen: geordnete (`ol`) oder ungeordnete (`ul`) Liste
5. Speichern – fertig

Das Element rendert ein `` mit verschachtelten Links zu allen gefundenen Überschriften. Alle Überschriften auf der Seite erhalten dabei automatisch `id`-Attribute als Anker.

Quellen-Modi
------------

[](#quellen-modi)

### Artikelinhalte (Standard)

[](#artikelinhalte-standard)

Durchsucht die Überschriften-Inhaltselemente (`tl_content`) der aktuellen Seite per Datenbankabfrage. Über einen Spaltenfilter lässt sich einschränken, welche Layout-Spalten berücksichtigt werden (Hauptspalte, linke Spalte, rechte Spalte, Kopf- und Fußbereich).

Dieser Modus ist ideal für klassische Seiten, auf denen der gesamte Inhalt aus Contao-Artikeln besteht.

### Gesamte Seite

[](#gesamte-seite)

Erfasst alle Überschriften der vollständig gerenderten Seite – einschließlich Überschriften aus News-Artikeln, Event-Details, Element-Gruppen und beliebigen anderen Frontend-Modulen.

Der Modus funktioniert, indem nach dem Rendern der gesamten Seite ein `kernel.response`-Listener alle ``–`` im HTML auswertet, IDs injiziert und den Platzhalter des Elements durch den fertigen TOC ersetzt.

> Hinweis: Der Spaltenfilter ist in diesem Modus nicht wirksam, da alle Überschriften der Seite unabhängig von ihrer Layout-Spalte erfasst werden.

Einstellungen im Backend
------------------------

[](#einstellungen-im-backend)

EinstellungBeschreibungQuellen`Artikelinhalte` (DB-Abfrage) oder `Gesamte Seite` (Response-Scan)StartebeneKleinste Überschriftenebene im TOC (z. B. 2 für h2)EndebeneGrößte Überschriftenebene im TOC (z. B. 4 für h4)ListentypGeordnete (`ol`) oder ungeordnete (`ul`) ListeSpaltenWelche Layout-Spalten durchsucht werden (nur im Modus „Artikelinhalte")Automatische ID-Injection
-------------------------

[](#automatische-id-injection)

Unabhängig vom gewählten Modus injiziert die Erweiterung automatisch `id`-Attribute in alle ``–`` auf der Seite, die noch kein `id`-Attribut besitzen. Die IDs werden als URL-taugliche Slugs aus dem Überschriftentext generiert und bei Duplikaten automatisch nummeriert (z. B. `abschnitt`, `abschnitt-2`, `abschnitt-3`).

So funktionieren Anker-Links auch dann, wenn das Inhaltsverzeichnis-Element gar nicht auf der Seite eingebunden ist.

Vorteile
--------

[](#vorteile)

- Kein manuelles Setzen von Anker-IDs notwendig
- Unterstützt alle Contao-Seitentypen: News, Events, Element-Gruppen, eigene Module
- Als Content-Element und als Frontend-Modul nutzbar
- Konfigurierbar nach Überschriftenebene, Listentyp und Layout-Spalte
- Kompatibel mit Contao 4.13 und Contao 5.x

---

Table of Contents for Contao (EN)
=================================

[](#table-of-contents-for-contao-en)

Automatically generate a hierarchical table of contents from the headings on your Contao page – as a content element or frontend module, with anchor links to every heading.

Installation
------------

[](#installation-1)

```
composer require bluebranch/inhaltsverzeichnis
php vendor/bin/contao-console contao:migrate
```

The element is then available under **Content elements → Includes → Inhaltsverzeichnis** and as a frontend module.

Usage
-----

[](#usage)

1. Insert the table of contents element into an article (or add it as a frontend module to a layout)
2. Choose a source mode (see below)
3. Set the start and end level for headings (default: h2–h4)
4. Choose a list type: ordered (`ol`) or unordered (`ul`)
5. Save – done

The element renders a `` with nested links to all found headings. All headings on the page automatically receive `id` attributes as anchors.

Source Modes
------------

[](#source-modes)

### Article content (default)

[](#article-content-default)

Queries the heading content elements (`tl_content`) of the current page from the database. A column filter lets you restrict which layout columns are included (main column, left column, right column, header and footer).

This mode is ideal for classic pages where all content comes from Contao articles.

### Entire page

[](#entire-page)

Captures all headings from the fully rendered page – including headings from news articles, event details, element groups, and any other frontend modules.

This works by running a `kernel.response` listener after the entire page has been rendered. The listener scans all ``–`` elements in the HTML, injects IDs, and replaces the element's placeholder with the finished TOC.

> Note: The column filter has no effect in this mode, as all headings on the page are captured regardless of their layout column.

Backend Settings
----------------

[](#backend-settings)

SettingDescriptionSources`Article content` (DB query) or `Entire page` (response scan)Start levelLowest heading level included in the TOC (e.g. 2 for h2)End levelHighest heading level included in the TOC (e.g. 4 for h4)List typeOrdered (`ol`) or unordered (`ul`) listColumnsWhich layout columns are searched (only in "Article content" mode)Automatic ID injection
----------------------

[](#automatic-id-injection)

Regardless of the chosen mode, the extension automatically injects `id` attributes into all ``–`` elements on the page that do not already have one. IDs are generated as URL-safe slugs from the heading text and are numbered automatically when duplicates occur (e.g. `section`, `section-2`, `section-3`).

This means anchor links work even when the table of contents element is not present on the page.

Advantages
----------

[](#advantages)

- No manual anchor IDs required
- Supports all Contao page types: news, events, element groups, custom modules
- Available as both a content element and a frontend module
- Configurable by heading level, list type, and layout column
- Compatible with Contao 4.13 and Contao 5.x

---

Vielen Dank
-----------

[](#vielen-dank)

Danke für die Nutzung der Inhaltsverzeichnis-Erweiterung.

Das Team von [www.bluebranch.de](https://www.bluebranch.de/)

Changes
-------

[](#changes)

### 1.1.x – 2026-02-24

[](#11x--2026-02-24)

- Add source mode "Entire page" (`toc_source = 'page'`) for news, events, element groups and all frontend modules
- Add automatic `id` injection for all headings via `kernel.response` listener

### 1.0.x – 2024

[](#10x--2024)

- Initial release
- Content element and frontend module for generating a hierarchical table of contents
- Configurable heading levels (start/end), list type (ol/ul) and layout column filter
- Automatic slug generation with deduplication

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance84

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~4 days

Total

4

Last Release

116d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/366ef9956d51bf8775096d498b0bf8b12da6c9f8a9b439881593246be664de97?d=identicon)[BlueBranch GmbH](/maintainers/BlueBranch%20GmbH)

---

Top Contributors

[![LBeckX](https://avatars.githubusercontent.com/u/11272361?v=4)](https://github.com/LBeckX "LBeckX (8 commits)")

---

Tags

contaoTOCtable-of-contentsinhaltsverzeichnis

### Embed Badge

![Health badge](/badges/bluebranch-inhaltsverzeichnis/health.svg)

```
[![Health](https://phpackages.com/badges/bluebranch-inhaltsverzeichnis/health.svg)](https://phpackages.com/packages/bluebranch-inhaltsverzeichnis)
```

###  Alternatives

[metamodels/core

MetaModels core

10156.4k68](/packages/metamodels-core)[codefog/contao-haste

haste extension for Contao Open Source CMS

46676.5k170](/packages/codefog-contao-haste)[codefog/contao-news_categories

News Categories bundle for Contao Open Source CMS

3189.0k6](/packages/codefog-contao-news-categories)[terminal42/contao-node

Node bundle for Contao Open Source CMS

3177.0k6](/packages/terminal42-contao-node)[terminal42/contao-folderpage

Provides a new page type for Contao that allows you to group pages into folders.

18156.0k10](/packages/terminal42-contao-folderpage)[contao-bootstrap/core

Core of Contao Bootstrap extension

1791.6k24](/packages/contao-bootstrap-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
