Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.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.
-
Copy/upload the tocfilter.module and tocapi.module to the modules directory of your Drupal installation.
-
Enable the 'TOC filter' module in 'Extend'. (/admin/modules)
-
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.
-
Enable (check) the 'Table of Contents' filter under the list of filters and save the configuration.
-
(optional) Visit the 'Configuration > Site Structure > Table of contents' (/admin/structure/toc).
-
(optional) Place the TOC filter block on all pages. (/admin/structure/block)
Similar Modules
Author/Maintainer
Project information
Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed.Maintenance fixes only
Considered feature-complete by its maintainers.3,599 sites report using this module
- By jrockowitz on , updated
Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
Development version: 8.x-2.x-dev updated 25 May 2025 at 12:24 UTC

