Extension:Header Footer

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

Release status: stable

Description Provides per-namespace and per-page header + footer inclusion.
Author(s)
Latest version 2.0.2 (2013-06-26)
MediaWiki 1.10 - 1.17, 1.21
License No license specified
Download See download section
Example [1]
Hooks used
OutputPageParserOutput

Translate the Header Footer extension if possible

Check usage and version matrix; code metrics

Purpose[edit | edit source]

Provides per-namespace and per-page header and footer inclusion.

Features[edit | edit source]

  • Speed: integrated with parser caching
  • Secure: header and footer articles are located in the NS_MEDIAWIKI namespace
  • Controllable: headers and/or footers can be disabled on pages which are edit protected
  • Customizable: headers and footers are wrapped in <div> elements

Download[edit | edit source]

MediaWiki 1.21+[edit | edit source]

Project page
Download snapshot

Git [Help]
Commit history
Note:
No localisation updates are provided by translatewiki.net.

If you are familiar with git and have shell access to your server, you can obtain the extension, with all its tags and branches, as follows:

cd extensions
git clone https://github.com/jamesmontalvo3/MediaWiki-HeaderFooter.git HeaderFooter

MediaWiki 1.18 - 1.20[edit | edit source]

Unknown at this time which version of HeaderFooter will work with these versions of MediaWiki.

MediaWiki 1.17 and Below[edit | edit source]

SVN

See SVN ($Id: HeaderFooter.doc.wikitext 1170 2008-05-27 12:38:24Z jeanlou.dupont $)

Installation[edit | edit source]

Download the files as described above, put them in your MediaWiki extensions folder, then include this line in your LocalSettings.php file:

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

Usage[edit | edit source]

Per-Namespace Header and Footer[edit | edit source]

Edit the pages:

  • MediaWiki:Hf-nsheader-namespace name
  • MediaWiki:Hf-nsfooter-namespace name

For the 'main' namespace, just use blank i.e. no string, but with the hyphen:

  • MediaWiki:Hf-nsheader-
  • MediaWiki:Hf-nsfooter-

Per-Page Header and Footer[edit | edit source]

Edit the pages:

  • MediaWiki:Hf-header-page name
  • MediaWiki:Hf-footer-page name

Disable commands[edit | edit source]

On edit protected pages, one can add

  • __NOHEADER__ to suppress the page level header
  • __NOFOOTER__ to suppress the page level footer
  • __NONSHEADER__ to suppress the namespace level header
  • __NONSFOOTER__ to suppress the namespace level footer

CSS[edit | edit source]

  • Page Level Header: <div class="hf-header">
  • Namespace Level Header: <div class="hf-nsheader">
  • Page Level Footer: <div class="hf-footer">
  • Namespace Level Footer: <div class="hf-nsfooter">

Examples[edit | edit source]

  1. Page MediaWiki:hf-nsheader-Extension would contain the wikitext to be included as header for all pages of the Extension namespace.
    • In this case, to suppress the header of the page Extension:HeaderFooter one should a) edit protect it, and b) add __NONSHEADER__ in it.
  2. Page MediaWiki:hf-footer-Extension:HeaderFooter would contain the wikitext to be included as footer for the page Extension:HeaderFooter.
    • In this case, to suppress the footer of the page Extension:HeaderFooter one should a) edit protect it, and b) add __NOFOOTER__ in it.

Dependency[edit | edit source]

Versions for MediaWiki 1.17 and below are dependent upon the StubManager extension. That dependency has been removed for MediaWiki 1.21+.

Release History[edit | edit source]

  • 2.0.0: Complete redesign --Jean-Lou Dupont
  • 2.0.1: Fixed bug related to disable keywords (e.g. __NONSFOOTER__) --Jean-Lou Dupont
  • 2.0.2: Updated to work with MW 1.21 and removed StubManager dependency. Moved revision control from SVN to GitHub. --Jamesmontalvo3 (talk) 23:12, 26 June 2013 (UTC)

See also[edit | edit source]

  • Extension:HeadersFooters an independent implementation of similar functionality.
  • Extension:PageNotice: The PageNotice extension provides a way for you to define fixed notice messages for the top or the bottom of a page (by individual page name), or entire namespaces (by namespace number).

Sites Using Header Footer[edit | edit source]