This extra takes your MODX content and creates an ordered list Table of Contents based on the
h6 tags. This can be used so that long articles and pages can be broken down and makes it easier for the user to click a section they'd like to jump to.
This is the main/only snippet included in this package and takes a template variable/chunk/placeholder and generates the Table Of Contents. The snippet has one parameter and that is to select what it should output:-
toc- This will output an ordered list with links to your page header tags
content- This will output your page content with your header tags with anchors
A typical way of using this would be to do the following: -
Support & Credits
If you have any problems or have ideas/suggestions, please let me know on the TableOfContentsX Github page.
Based on code by Joost de Valk, http://www.westhost.com/contest/php/function/create-table-of-contents/124