Extension:NoTitle

What can this extension do?
Adds a magic word, __NOTITLE__, that lets you hide the main title heading.

Usage
Just put __NOTITLE__ on any pages where you want to hide the title. This extension will work for any skins that puts the title heading in an  with , including the default MonoBook skin.

Installation
Create a file in your extensions directory called  with the following code: <?php

$NoTitle = new NoTitle;

$wgHooks['MagicWordMagicWords'][] = array($NoTitle, 'addMagicWord'); $wgHooks['MagicWordwgVariableIDs'][] = array($NoTitle, 'addMagicWordId'); $wgHooks['LanguageGetMagic'][] = array($NoTitle, 'addMagicWordLanguage'); $wgHooks['ParserAfterStrip'][] = array($NoTitle, 'checkForMagicWord'); $wgHooks['BeforePageDisplay'][] = array($NoTitle, 'hideTitle');

class NoTitle {

function NoTitle {}

function addMagicWord(&$magicWords) { $magicWords[] = 'MAG_NOTITLE'; return true; }

function addMagicWordId(&$magicWords) { $magicWords[] = MAG_NOTITLE; }

function addMagicWordLanguage(&$magicWords, $langCode) { switch($langCode) { default: $magicWords[MAG_NOTITLE] = array(0, '__NOTITLE__'); }   return true; }

function checkForMagicWord(&$parser, &$text, &$strip_state) { $mw = MagicWord::get('MAG_NOTITLE');

if (!in_array($action, array('edit', 'submit')) && $mw->matchAndRemove($text)) { $parser->mOptions->mHideTitle = true; }

return true; } function hideTitle(&$page) {

if ($page->parserOptions->mHideTitle) { $page->mScripts .= ' h1.firstHeading { display:none; } '; }

return true; } }

?>

Changes to LocalSettings.php
Add the following line to your  file in the wiki root: require_once("$IP/extensions/notitle.php");