Dynamically generate the table of contents from $Content

1.2.0 2016-08-04 08:18 UTC


License Build Status Code Quality Latest Stable Version

Automatically generate the table of contents from the Content of a page or, more generally, from any HTML field.


If you use composer, you could just run the following command:

composer require entidi/silverstripe-autotoc

To manually install it you should unpack or copy silverstripe-autotoc into your SilverStripe root directory, rename it to autotoc and do a ?flush.

This module can be used without the CMS.


Part of this project (the Tocifier class) is intentionally decoupled from SilverStripe so it can be tested without pulling in all the framework.

From the module root directory you can trigger the testing by calling phpunit (that must be previously installed on your system):

phpunit --bootstrap tests/Bootstrap.php tests/

Other documentation