Page status indicators are icons (or short text snippets) displayed outside of the main content that provide quick information about the status of the article (for example whether the page isprotected or whether it is afeatured article).
They are also variously called top icons, page icons, heading icons or title icons.
This functionality was added toMediaWiki 1.25 inGerrit change 162609 to solveT25796 and replace the numerous ad-hoc solutions to this problem, such as the English Wikipedia's‘top icon’ template.
Page status indicators are usually displayed in the top-right corner of the page, outside of the main content, or right before page title.Their exact location depends on theskin.
Use the following syntax to add indicators to a page, changing thename
attribute and contents of the tag to suit your tastes.
It is strongly recommended to create atemplate for each indicator type you're going to need, instead of including the tag syntax directly in articles.
Wikitext syntax:
<indicatorname="foo">[[File:Foo.svg|20px]]</indicator>
Lua module syntax:
mw.getCurrentFrame():extensionTag{name="indicator",content='[[File:Foo.svg|20px]]',args={name="foo"}}
Beachte:
title
attribute with the contents of the caption.If the skin you're using supports page status indicators (all default skins do), you can adjust their display usingsite and user CSS.The CSS classes to style are.mw-indicators
(for the entire containing block) and.mw-indicator
(for each separate indicator).
Each indicator is also given an ID of#mw-indicator-name
, wherename
is the name assigned to the indicator using the<indicatorname="foo">
syntax.
Access theOutputPage object and call itssetIndicators()
method, passing an ID and the HTML string you want displayed.If you're adding a help link to documentation, call itsaddHelpLink()
method, also implemented bySpecialPage and other classes.This puts a help link in the indicators area; for example, seeSpecial:WhatLinksHere.