Template:Icon/doc
| This is a documentation subpage for Template:Icon. It may contain usage information, categories and other content that is not part of the original template page. |
__EXPECTED_UNCONNECTED_PAGE__
| This template is used on approximately 679,000 pages, or roughly 768% of all pages. To avoid major disruption and server load, any changes should be tested in the template's /sandbox or /testcases subpages, or in your own user subpage. The tested changes can be added to this page in a single edit. Consider discussing changes on the talk page before implementing them. |
| This template uses Lua: |
About
This template creates an inline image that is used in metapages such as Wikipedia:Vital articles and/or in user pages.
Usage
- Custom size
{{icon|code|size=size}}
Parameters
1orclass- the icon code. See the table below for a list of available codes.size- a custom icon size, e.g. "30px". The default size is "16x16px" (16 by 16 pixels).
Icon codes
| Icon | Description | Code | Aliases |
|---|---|---|---|
| A-Class article | {{icon|a}}
|
||
| Audited article of limited subject matter | {{icon|aa}}
|
||
| File:A candidate.svg | A-Class article candidate | {{icon|acc}}
|
aac, acn
|
| File:Wikipedia Administrator.svg | Administrator | {{icon|admin}}
|
mop
|
| File:OOjs UI icon alert.svg | Black alert | {{icon|alert}}
|
|
| File:OOjs UI icon alert destructive black-darkred.svg | Black, white, and red alert | {{icon|alert-blackred}}
|
|
| File:OOjs UI icon alert-constructive.svg | Green alert | {{icon|alert-constructive}}
|
|
| File:OOjs UI icon alert image warning.svg | Alert | {{icon|alert-imagewarning}}
|
|
| B-Class article | {{icon|b}}
|
||
| File:Original Barnstar.png | Original barnstar | {{icon|barnstar}}
|
|
| File:Original Barnstar Hires.svg | Original barnstar hires | {{icon|barnstar2}}
|
|
| File:Symbol book class2.svg | Wikipedia book | {{icon|book}}
|
|
| File:Symbol bplus class.svg | Bplus-Class article | {{icon|bplus}}
|
b+
|
| File:Bclass-checklist.svg | B-Class review | {{icon|br}}
|
bcr
|
| C-Class article | {{icon|c}}
|
||
| Category | {{icon|category}}
|
cat, categ
| |
| Cleanup work | {{icon|cleanup}}
|
||
| Commons page | {{icon|commons}}
|
||
| File:Symbol oppose vote.svg | Demoted article | {{icon|da}}
|
|
| File:Symbol unsupport A vote.svg | Demoted A-Class article | {{icon|dac}}
|
daa
|
| Delisted good article | {{icon|dga}}
|
||
| File:Symbol dab class.svg | Disambiguation page | {{icon|disambiguation}}
|
dab, disamb, disambig
|
| File:Echo edit-user-talk icon.svg | Discussion | {{icon|discussionnotificaion}}
|
|
| File:Symbol draft class.svg | Draft-Class article | {{icon|draft}}
|
|
| Did You Know? | {{icon|dyk}}
|
||
| Did You Know? | {{icon|dyk2}}
|
||
| File:Essay.svg | Essay | {{icon|essay}}
|
|
| Featured article | {{icon|fa}}
|
||
| Featured article candidate | {{icon|fac}}
|
fan
| |
| Featured article review | {{icon|far}}
|
||
| Featured article removal candidate | {{icon|farc}}
|
||
| File:Featured article star - cross.svg | Former featured article | {{icon|ffa}}
|
dfa
|
| File:Cscr-former.svg | Former featured article candidate | {{icon|ffac}}
|
nofa
|
| File:Featured article star - cross.svg | Former featured list | {{icon|ffl}}
|
dfl
|
| File:Cscr-former.svg | Former featured list candidate | {{icon|fflc}}
|
nofl
|
| File:Cscr-former.svg | Former featured picture | {{icon|ffp}}
|
|
| File:Featured article star - cross.svg | Former featured portal | {{icon|ffpo}}
|
|
| File:Cscr-former.svg | Former featured sound | {{icon|ffs}}
|
|
| File:DFT candidate cluster.svg | Former featured topic | {{icon|fft}}
|
dft
|
| File:Symbol oppose vote.svg | Former good article nominee | {{icon|fgan}}
|
gaf, gf, noga
|
| Featured list | {{icon|fl}}
|
||
| Featured list candidate | {{icon|flc}}
|
fln
| |
| Featured list removal candidate | {{icon|flrc}}
|
flr
| |
| File:Four Award with draft icon.svg | Four Award | {{icon|four}}
|
4a
|
| Featured picture | {{icon|fp}}
|
||
| Featured picture candidate | {{icon|fpc}}
|
fpn
| |
| File:Linecons big-star.svg | Before the featured portal process ceased in 2017, this had been designated as a featured portal. | {{icon|fpo}}
|
|
| Featured portal candidate | {{icon|fpoc}}
|
||
| Featured portal review | {{icon|fpor}}
|
||
| Featured sound | {{icon|fs}}
|
||
| Featured sound candidate | {{icon|fsc}}
|
||
| File:Cscr-featuredtopic.svg | Featured topic | {{icon|ft}}
|
|
| File:FT candidate cluster.svg | Featured topic candidate | {{icon|ftc}}
|
ftn
|
| Featured topic removal candidate | {{icon|ftrc}}
|
||
| Good article | {{icon|ga}}
|
||
| Good article, 2nd opinion | {{icon|ga2}}
|
||
| Good article on hold | {{icon|gah}}
|
||
| Good article nominee | {{icon|gan}}
|
gac
| |
| File:GA Candidate Neutral vote(ChaosNil).svg | Good article reassessment | {{icon|gar}}
|
|
| File:Good article review icon.svg | Good article review | {{icon|gareview}}
|
ganrv
|
| File:Writing Magnifying.PNG | Guild of Copy Editors | {{icon|goce}}
|
|
| File:Support cluster.svg | Good topic | {{icon|gt}}
|
|
| File:GA candidate cluster.svg | Good topic candidate | {{icon|gtc}}
|
gtn
|
| Good topic removal candidate | {{icon|gtrc}}
|
||
| File:Symbol file class.svg | File | {{icon|image}}
|
file
|
| Information | {{icon|info}}
|
||
| File:Globe current.svg | In The News | {{icon|itn}}
|
|
| File:Symbol list class.svg | List-Class article | {{icon|list}}
|
comparison
|
| MediaWiki | {{icon|mediawiki}}
|
||
| File:Wikimedia Community Logo.svg | Meta-wiki page | {{icon|meta}}
|
|
| File:Million award logo.svg | Million Award | {{icon|million}}
|
|
| File:Lua-logo-nolabel.svg | Module | {{icon|module}}
|
|
| Non-article page | {{icon|na}}
|
||
| File:Symbol needed class.svg | Needed article | {{icon|needed}}
|
|
| File:Symbol Stork.svg | New | {{icon|new}}
|
stork
|
| File:Crystal button cancel.svg | Unknown-Class article | {{icon|no}}
|
|
| File:Symbol unsupport A vote.svg | Failed A-Class article candidate | {{icon|noac}}
|
faac
|
| File:Nuvola apps date.svg | On This Day | {{icon|otd}}
|
|
| File:Global thinking.svg | Outline | {{icon|outline}}
|
|
| File:Favicon-Phabricator-WM.svg | Phabricator | {{icon|phabricator}}
|
phab
|
| File:Symbol portal class.svg | Portal | {{icon|portal}}
|
|
| Picture of the Day | {{icon|potd}}
|
||
| Portal peer review | {{icon|ppr}}
|
||
| Peer review | {{icon|pr}}
|
||
| Project page | {{icon|project}}
|
||
| Question | {{icon|q}}
|
question
| |
| File:Quality images logo.svg | Quality image on Wikimedia Commons | {{icon|qi}}
|
|
| Redirect | {{icon|redirect}}
|
red, redir
| |
| File:Symbol start class.svg | Start-Class article | {{icon|start}}
|
|
| File:Symbol stub class.svg | Stub-Class article | {{icon|stub}}
|
|
| File:Symbol template class pink.svg | Template | {{icon|template}}
|
temp, templ
|
| Today's Featured Article | {{icon|tfa}}
|
||
| Today's Featured List | {{icon|tfl}}
|
||
| File:Symbol user class.svg | User-Class article | {{icon|user}}
|
|
| File:Valued image seal.svg | Valued image on Wikimedia Commons | {{icon|vi}}
|
|
| File:Círculos Concéntricos.svg | Vital article | {{icon|vital}}
|
|
| File:ENWP VP Logo.svg | Valued picture | {{icon|vp}}
|
|
| File:Valued pics 1.svg | Valued picture candidate | {{icon|vpc}}
|
|
| Wikibooks page | {{icon|wikibooks}}
|
||
| Wikidata page | {{icon|wikidata}}
|
||
| Wikinews page | {{icon|wikinews}}
|
||
| Wikipedia page | {{icon|wikipedia}}
|
||
| File:People icon.svg | WikiProject | {{icon|wikiproject}}
|
|
| File:Wikiquote-logo.svg | Wikiquote page | {{icon|wikiquote}}
|
|
| Wikisource page | {{icon|wikisource}}
|
||
| Wikispecies page | {{icon|wikispecies}}
|
||
| File:Wikitech-2021-blue-icon.svg | Wikitech | {{icon|wikitech}}
|
|
| Wikiversity page | {{icon|wikiversity}}
|
||
| File:Wikivoyage-logo.svg | Wikivoyage page | {{icon|wikivoyage}}
|
|
| Wiktionary page | {{icon|wiktionary}}
|
See also
- {{Icon link}}
- {{Class/icon}}
- {{Done/See also}} - inline icon templates by shape and color
- {{Table cell templates/doc}}
- {{Smiley}}
- Template:Icon invokes Module:Navbox using Lua.
Usage
This template can be used to make a standard navigation box. It is intended for use within another template that standardises the title and contents of the box (see Template:ShipNavbox). This template SHOULD NOT be used directly within articles, as it creates a maintenance burden to do so whenever the contents of the box have to be updated.
The purpose of this template is to standardise the attributes of all navigation boxes, for example, their colours and other CSS attributes. The template is fairly simple, and could be extended to add other features in the future. Using this template allows changes to be implemented much quicker and easier than editing each template separately.
Syntax
{{navbox
|state = uncollapsed, collapsed, plain, autocollapse (default)
|name = mandatory - name of the template
|style = optional - style for the whole table
|title = mandatory - navbox header
|gtitleN = optional - title of N-th group of items
|styleN = optional - style for groupN; i.e. text-align
|groupN = mandatory - list of groups of items
|fstyle = optional - style for footer ; i.e. text-align
|footer = optional - navbox footer
}}
- Groups: Currently there is no technical limit to the maximum number of groups.
- Groups of items can be added as parameters: group1, group2, group3, ... up to groupN.
- Group title: Each group has its own title parameter: gtitle1, gtitle2, gtitle3, ... up to gtitleN. Note that the default width for the first column is 15%.
- Group style: Style may also be customised to each group in: style1, style2, style3, ... up to styleN.
- Note that neither the title nor the items have any wiki-links built into the template. As a result, users of the template are free to use wiki-links as they wish.
- Line breaks: Line-breaks (
<br />) are unnecessary, as text wrapping is done automatically by the template. This also includes links and text in gtitleN and groupN. - Bullets: Create unordered lists with lines beginning with *.
- Pipe links: Because of the nature of template syntax, it may be necessary to use Template:! (
{{!}}).
States
- Autocollapse: By default, the state of a navbox is "autocollapsed". This means that if the number of navboxes in a page exceeds the maximum allocation of the collapsible navboxes, then the remaining navboxes are collapsed automatically. For more information (or to change the setting), see MediaWiki:Common.js.
- Currently, the autocollapse allocation is 2 (see MediaWiki:Common.js). This means that if there are 3 navboxes in a page, the third and subsequent navboxes will be collapsed automatically.
- Uncollapsed: Forces the navbox to be displayed.
- All of the navboxes in this documentation are in the uncollapsed state.
- Collapsed: The reverse of uncollapsed. Forces the navbox to be hidden instead.
- Navboxes with a height of more than 300 pixels will also be collapsed automatically. For more information (or to change the setting), see MediaWiki:Common.js.
- Plain: Removes the "show/hide" link.
Sub-groups
- For larger navboxes, it may be necessary to include sub-groups within a particular group of items. It is also possible to collapsible navboxes within the parent navbox, see Collapsible sub-groups.
- To create sub-groups within
{{navbox}}, certain parameters are to be included:- The parent navbox group (i.e. group2 in the example below) requires the type parameter (gtype2 = Subgroup).
- The nested navbox (sub-group) requires the inclusion of the sub-group parameter (subgroup = yes). This enables the template to differentiate between the sub-group and the parent navbox.
{{navbox
|name =
|title =
|gtitle1 =
|group1 =
|gtitle2 =
|gtype2 = Subgroup (mandatory)
|group2 =
{{navbox
|subgroup = yes (mandatory)
|gtitle1 =
|group1 =
|gtitle2 =
|group2 =
}}
}}
Collapsible sub-groups
- For extremely long navboxes, it is recommended to use collapsible navboxes within the parent navbox. Further sub-groups can then be added to these collapsible navboxes.
- To create collapsible sub-groups within
{{navbox}}, these parameters need to be included:- The parent navbox is almost always uncollapsed (state=uncollapsed).
- The parent navbox group (i.e. group1 in the example below) requires the type parameter (gtype1 = Subgroup).
- The nested collapsible navbox requires the inclusion of the collapsible parameter (collapsible = yes). This enables the template to differentiate between the collapsible navbox and the parent navbox.
- The nested collapsible navbox is forcefully collapsed (state=collapsed).
{{navbox
|state = uncollapsed
|name =
|gtype1 = Subgroup
|group1 =
{{navbox
|collapsible = yes
|state = collapsed
|title =
|gtitle1 =
|group1 =
|gtitle2 =
|group2 =
}}
}}
Use of images
- The use of images in navboxes is permitted, but please resize the images to keep them small. Inventory-sized images (25-30 pixels) are recommended.
- Please use {{t|plink}} to create links with images. Use {{t|plink}} for any case where text is not desired after the link. It functions the same as {{t|plink}}, but it does not produce a wikilink in text. Use {{t|chatl}} to link chatheads. These templates create links for both the image and text (except for {{t|plink}}) using far less wikicode than the standard syntax.
Link and file share the same name
{{plink|Item}}
File name differs from the link
{{plink|Item|File}}
Link and file share the same name, but different text is desired to display
{{plink|Item|alt=Text}}
File name differs from the link and different text is desired to display
{{plink|Item|File|alt=Text}}
Categorising
Navboxes are very useful for transcluding categories onto a large number of pages that share both a trait and the navigation box. For example: Template:ShipNavbox transcludes Category:Ships onto every page that uses it.
There are 2 methods of categorising pages with navboxes:
The first way is with {{t|Ctg}}. This is the preferred method, and can be used in most cases. The rules and operations for the Category handler template are very simple; however, they are enough to produce the desired results on most pages.
Categorisation should only be used on a template for large-scale addition. It is unhelpful, for example, to use a rule that only applies to 1 page.
Examples
To see the following navboxes in action, see Template:Navbox.
Single line navbox with centered list
{{navbox
|name =
|title =
|style1 = text-align:center
|group1 =
}}
Navbox with standard footer
{{navbox
|name =
|title =
|gtitle1 =
|group1 =
|footer = Centered footer
}}
Navbox with styled footer
{{navbox
|name =
|title =
|gtitle1 =
|group1 =
|fstyle = text-align:right
|footer = Right-aligned footer
}}
Multiple line navbox
{{navbox
|name =
|title =
|gtitle1 = Group title 1
|group1 =
|gtitle2 = Group title 2
|group2 =
|gtitle3 = Group title 3
|group3 =
}}
Collapsed navbox
{{navbox
|state = collapsed
|name =
|title =
|style1 = text-align:center
|group1 =
}}
Plain navbox with Tnavbar
{{navbox
|state = plain
|name =
|title =
|style1 = text-align:center
|group1 =
}}
Plain navbox without Tnavbar
{{navbox
|state = plain
|title =
|style1 = text-align:center
|group1 =
}}
Complicated navbox
{{navbox
|state = uncollapsed
|name =
|title =
|gtitle1 = Level 1 Title 1
|group1 =
|gtitle2 = Level 1 Title 2
|group2 =
|gtitle3 = Level 1 Title 3
|group3 =
|gtitle4 = Level 1 Title 4
|group4 =
|gtitle5 = Level 1 Title 5
|gtype5 = Subgroup
|group5 =
{{navbox
|subgroup = Yes
|gtitle1 = Level 2 Title 1
|group1 =
|gtitle2 = Level 2 Title 2
|group2 =
|gtitle3 = Level 2 Title 3
|gtype3 = Subgroup
|group3 =
{{navbox
|subgroup = Yes
|gtitle1 = Level 3 Title 1
|group1 =
|gtitle2 = Level 3 Title 2
|group2 =
}}
|gtitle4 = Level 2 Title 4
|group4 =
}}
|gtitle6 = Level 1 Title 6
|group6 =
|gtitle7 = Level 1 Title 7
|group7 =
|fstyle =
|footer =
}}
Preventing unwanted documentation
The Navbox template's documentation is automatically transcluded under the navbox on any Template namespace page. It is not transcluded when used as a sub-group or collapsible sub-group template (subgroup= yes or collapsible=yes).
Should the documentation appear when it is unwanted, it can be hidden by setting the doc parameter doc=no on the template. In most cases, the doc parameter is NOT used and the parameter is removed completely.
TemplateData
TemplateData for Icon
This template creates an inline icon-sized image. Please refer to 'Template:Icon/doc' for the list of supported values.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Icon | 1 class | The identifier or name of the icon to be displayed. | Line | required |
| size | size | The size of the icon to display, e.g. "30px".
| Line | optional |