Revision 84484 of "पटिरूप:Top icon/doc" on piwiki{{Documentation subpage}}
{{caution|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. Not linking to the image will likely violate the license.}}
This is a metatemplate used to help build top icons, little (usually 15x15 pixels) icons in the top-right area of (mostly) userpages and user talk pages.
==Usage==
<pre>
{{top icon
| imagename = Crystal Clear action run.svg
| wikilink = The pagename of a wikipage. This is where you will be taken when clicking the icon.
| description = This will show in the tooltip when hovering over the icon.
| id = a page-unique id (used for CSS styling)
| class = one or more custom class names (used for CSS styling)
| icon_nr = the icon number determines the offset of the topicon (has to be used if you have more than one top icon)
| extra_offset = an additional offset that you can use to force or adapt (in case you have non-20px wide elements in your topicon row)
}}</pre>
Extra options:
<pre>
| style = add this to the style of the body
| width = use a different width for the images. For icon_nr to function, all uses of topicon on a page, require the same width.
</pre>
Any top icons that use this template are safe for sitenotices etc. However, when sitenotices are active, the icons are likely differently aligned and may cross the header line. ATM there is no way to fix this, and user top icons have a lower priority than the top icons for articles (which do work in all cases). However if you use this template, your icons will be automatically fixed permanently once we do find a solution.
===Example===
<pre>
{{Accountcreator topicon|icon_nr=2}}
{{Rollback topicon|icon_nr=1}}
{{Autoreviewer topicon|icon_nr=0}}
</pre>
Creates three icons, from left ---> right, account creator, rollback, autoreviewer.
==Purpose==
'''The top icons are a hack.''' They originate from the protection symbols. The only '''supported''' top icons are the four used in article space; the [[Template:pp-meta|protection lock]] [[File:Padlock.svg|20px]], the [[Template:Spoken Wikipedia|spoken article]] speaker icon [[File:Sound-icon.svg|15px]], the [[Template:Good article|good article]] symbol [[File:Symbol support vote.svg|14px]] and the [[Template:Featured article|featured article]] star [[File:Cscr-featured.svg|14px]]. Editors have been increasingly using the same trick to add custom icons to their userpages. However, due to how the icons are implemented, they have a tendency to break rather easily, for instance when sitenotices are active. Because it is impossible to correct this for each and every userpage every time the top icons are broken (not to mention a waste of valuable editor time), a new template ({{tl|top icon}}) and class (topicon) were introduced to make it simpler to support the icons. Note that officially, the top icons on userpages are allowed to break at any time. Other technical changes that are important to the entire mediawiki software or changes to article space will always be more important than keeping the userspace top icons working. This template is therefore meant to simplify support, not to guarantee it.
==Technical details==
CSS is used to move a small piece of HTML from the ''content'' area of a wikipage to somewhere else on that page, usually in the top-right at the same height as the title of the wikipage. Because CSS is used, the icons require specific CSS for each individual skin. Currently only Monobook, Modern and Vector are supported.
* Each top icon should use the class "topicon". This is required to correct the position of the icon for each skin.
* The top icons are '''hidden''' with "<code>display: none;</code>" by default. The skin-specific CSS unhides them, so that the icons are only visible in skins that support the icons.
* The skin-specific CSS determines the vertical position of top icons. Thus the style option "<code>top</code>" '''should not''' be used by user top icons.
* Top icons use the CSS property "<code>right</code>" to determine how far from the right of the page the icon should be; article namespace icons, however, have '''fixed''' positions.
* The property "<code>margin-right</code>" is used by skin-specific CSS to correct the default right offset if needed. This is also used by the [[MediaWiki:Gadget-edittop.js|lede<!-- alternate spelling used to reduce confusion with "lead", that stuff that really weighs you down (bad attempt at humor) --> edit section gadget]] to correct offset even further.
* If individual top icons require vertical offset relative to other topicons, they can use <code>margin-top</code> or <code>margin-bottom</code> properties.
==See also==
{{top icon templates}}
<includeonly>
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
[[Category:Wikipedia-related user templates]]
[[Category:Title templates]]
[[ab:Ашаблон:Right-uppermost image]]
[[ar:قالب:إيقونة عنوان]]
[[frp:Modèlo:Icôna de titro]]
[[bm:Modèle:Icône de titre]]
[[be:Шаблон:Right-uppermost image]]
[[dsb:Pśedłoga:Titelowy symbol]]
[[es:Plantilla:Icono en título]]
[[eo:Ŝablono:Titola ikono]]
[[fr:Modèle:Icône de titre]]
[[hy:Կաղապար:Right-uppermost image]]
[[hsb:Předłoha:Titulowy symbol]]
[[it:Template:Icona del titolo]]
[[ja:Template:Top icon]]
[[kv:Шаблон:Right-uppermost image]]
[[mt:Mudell:Ikoni tat-titlu]]
[[no:Mal:Toppikon]]
[[oc:Modèl:Icòna de títol]]
[[ru:Шаблон:Right-uppermost image]]
[[sah:Халыып:Right-uppermost image]]
[[scn:Template:Icona tìtulu]]
[[cu:Обраꙁь́ць:Right-uppermost image]]
[[roa-tara:Template:Icona del titolo]]
[[ta:வார்ப்புரு:Top icon]]
[[tg:Шаблон:Right-uppermost image]]
[[udm:Шаблон:Right-uppermost image]]
[[uk:Шаблон:Right-uppermost image]]
[[vec:Modèl:Icona del titoło]]
[[vep:Šablon:Right-uppermost image]]
[[vi:Bản mẫu:Hình trên cùng góc phải]]
[[zh:模板:Topicon]]
</includeonly>All content in the above text box is licensed under the Creative Commons Attribution-ShareAlike license Version 4 and was originally sourced from https://pi.wikipedia.org/w/index.php?oldid=84484.
![]() ![]() This site is not affiliated with or endorsed in any way by the Wikimedia Foundation or any of its affiliates. In fact, we fucking despise them.
|