Extension:NoTOC

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual - list
Crystal Clear action run.png
NoTOC

Release status: stable

Implementation Parser extension
Description Turns off Table of Contents by default on all pages.
Author(s) Andrew Fitzgerald (Frantiktalk)
Last version 0.1.0
License GNU GPL
Download No link
Hooks used
ParserClearState
Check usage and version matrix; stats

This extension hides the table of contents by default. __TOC__ can still be used normally.

Contents

Download instructions[edit]

Please cut and paste the code found below and place it in $IP/extensions/NoTOC/NoTOC.php. Note: $IP stands for the root directory of your MediaWiki installation, the same directory that holds LocalSettings.php.

Installation[edit]

To install this extension, add the following to LocalSettings.php:

require_once("$IP/extensions/NoTOC/NoTOC.php");

Code[edit]

<?php
 
$wgExtensionCredits['parserhook'][] = array(
        'name' => 'NoTOC',
        'author' =>'[http://swiftlytilting.com Andrew Fitzgerald]', 
        'url' => 'http://www.mediawiki.org/wiki/Extension:NoTOC', 
        'description' => 'Turns off TOC by default on all pages',
        'descriptionmsg' => "notoc-desc",
        'version' => '0.1.0',
        'path' => __FILE__,
);
 
 
$wgHooks['ParserClearState'][] = 'efMWNoTOC';
 
function efMWNoTOC($parser) {
    $parser->mShowToc = false;
    return true;
}

See also[edit]

Language: English  • polski