Help:Page status indicators

From Celeste Wiki
Jump to navigation Jump to search

<languages /> <translate> 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 is {{<tvar|1>ll|Help:Protected pages</>|protected}} or whether it is a featured article).

They are also variously called top icons, page icons, heading icons or title icons.

This functionality was added to {{<tvar|1>ll|MediaWiki 1.25</>|MediaWiki 1.25}} in <tvar|gerrit>Template:Gerrit</> to solve <tvar|bug>Template:Task</> and replace the numerous ad-hoc solutions to this problem, such as the English Wikipedia's ‘top icon’ template.

Viewing page status indicators[edit source]


<translate> Vector skin screenshot with indicator area marked.</translate>

<translate> Page status indicators are usually displayed in the top-right corner of the page, outside of the main content, or right before page title.</translate> <translate> Their exact location depends on the {{<tvar|1>ll|Help:Skins</>|skin}}.</translate>


Adding page status indicators in wikitext[edit source]

Use the following syntax to add indicators to a page, changing the <tvar|1>name</> attribute and contents of the tag to suit your tastes.

It is strongly recommended to create a {{<tvar|1>ll|Help:Templates</>|template}} for each indicator type you're going to need, instead of including the tag syntax directly in articles. </translate>

<indicator name="foo">[[File:Foo.svg|20px]]</indicator>

<translate> Note that:

  • Every indicator must have a unique identifier (name).</translate> <translate> It's not possible to have several indicators with the same name – in case of duplicates, the latest occurrence of the tag wins.</translate>


  • Indicators are displayed ordered by their names (case-sensitive) and not in order of their occurrence.</translate> <translate> This ensures consistency across pages and provides a simple means of ordering or grouping them.</translate>


  • Indicators are not tracked.</translate> <translate> They are intended to merely reflect the content or metadata that is already present on the page, and not be data themselves.</translate> <translate> You should be able to use the appropriate {{<tvar|1>ll|Help:Tracking categories</>|tracking category}}, template {{<tvar|2>ll|Transclusion</>|transclusions}} list, {{<tvar|3>ll|Help:Special pages</>|special page}} report, or other means to list pages that include a given indicator.</translate>


Customizing display on your wiki[edit source]

</translate> <translate> If the skin you're using supports page status indicators (all default skins do), you can adjust their display using [[<tvar|man>Special:MyLanguage/Manual:Skin configuration#Site-wide CSS modifications</>|site and user CSS]].</translate> <translate> The CSS classes to style are <tvar|1>.mw-indicators</> (for the entire containing block) and <tvar|2>.mw-indicator</> (for each separate indicator).</translate>

<translate> Each indicator is also given an ID of <tvar|1>#mw-indicator-name</>, where <tvar|2>name</> is the name assigned to the indicator using the <tvar|indicator><indicator name="foo"></> syntax.

Adding support for indicators in skins[edit source]

See <tvar|1>Template:Ll</>.

Using indicators from PHP code[edit source]

</translate> <translate> Access the <tvar|OutputPage>Template:Ll</> object and call its <tvar|setIndicators>setIndicators()</> method, passing an ID and the HTML string you want displayed.</translate> <translate> If you're adding a help link to documentation, call its <tvar|addHelpLink>addHelpLink()</> method, also implemented by <tvar|SpecialPage>Template:Ll</> and other classes.</translate> <translate> This puts a help link in the indicators area; for example, see <tvar|1>Special:WhatLinksHere</>.</translate>