Jump to content

Extension:NoTOCModern

From mediawiki.org
MediaWiki extensions manual
NoTOCModern
Release status: stable
Implementation Extended syntax
Description Turns off the Table of Contents (TOC) by default on all pages
Author(s) Gota de agua (gota de aguatalk)
Latest version 2.0 (2026-06-04)
MediaWiki >= 1.39
PHP 8.2+
Database changes No
$wgNoTOCModernHideSpecialPages
Licence GNU General Public License 2.0 or later
Download

The NoTOCModern is a extension fork of the NoTOC extension, where was old and it couldn't be used anymore because one of the settings it had was made private by MediaWiki. So, since I needed this function, I made this extension that works on recent versions of MediaWiki. This extension hides the table of contents of all MediaWiki pages by default, also add a parameter for including special pages

In the version 2.0 you only need use the magic words __FORCETOC__ or __TOC__ for show the TOC.

what this extension can do?

[edit]

this extension hide the TOC by default but retains the magic word of MediaWiki __TOC__ for show the TOC you only To display the table of contents again on a page regardless of the headings, you must put __TOC__ in the location you want.

Installation

[edit]
  • Download and place the file(s) in a directory called NoTOCModern in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'NoTOCModern' );
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Configuration

[edit]
Name Default Description
$wgNoTOCModernHideSpecialPages
false
Allow hide the TOC of the all special pages