Notebook

TABLEOF
CONTENTSXMODX EXTRA

A MODX extra for creating a Table of Contents based on the resources content.

Getting started

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.

Usage

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: -