Jump to content

Template:Top icon/doc

This is a metatemplate used to help build top icons, the little (usually 20x20 pixels) icons in the top-right area of a page. The template uses the page status indicator system.

Usage

<syntaxhighlight lang="wikitext" style="overflow: auto;"> </syntaxhighlight>

Extra options: <syntaxhighlight lang="wikitext" style="overflow: auto;"> | sortkey = Allows ordering the icons according to the sortkey given. | width = Uses a different width for the images. Default is 20. | height = Uses a different height for the images. Default is 20. | usercat = Adds a category to be added in userspace. | maincat = Adds a category to be added in article mainspace. | subpage = For categorization on subpages (default = no). | nocat = Disables the automatically added category (default = no). | skin-invert = Sets the `skin-invert` CSS class (which inverts the value of colors when viewed in dark mode) on the image. Intended for default-black icons or others that require this for dark mode visibility. </syntaxhighlight>

Top icons are automatically sorted for consistency in articles. For that reason, |sortkey= should only be used in user top icons. Sort keys are sorted alphabetically, so, for example, "19" will sort before "2". If you want to use numbers as sort keys, and you have more than 10 top icons on a page, you must add leading zeroes, e.g. |sortkey=01, |sortkey=02, etc.

|width= and |height= are restrictive, meaning when one parameter is not set explicitly, the default acts as a maximum, even if the other parameter is set higher. To increase the overall size, both must be specified.

The following parameters are obsolete and no longer functional: |number=, |icon_nr=, |offset=, |extra-offset=, |class= and |style=.

Example

<syntaxhighlight lang="wikitext"> Template:Accountcreator topicon Template:Rollback topicon Template:Autopatrolled topicon </syntaxhighlight>

Example with blank space

<syntaxhighlight lang="wikitext"> Template:Admin topicon Template:Oversighter topicon Template:Checkuser topicon </syntaxhighlight>

Tracking category

See also

Template data

<templatedata>

{ "description": "The topicon meta-template", "params": { "imagename": { "label": "Image name", "description": "Image file to use as icon", "aliases": [ "image", "1" ], "required": true, "example": "Crystal 128 penguin.png", "type": "wiki-file-name" }, "wikilink": { "label": "Link", "description": "The page to link to. This is where you will be taken when clicking the icon. Do not use images with licenses requiring attribution in a top icon if you are going to link to somewhere other than the image description page, as that is likely to violate the license", "aliases": [ "link", "2" ], "suggested": true, "example": "User:Anomie/Penguin Cabal", "type": "wiki-page-name" }, "description": { "label": "Description", "description": "Text displayed in a tooltip when hovering over the icon", "aliases": [ "text", "3" ], "suggested": true, "example": "This user is in the Penguin Cabal", "type": "string" }, "id": { "label": "Id", "description": "A unique id, required when using different top icons on the same page", "aliases": [ "name" ], "example": "penguin-cabal-topicon", "type": "string" }, "alt": { "label": "Alternative text", "description": "The alternative text for the image", "type": "string" }, "sortkey": { "label": "Sort key", "description": "Allows ordering the icons according to the sort key given", "example": "2", "type": "string" }, "width": { "label": "Width", "description": "Sets a different width for the images", "default": "20", "type": "number" }, "height": { "label": "Height", "description": "Sets a different height for the images", "default": "20", "type": "number" }, "usercat": { "label": "Category in userspace", "description": "Adds a category to be included in userspace", "type": "wiki-page-name", "example": "" }, "maincat": { "label": "Category in the article mainspace", "description": "Adds a category to be included in the article mainspace", "type": "wiki-page-name", "example": "" }, "subpage": { "label": "Subpage category", "description": "For categorization on subpages", "default": "no", "type": "string" }, "nocat": { "label": "Disable all categories", "description": "Disables the automatically added category", "default": "no", "type": "string" }, "skin-invert": { "label": "Invert brightness in dark mode", "description": "Inverts the icon's brightness when using dark mode", "example": "yes", "type": "string" } } }

</templatedata>