Table of Contents
Jump to navigation
Jump to search
A Guide to Using MediaWiki in a Hosted Environment
An instructional website by the developer of mh370wiki.net - a MediaWiki site about Malaysia Airlines Flight MH370.
Table of Contents
MediaWiki automatically generates a Table of Contents (TOC) when more than three section headings are used on a page.
This behaviour can be controlled on a per-page basis using magic words:-
__NOTOC__- Hides the Table of Contents
__TOC__- The Table of Contents is positioned wherever this magic word is placed.
__FORCETOC__- Forces the Table of Contents to appear at its normal position (before the first header, overriding
__NOTOC__).
Some Issues:-
- If used on a page, the magic word
__NOTOC__may create unwanted white space equivalent to an empty line. - On the mh370wiki.net website I did not want an automatic Table of Contents on any page. Instead of placing
__NOTOC__on every page I disabled the TOC globally by adding a style to MediaWiki:Common.css[1].toc, #toc { display: none; } /* hide Table of Contents on ALL pages */ - With the Table of Contents hidden globally, neither
__TOC__nor__FORCETOC__could place a Table of Contents on a page. Using MediaWiki 1.43.1 with the Vector Skin and the css in Common.css commented out, a page with multiple h2 and h3 headings displayed a TOC as expected. But with the css enabled, the same page did not have a Table of Contents when either__TOC__or__FORCETOC__were added to the page.
Notes:-
- ↑ Originally sourced from HostKnox Knowledgebase How to manage sections and the table of contents of articles in MediaWiki