Help:Table of Contents
(Created page with "==Overview== Mediawiki will automatically add a table of contents (TOC) to any page which has more than a couple of headings on it. There are various options you can take to a...")
Revision as of 11:31, 13 October 2020
Mediawiki will automatically add a table of contents (TOC) to any page which has more than a couple of headings on it. There are various options you can take to adjust this and the way it is presented.
PositionYou can force the TOC to appear by putting
You can prevent the TOC from appearing by addng to any page. That will supress the table of contents from appearing anywhere on the page.
The wiki is set up so that it only creates two "levels" of table of contents - that is it will produce entries and subentries - but nothing more than that.
Do not confuse this with the level of the heading! If you only use heading level 3 and heading level 4 on your page - then both will appear in the TOC - heading level three will be entries in the TOC and heading level 4 will be subentries. But if you include a single level 2 heading in the above page - then all the level 4 headings would disappear from the TOC - because it only goes to two levels.
Supressing Heading Levels
If you want to eliminate specific heading levels from the TOC - then you can do that by putting the TOC in an html "div" wrapper and setting an appropriate class on the wrapper. For instance if you want to prevent level 4 headings from appearing in the TOC then you put the table on the page instead a class that is toclimit-3. The example of the code is below.
<div class="toclimit-3"> __TOC__ </div>