Tango.info wiki mediawiki: Difference between revisions

From tango.info wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
==TOC on every page==
==Overview==
This page documents some customization to the MediaWiki installation used by the [[tango.info wiki]].
 
==TOC==
There is no TOC if there is no headline in the markup.
 
If there is one headline, then there is a TOC and the TOC is placed before any content.
 
In LocalSettings.php
In LocalSettings.php
<pre>
<pre>
Line 12: Line 19:
}
}
</pre>
</pre>


==Date and time format==
==Date and time format==

Revision as of 2013-04-09T00:35:42

Overview

This page documents some customization to the MediaWiki installation used by the tango.info wiki.

TOC

There is no TOC if there is no headline in the markup.

If there is one headline, then there is a TOC and the TOC is placed before any content.

In LocalSettings.php

$wgHooks['InternalParseBeforeLinks'][] = 'ForceTocOnEveryPage_renderForceToc';
 
function ForceTocOnEveryPage_renderForceToc( &$parser, &$text ) {
        global $mediaWiki;
        if( !isset($mediaWiki) ) return true;
        if( $parser->getTitle()->getNamespace() != 0 ) return true;
        $text = "__TOC__\n".$text;
        return true;
}


Date and time format

???
//defined in messagesEn.php
//$defaultDateFormat = 'ISO 8601';