Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

TOC filter

3,529 sites Security covered Drupal 9–11
View on drupal.org

This module automatically generates a table of contents from your content's header tags. You can insert a special token into your text to indicate where the table of contents should appear, and this module will replace it with a responsive, hierarchical list of links. It also offers options to display the table of contents as a block and customize its appearance.

Converts header tags into a hierarchical table of contents using Drupal's input filter system.

The use case that the TOC filter module addresses is one of the simplest and most common approaches for table of contents in Drupal. Basically, you just enable the 'TOC filter' module add a [toc] token to your HTML and it will be replaced with a responsive table of contents.

Demo

Evaluate this project online using simplytest.me.

Requirements

The TOC filter 8.x-2.x requires the TOC API module which provides a framework for creating table of contents (TOC) from an HTML document's header tags.

Features

Besides the flexibility, provided by the TOC API, for defining how a table of contents is displayed, the TOC filter module includes the ability to

  • Move table of contents to a block
  • Customize an individual table of contents

Installation

IMPORTANT: Make sure your text formats are configured to support selected header tags.

  1. Copy/upload the tocfilter.module and tocapi.module to the modules directory of your Drupal installation.

  2. Enable the 'TOC filter' module in 'Extend'. (/admin/modules)

  3. Visit the 'Configuration > Content authoring > Text formats and editors' (/admin/config/content/formats). Click "configure" next to the input format you want to enable the 'Table of Contents' filter on.

  4. Enable (check) the 'Table of Contents' filter under the list of filters and save the configuration.

  5. (optional) Visit the 'Configuration > Site Structure > Table of contents' (/admin/structure/toc).

  6. (optional) Place the TOC filter block on all pages. (/admin/structure/block)

Similar Modules

Author/Maintainer

Depends on

Dependencies of the latest stable release

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
May 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Dormant

Releases

Version Type Core Release date
8.x-2.4 Stable 9–11 May 25, 2025