Hide certain headings in the TOC
- Applies to:
- All MindTouch Versions
- Role required:
- Draft Contributor
You may decide to hide certain heading levels because of the length of the article, or because you do not want some heading levels included in the TOC.
To hide part of your TOC:
- Open your page in Edit mode.
- In the editor, click Styles and select CSS from the drop-down menu.
Step 2 adds a blue CSS box to the page that is only visible when the page is opened in Edit mode.
- Paste the following code into the CSS box and change the heading values for the headings you want to hide:
/* HIDE H3, H4 & H5 FROM TOC */ #mt-toc-container li li li { display:none; }
/* HIDE H4 & H5 FROM TOC */ #mt-toc-container li li li li { display:none; }
/* HIDE H5 FROM TOC */ #mt-toc-container li li li li li { display:none; }
You can apply the code site-wide or to an individual page. If you want to apply the code site-wide, apply the CSS in Control Panel > Custom Site CSS.