Hoppa till innehållet

Hjälp:Page status indicators

Från Plutten

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

  1. REDIRECT Template:Localized link 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

  1. REDIRECT Template:Localized link in Mall:Gerrit to solve Mall:Task and replace the numerous ad-hoc solutions to this problem, such as the English Wikipedia's ‘top icon’ template.

Viewing page status indicators

[redigera wikitext]
Fil:Page status indicators position (San Francisco).png
Vector skin screenshot with indicator area marked.

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 the

  1. REDIRECT Template:Localized link.

Adding page status indicators

[redigera wikitext]

Use the following syntax to add indicators to a page, changing the name attribute and contents of the tag to suit your tastes.

It is strongly recommended to create a

  1. REDIRECT Template:Localized link for each indicator type you're going to need, instead of including the tag syntax directly in articles.

Wikitext syntax:

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

Lua module syntax:

mw.getCurrentFrame():extensionTag {
	name = "indicator",
	content = '[[File:Foo.svg|20px]]',
	args = {
		name = "foo"
	}
}

Note that:

  • When using a caption on the image, the caption automatically becomes a title attribute with the contents of the caption.
  • Any wikitext can be added, not just images. (
  1. REDIRECT Template:Localized link is only supported starting with
  2. REDIRECT Template:Localized link, see 188443[[{{{2}}}|{{{2}}}]].)
  • Every indicator must have a unique identifier (name). It's not possible to have several indicators with the same name – in case of duplicates, the latest occurrence of the tag wins.
  • Indicators are displayed ordered by their names (case-sensitive) and not in order of their occurrence. This ensures consistency across pages and provides a simple means of ordering or grouping them.
  • Indicators are not tracked. They are intended to merely reflect the content or metadata that is already present on the page, and not be data themselves. You should be able to use the appropriate
  1. REDIRECT Template:Localized link, template
  2. REDIRECT Template:Localized link list,
  3. REDIRECT Template:Localized link report, or other means to list pages that include a given indicator.

Known problems

[redigera wikitext]
  • They are not displayed by
  1. REDIRECT Template:Localized link, see phab:T75299.
  • They cannot be previewed in the
  1. REDIRECT Template:Localized link.

Customizing display on your wiki

[redigera wikitext]

If the skin you're using supports page status indicators (all default skins do), you can adjust their display using site 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, where name is the name assigned to the indicator using the <indicator name="foo"> syntax.

Adding support for indicators in skins

[redigera wikitext]

See array-indicators on

  1. REDIRECT Template:Localized link.

Using indicators from PHP code

[redigera wikitext]

Access the

  1. REDIRECT Template:Localized link object and call its setIndicators() method, passing an ID and the HTML string you want displayed.

If you're adding a help link to documentation, call its addHelpLink() method, also implemented by

  1. REDIRECT Template:Localized link and other classes.

This puts a help link in the indicators area; for example, see Special:WhatLinksHere.