Extension:HeadersFooters

From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
Crystal Clear action run.svg
HeadersFooters
Release status: unmaintained
Implementation Parser extension
Description Display headers and footers on articles
Author(s) ofbeatontalk
Latest version 0.2.3 (2011-11-04)
License BSD 2-clause "Simplified" License
Download None
CHANGELOG
Parameters

$wgHeadersFootersDuplicates

$wgHeadersFootersUsingGlobal

$wgHeadersFootersUsingNamespaces

$wgHeadersFootersUsingCategories

$wgHeadersFootersUsingPages
Hooks used
BeforePageDisplay
Translate the HeadersFooters extension if it is available at translatewiki.net
Check usage and version matrix.

What can this extension do?[edit]

Allows you to specify article headers and footers to be included on a global, namespace, category or page basis.

You can specify:

  • Global Header/Footer
  • Namespace Header/Footer
  • Category Header/Footer
  • Page Header/Footer

The current version does not allow Special: header/footer's or gendered namespaces. By default global and page is turned off.

Usage[edit]

Download instructions[edit]

No longer offered for download. Support for this behaviour was always buggy and error prone, so never went beyond experimental. Was never recommended for use.

You can consult the CHANGELOG for version history.

Installation[edit]

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

require_once("$IP/extensions/HeadersFooters/HeadersFooters.php");
#add configuration parameters here

Configuration parameters[edit]

For your convenience, we also support Extension:Configure for settings these from within your wiki. See the talk page FAQ for further details.

Parameter Values Default Description
$wgHeadersFootersDuplicates
  • true
  • false
false Repeat duplicate headers/footers
$wgHeadersFootersUsingGlobal
  • true
  • false
false enable global headers/footers
$wgHeadersFootersUsingNamespaces
  • true
  • false
true enable namespace headers/footers
$wgHeadersFootersUsingCategories
  • true
  • false
true enable category headers/footers
$wgHeadersFootersUsingPages
  • true
  • false
false enable page headers/footers

Defining Headers/Footers[edit]

You can visit a Special:HeadersFooters to facilitate the creation of your headers and footers.

Global[edit]

Only two pages can be set.

MediaWiki:Headersfooters-global-header
MediaWiki:Headersfooters-global-footer

Please note global is disabled by default.

Namespace[edit]

For the main content name space NS_MAIN:

MediaWiki:Headersfooters-ns-0-header
MediaWiki:Headersfooters-ns-0-footer

Please note the double // to indicate a blank namespace (or otherwise known as NS_MAIN).

Or for all user talk pages NS_USER_TALK:

MediaWiki:Headersfooters-ns-3-header
MediaWiki:Headersfooters-ns-3-footer

Please note gendered namespaces are not currently supported. See Namespace constants for the numbers.

Category[edit]

You can specify a header/footer that all pages that belong to a specific category inherit.

MediaWiki:Headersfooters-cat-Cities-header
MediaWiki:Headersfooters-cat-Cities-footer

In this example, the Cities category has a header and footer for all it's member pages. Category Footers since they are cumulative are the most likely to introduce duplicates (a config option omits them).

Page[edit]

You can also specify a Header or Footer for a specific page. This is mostly so that you can make an uneditable section for a page.

MediaWiki:Headersfooters-page-0-Ottawa-header
MediaWiki:Headersfooters-page-0-Ottawa-footer

The header and footer for the Ottawa page in NS_MAIN.

MediaWiki:Headersfooters-page-2-Finlay-header
MediaWiki:Headersfooters-page-2-Finlay-footer

The header and footer for the Finlay page in NS_USER. Please note that namespace names are localized and gendered.

Please note page is disabled by default.

Testing[edit]

It has been tested with:

  • MediaWiki svn: trunk 2011-10-01, 1.18alpha 2011-10-01, 1.17branch 2011-10-01
  • MediaWiki releases: 1.19.7 1.17.0, 1.16.0, 1.15.5

See also[edit]

  • Extension:HeaderFooter an independent implementation of similar functionality.
  • Extension:PageNotice : 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).