Template:Icon: Difference between revisions

From Pikipedia, the Pikmin wiki
Jump to navigation Jump to search
(Bah.)
(Added the subject's name to the icon image's alt property. This should make it show up in screen readers.)
 
(17 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>[[File:{{{1}}} {{#if:{{{v|}}}|{{{v}}}&nbsp;}}icon.png|link={{{1}}}|{{#if:{{{nosize|}}}||{{{3|x24px}}}}}]]{{#if:{{{2|}}}|&nbsp;[[{{{n|{{{1}}}}}}]]}}</includeonly><noinclude>
<includeonly>[[File:{{#replace:{{{1}}}|?}} {{#if:{{{v|}}}|{{{v}}}&nbsp;}}icon.png|link={{{l|{{{1}}}}}}|class={{{c|}}}|alt={{{1}}}|{{#if:{{{nosize|}}}||{{{3|24x24px}}}}} {{#ifeq:{{{1}}}|Pikmin (game)|{{!}} Pikmin}}{{#if:{{{n|}}}|{{!}}{{{n}}}}}|{{#ifexist:File:{{{1}}} {{#if:{{{v|}}}|{{{v}}}&nbsp;}}icon.png||[icon]}}]]{{#if:{{{2|}}}|&nbsp;[[{{{l|{{{1}}}}}}|{{{n|{{{1}}}}}}]]}}</includeonly><noinclude>


==Info==
==Info==
This template shows the icon of a subject, with the icon linking to said subject. You can also have it quickly give a link to the subject in plain text, right after the icon.
This template shows the icon of a subject, with the icon linking to said subject. You can also have it quickly give a link to the subject in plain text, right after the icon.


===Parameters===
==Parameters==
*'''1''': The subject.
{| class = "wikitable"
*2: If this parameter has a value (like ''y''), a text link will be added to the front of the icon.
! Parameter || Mandatory || Default || Purpose || Detailed description
*3: If this parameter has a value, it'll change the default size (24px height) to your liking.
|-
*v: If there is more than one version of the subject, use this parameter to specify it, for the icon's filename.
! 1
*n: If you want a different display name for the text link, specify it here.
| '''Yes''' ||  || Subject || Name of the subject's article.
*nosize: If this parameter has a value, the icon size will not be changed from the original.
|-
! 2
| No ||  || Text link || If this has a value, like "y", the subject's name will also appear in front of the icon, with a link to the subject's article.
|-
! 3
| No || 24x24px || Size || Use this to set the icon to a size of your liking.
|-
! v
| No ||  || Version || If there is more than one version of the subject, use this parameter to specify it. This is valid for icon filenames that follow the following pattern: "&lt;subject&gt; &lt;version&gt; icon.png".
|-
! l
| No ||  || Link || If the link to the article is different from the icon's name, specify it here.
|-
! n
| No ||  || Display name || If you want a different display name for the text link, specify it here.
|-
! c
| No ||  || Class || If you'd like to add a CSS class to the image, specify it here.
|-
! nosize
| No ||  || Ignore "size" || If this parameter has a value, the icon size will not be changed from the original.
|}


===Examples===
The following special cases exist:
{{icon|Swooping Snitchbug|y}}
*If the subject is "Pikmin (game)", the mouse-over text for the image will show "Pikmin".


[[Category:Templates]]
==Skeleton==
<pre>
{{icon|<subject>|<text link?>|<size>|v=<version>|l=<link>|n=<display name>|c=<class>|nosize=<no resize?>}}
</pre>


</noinclude>
==Examples==
{| class = "wikitable"
! Code || Result
|-
| <pre>{{icon|Swooping Snitchbug}}</pre>
| {{icon|Swooping Snitchbug}}
|-
| <pre>{{icon|Shoot|y|16px}}</pre>
| {{icon|Shoot|y|16px}}
|-
| <pre>{{icon|Burgeoning Spiderwort|y|v=spicy|n=Spicy Burgeoning Spiderwort|nosize=y}}</pre>
| {{icon|Burgeoning Spiderwort|y|v=spicy|n=Spicy Burgeoning Spiderwort|nosize=y}}
|}
 
[[Category:Inline templates]]</noinclude>

Latest revision as of 09:53, August 22, 2024


Info

This template shows the icon of a subject, with the icon linking to said subject. You can also have it quickly give a link to the subject in plain text, right after the icon.

Parameters

Parameter Mandatory Default Purpose Detailed description
1 Yes Subject Name of the subject's article.
2 No Text link If this has a value, like "y", the subject's name will also appear in front of the icon, with a link to the subject's article.
3 No 24x24px Size Use this to set the icon to a size of your liking.
v No Version If there is more than one version of the subject, use this parameter to specify it. This is valid for icon filenames that follow the following pattern: "<subject> <version> icon.png".
l No Link If the link to the article is different from the icon's name, specify it here.
n No Display name If you want a different display name for the text link, specify it here.
c No Class If you'd like to add a CSS class to the image, specify it here.
nosize No Ignore "size" If this parameter has a value, the icon size will not be changed from the original.

The following special cases exist:

  • If the subject is "Pikmin (game)", the mouse-over text for the image will show "Pikmin".

Skeleton

{{icon|<subject>|<text link?>|<size>|v=<version>|l=<link>|n=<display name>|c=<class>|nosize=<no resize?>}}

Examples

Code Result
{{icon|Swooping Snitchbug}}
Swooping Snitchbug
{{icon|Shoot|y|16px}}
Shoot Shoot
{{icon|Burgeoning Spiderwort|y|v=spicy|n=Spicy Burgeoning Spiderwort|nosize=y}}
Burgeoning Spiderwort Spicy Burgeoning Spiderwort