Loading

Notebook

TABLEOF
CONTENTSXMODX EXTRA

This extra takes your MODX content and creates an ordered list Table of Contents based on the h1, h2, h3, h4, h5 and h6 tags.

MODX TableOfContentsX

What does it do?

This extra takes your MODX content and creates an ordered list Table of Contents based on the h1, h2, h3, h4, h5 and 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:

Generate the table of contents list

[[*content:TableOfContentsX=`toc`]]

Update the content to create anchors on the <hX> tags

[[*content:TableOfContentsX=`content`]]

Ready to give it a try? Download now!