Inserting a table of contents with the Gutenberg Block
The Joli Table of contents block is the most flexible way to insert a TOC in your articles.
You can find it in the block list, under the WIDGETS category, or simply type “Joli Table of contents” like in the screenshot below.
The actual block will the show like so (but the theme will not render in the back-end) :
Insert the block anywhere in your content, and hide or edit some headings to your liking. If the auto-insert option is active for the current post, the block will override it.
Inserting a table of contents with the shortcode
The shortcode is the old way of manually inserting the TOC. If you have the choice, it is better to use the block instead but in some cases, the shortcode will remain useful
The default shortcode is
[ joli-toc ] (without spaces).
The shortcode tag can be changed if you are switching from another table of contents plugin and if you don’t want to change them all.
You can override any setting from the global settings using shortcode parameters.
Inserting a table of contents with the auto-insert
In order to automate the generation of the Table of contents throughout your website, you can use the auto-insert setting.
From the settings page, under the AUTO-INSERT tab, you need to check the desired post types to have the auto-insert function activated.
Alternately, you can use advanced rules to include or exclude specific posts in the auto-insert.
Each rule is independant, you do not need to check a post type to have the post ID auto-insert working.