Misplaced Pages

Template:Top icon: Difference between revisions

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Browse history interactively← Previous editNext edit →Content deleted Content addedVisualWikitext
Revision as of 14:17, 17 January 2010 view sourceTheDJ (talk | contribs)Extended confirmed users, Template editors46,214 edits fix error with empty id, per talkpage request.← Previous edit Revision as of 22:02, 27 April 2010 view source Xeno (talk | contribs)Autopatrolled, Bureaucrats, Administrators103,386 edits if no link use image link... this template is potentially used to violate many image licenses!Next edit →
Line 2: Line 2:
| {{ns:2}} | {{ns:2}}
| {{ns:3}} | {{ns:3}}
| {{ns:10}} = <div style="display:none; right:{{#expr: {{{number|{{{icon_nr|0}}}}}}*(2+{{{width|15}}})+10+{{{offset|{{{extra_offset|0}}}}}} }}px; {{{style|}}}" class="metadata topicon nopopups {{{class|}}}" {{#if:{{{id|}}}|id="{{{id}}}"}}>]</div> | {{ns:10}} = <div style="display:none; right:{{#expr: {{{number|{{{icon_nr|0}}}}}}*(2+{{{width|15}}})+10+{{{offset|{{{extra_offset|0}}}}}} }}px; {{{style|}}}" class="metadata topicon nopopups {{{class|}}}" {{#if:{{{id|}}}|id="{{{id}}}"}}>]</div>
| #default = {{tlx|Top icon}} cannot be used outside of the User, Template, or User talk namespaces. {{#ifeq:{{NAMESPACE}}|{{ns:0}}|Try {{tlx|Spoken Misplaced Pages}} or {{tlx|Featured article}} instead.}}}}<noinclude> | #default = {{tlx|Top icon}} cannot be used outside of the User, Template, or User talk namespaces. {{#ifeq:{{NAMESPACE}}|{{ns:0}}|Try {{tlx|Spoken Misplaced Pages}} or {{tlx|Featured article}} instead.}}}}<noinclude>
{{pp-template|small=yes}} {{pp-template|small=yes}}

Revision as of 22:02, 27 April 2010

]

Template documentation[view] [edit] [history] [purge]
WarningThis template is used on approximately 76,000 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them.
CautionDo 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. Not linking to the image is likely to violate the license.
This template does not display in the mobile view of Misplaced Pages; it is desktop only. Read the documentation for an explanation.

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

{{Top icon
| imagename    = Image file to use as icon.
| wikilink     = The page to link to. This is where you will be taken when clicking the icon.
| description  = The tooltip will display this text when the mouse pointer hovers over the icon.
| id           = A unique id is required when using different top icons on the same page.
}}

Extra options:

| 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).

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

{{Accountcreator topicon}}
{{Rollback topicon}}
{{Autopatrolled topicon}}

Example with blank space

{{Admin topicon|sortkey=1}}
{{Top icon|imagename=Blank 50px.png|sortkey=2}}
{{Oversighter topicon|sortkey=3}}
{{Checkuser topicon|sortkey=4}}

Tracking category

See also

Top icons
Content
Protection
User rights
Membership
Membership
WikiProjects
Awards
Editor Service Awards and
Administrative Service Awards
Tools
WikiFauna
Other

Template data

The topicon meta-template

Template parameters

ParameterDescriptionTypeStatus
Image nameimagename image 1

Image file to use as icon

Example
Crystal 128 penguin.png
Filerequired
Linkwikilink link 2

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

Example
User:Anomie/Penguin Cabal
Page namesuggested
Descriptiondescription text 3

The tooltip will display this text when the mouse pointer hovers over the icon

Example
This user is in the Penguin Cabal
Stringsuggested
Idid name

A unique id is required when using different top icons on the same page

Example
penguin-cabal-topicon
Stringoptional
Alternative textalt

The alternative text of the image

Stringoptional
Sort keysortkey

Allows ordering the icons according to the sort key given

Example
2
Stringoptional
Widthwidth

Uses a different width for the images

Default
20
Numberoptional
Heightheight

Uses a different height for the images

Default
20
Numberoptional
Category in userspaceusercat

Adds a category to be added in user–space

Example
]
Page nameoptional
Category in the article mainspacemaincat

Adds a category to be added in the article main–space

Example
]
Page nameoptional
Subpage categorysubpage

For categorization on subpages

Default
no
Stringoptional
Disable all categoriesnocat

Disables the automatically added category

Default
no
Stringoptional
The above documentation is transcluded from Template:Top icon/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
Add categories to the /doc subpage. Subpages of this template. Categories: