Extension:HeadersFooters

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manualManual:Extensions
Crystal Clear action run.png
HeadersFooters

Release status:Extension status experimental

ImplementationTemplate:Extension#type Parser extension
DescriptionTemplate:Extension#description Display headers and footers on articles
Author(s)Template:Extension#username Olivier Beatontalk
Latest versionTemplate:Extension#version 0.2.3 (2011-11-04)
LicenseTemplate:Extension#license BSD 2-clause "Simplified" License
Download Extension website (pay what you want)
CHANGELOG
ParametersTemplate:Extension#parameters

$wgHeadersFootersDuplicates

$wgHeadersFootersUsingGlobal

$wgHeadersFootersUsingNamespaces

$wgHeadersFootersUsingCategories

$wgHeadersFootersUsingPages

Hooks usedTemplate:Extension#hook
BeforePageDisplayManual:Hooks/BeforePageDisplay

Translate the HeadersFooters extension if it is available at translatewiki.net

Check usage and version matrix.

What can this extension do?[edit source]

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 source]

Download instructions[edit source]

You can consult the CHANGELOG for version history.

Installation[edit source]

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

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

Configuration parameters[edit source]

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 source]

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

Global[edit source]

Only two pages can be set.

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

Please note global is disabled by default.

Namespace[edit source]

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 source]

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 source]

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.

Support[edit source]

It's hoped that you will enjoy the extension, and if you do, consider purchasing it as a pay-what-you-want scheme on the author's website.

If you find a bug or wish to make a feature request, you can add to or start a topic on the talk page or contact the author.

Testing[edit source]

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 source]