Manual:$wgFooterIcons

From MediaWiki.org
Jump to: navigation, search
Translate this page; This page contains changes which are not marked for translation.

Other languages:
English • ‎español • ‎français • ‎日本語 • ‎polski
Skins: $wgFooterIcons
Abstract list of footer icons for skins in place of old copyrighticoManual:$wgCopyrightIcon and poweredbyico code
Introduced in version: 1.17.0 (r77741)
Removed in version: still in use
Allowed values: array
Default value: see below
Other settings: Alphabetical | By function

Details[edit]

You can add new icons to the built in copyright or poweredby, or you can create a new block. Though note that you may need to add some custom css to get good styling of new blocks in monobook; vector and modern should work without any special css.

$wgFooterIcons itself is a key/value array. The key is the name of a block that the icons will be wrapped in. The final id varies by skin; Monobook and Vector will turn poweredby into f-poweredbyico while Modern turns it into mw_poweredby. The value is either key/value array of icons or a string. In the key/value array the key may or may not be used by the skin but it can be used to find the icon and unset it or change the icon if needed. This is useful for disabling icons that are set by extensions. The value should be either a string or an array. If it is a string it will be output directly as html, however some skins may choose to ignore it. An array is the preferred format for the icon, the following keys are used:

src
An absolute url to the image to use for the icon, this is recommended but not required, however some skins will ignore icons without an image
srcset
Used for HiDPI display supportHiDPI display support. You can specify paths to larger versions of the icon.
url
The url to use in the <a> around the text or icon, if not set an <a> will not be outputted.
alt
This is the text form of the icon, it will be displayed without an image in skins like Modern if src is not set, and will otherwise be used as the alt="" for the image. This key is required.
width
height
If the icon specified by src is not of the standard size you can specify the size of image to use with these keys. Otherwise they will default to the standard 88x31.

Default value[edit]

The default value in MediaWiki 1.17 and higher is:

$wgFooterIcons = array(
	"copyright" => array(
		"copyright" => array(), // placeholder for the built in copyright icon
	),
	"poweredby" => array(
		"mediawiki" => array(
			"src" => null, // Defaults to "$wgStylePath/common/images/poweredby_mediawiki_88x31.png"
			"url" => "https://www.mediawiki.org/",
			"alt" => "Powered by MediaWiki",
		)
	),
);

Site customization[edit]

Sites can customize and add new icons to the footer.

$wgFooterIcons['poweredby']['myicon'] = array(
	"src" => "/path/to/my/image.png", // you may also use a direct path to the source, e.g. "http://example.com/my/custom/path/to/MyCustomLogo.png"
	"url" => "http://example.com/",
	"alt" => "Some text here...",
	// For HiDPI support, you can specify paths to larger versions of the icon.
	"srcset" =>
		"/path/to/1.5x_version.png 1.5x, " .
		"/path/to/2x_version.png 2x",
	// If you have a non-default sized icon you can specify the size yourself.
	"height" => "31", 
	"width" => "88", 
);

You can add to the poweredby or/ copyright if you want stuff to show up in the old MonoBook areas, or you can add a brand new group of icons.

Disable icons[edit]

To disable footer icon showing the page is "Powered by MediaWiki" add the following line to your "LocalSettings.php" file:

unset( $wgFooterIcons['poweredby'] );

To disable footer placeholder for the copyright icon which appears when $wgRightsTextManual:$wgRightsText is set, just set $wgRightsIconManual:$wgRightsIcon to null.

$wgRightsIcon = null;