Last updated 18 March 2016. Created on 3 June 2014.
Edited by jrockowitz, rv0, e0ipso, neRok. Log in to edit this page.

This page intends to compare the various modules that create Table of Contents.

Whilst having a module that creates a Table of Contents sounds like a simple task on the surface, there are many methods by which to access and then manipulate the data from Drupal. The difference in implementation is what sets the majority of modules apart.

Modules can access the data/field during field load or view, node/entity load or view, as a text filter or field display formatter, or even on final page view (such as with javascript). The module can then manipulate the data with RegEx, or by walking the DOM tree (which provides safer and more-consistent results). It can also be an automatic process, or one that requires 'place-holders' in the text to work.

Module Versions HTML Modify Method Drupal integration Fields Choose Selectors TOC Location TOC Format Back to Top Links Cached Output
6.x 7.x 8.x
Simple TOC No Yes DOM Node load Any node long-text H2-H6, no options Attached to field, block, panel and display suite field OL, UL, DIV Yes, customisable Yes
Table of Contents Yes dev RegEx Node view / text-filter Node body only ? Replace token in field ? Yes ?
Simple Table of Contents No Yes DOM Node view Node body only H2-H6, choose minimum Replace token in field UL No ?
TOC filter Yes Yes Yes < 7.x RegEx; > 8.x DOM Text filter Any that uses text filter H2 or H3 Token within text OL, UL Yes ?
Flexible Table Of Contents No Yes DOM Text Field Display Formatter Any text field. Any jQuery-like selector. Block Themeable. UL by default. No Yes
TOC Formatter Yes Yes Yes DOM Text Field Display Formatter Any text field H2 only Top of field ? At H2 only ?
TOC Node No Yes DOM Node page (view) Includes all visible fields of a node H2-H6 Added above node, Block OL, UL Yes ?
Node Field TOC

Node Field Table of Contents Note: appears to be an incorrect duplicate project.
No Yes ? ? ? ? Panels pane OL, UL ? ?
jQuery Table Of Contents (TOC) No Yes JS DOM Javascript on Node page (view) Any Freely configurable Anywhere with jquery selector OL, UL Yes No
TOC API No No Yes DOM API (Requires contrib or custom module) Any HTML H1-H6, many options OL, UL, and SELECT. (Responsive) Yes

Looking for support? Visit the forums, or join #drupal-support in IRC.