MediaWiki extensions manual
OOjs UI icon advanced-invert.svg
Release status: unmaintained
Description Adds a page in the MediaWiki namespace to the top of pages automatically
Author(s) X!talk
MediaWiki 1.6.0+
License GPL
Download See below

What can this extension do?Edit

This extension includes a system message at the top of a certain page.


To add a header to a page, create a page at "MediaWiki:Header-NS-PAGE" where NS is the numerical namespace code (e.g. 2 = User, 4 = Project) and PAGE is the page where you want it to show (excluding the namespace).

Example: To add a header on "Talk:Foo", create a page at "MediaWiki:Header-1-Foo" (page names without quotation marks, of course).

Download instructionsEdit

Please cut and paste the code found below and place it in $IP/extensions/Editheader/Editheader.php.


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



if (!defined('MEDIAWIKI')) die();

  *   Editheader extension
  *   Written by Soxred93
  *   Licensed under the GPL

$wgExtensionCredits['other'][] = array(
	   'name' => 'Editheader',

	   'author' =>'[http://en.wikipedia.org/wiki/User:Soxred93 Soxred93]',  
	   'description' => 'Adds a message to the top of a page, without using a template.',
	   'descriptionmsg' => 'editheader-desc'

$wgHooks['ArticleViewHeader'][] = 'fnEditheaderText';

function fnEditheaderText( &$article, $outputDone, $pcache ) {
    global $wgOut;

    $title = $article->mTitle->mTextform;
    $namespace = $article->mTitle->mNamespace;
    $msg = urlencode( strtolower( "header-$namespace-$title" ) );
    $x = wfMsg($msg);
    if( !wfEmptyMsg( $msg, wfMsg($x) ) ) {
        $wgOut->addWikiText( wfMsg( $source ) );
    return true;

See alsoEdit