Template:PixelImage: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| (50 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
<includeonly> | <!-- ================= Template:PixelImage ================= --><includeonly>{{#if: {{{display|}}}|{{#switch: {{{wiki|}}}| minecraft = [[File:{{{filename}}}|{{{size|24}}}px|class=pixelated|link=https://minecraft.wiki/w/{{#replace:{{{display}}}| | _}}]]{{#ifeq: {{lc:{{{showtext|yes}}}}} | no | | [https://minecraft.wiki/w/{{#replace:{{{display}}}| | _}} {{{display}}}]}}| pixelmon = [[File:{{{filename}}}|{{{size|24}}}px|class=pixelated|link={{#replace:{{{display}}}| | _}}]]{{#ifeq: {{lc:{{{showtext|yes}}}}} | no | | [[{{{display}}}]]}}| #default = [[File:{{{filename}}}|{{{size|24}}}px|class=pixelated]]{{#ifeq: {{lc:{{{showtext|yes}}}}} | no | | {{{display}}}}}}}|[[File:{{{filename}}}|{{{size|24}}}px|class=pixelated]]}}<!----></includeonly><noinclude> | ||
{{#if: {{{ | |||
</includeonly> | |||
<noinclude> | |||
== Usage == | == Usage == | ||
<pre><nowiki>{{PixelImage | <pre><nowiki>{{PixelImage | ||
|filename=MyImage.png | |filename = MyImage.png <!-- required --> | ||
|display= | |display = Diamond Pickaxe <!-- optional --> | ||
|size=32 | |size = 32 <!-- optional, defaults 24 --> | ||
|wiki=minecraft | |wiki = minecraft <!-- optional: minecraft / pixelmon / ”” --> | ||
}}</nowiki></pre> | }}</nowiki></pre> | ||
;Parameters | |||
* <code>filename</code> – **required**. Exact file name, including extension. | |||
* <code>display</code> – optional. Text to show next to the icon. | |||
If omitted, only the icon is shown and it is **not** a link. | |||
* <code>size</code> – optional. Width (px). Defaults to 24 px. | |||
* <code>wiki</code> – optional. | |||
**minecraft** → icon + text link to Minecraft Wiki. | |||
**pixelmon** → icon + text link internally. | |||
anything else → no links. | |||
* <code>showtext</code> – optional (default <code>yes</code>). | |||
Set to <code>no</code>/<code>false</code>/<code>0</code> to suppress the text label even if <code>display</code> is supplied. | |||
== Examples == | == Examples == | ||
{{PixelImage|filename=Minecraft-goldenaxe.png}} | |||
→ 24 px icon, no link, no text. | |||
{{PixelImage|filename=Minecraft-goldenaxe.png|display=Golden Axe}} test text | |||
→ icon + text “Golden Axe”, no links. | |||
{{PixelImage|filename=Minecraft-goldenaxe.png|display=Golden Axe|size=32|wiki=minecraft}} | |||
→ 32 px icon + text, both link to | |||
<nowiki>https://minecraft.wiki/w/Golden_Axe</nowiki> | |||
{{PixelImage|filename=Minecraft-goldenaxe.png|display=Golden Axe|size=64|wiki=pixelmon}} | |||
→ icon + text “Golden Axe”, internal link. | |||
{{PixelImage|filename=Minecraft-goldenaxe.png|display=Golden Axe|size=64|wiki=minecraft|showtext=no}} → icon + No text, Minecraft wiki link. | |||
</noinclude> | </noinclude> | ||
Latest revision as of 16:21, 10 June 2025
Usage
{{PixelImage
|filename = MyImage.png <!-- required -->
|display = Diamond Pickaxe <!-- optional -->
|size = 32 <!-- optional, defaults 24 -->
|wiki = minecraft <!-- optional: minecraft / pixelmon / ”” -->
}}
- Parameters
filename– **required**. Exact file name, including extension.display– optional. Text to show next to the icon.
If omitted, only the icon is shown and it is **not** a link.
size– optional. Width (px). Defaults to 24 px.wiki– optional.
**minecraft** → icon + text link to Minecraft Wiki. **pixelmon** → icon + text link internally. anything else → no links.
showtext– optional (defaultyes).
Set tono/false/0to suppress the text label even ifdisplayis supplied.
Examples
→ 24 px icon, no link, no text.
Golden Axe test text → icon + text “Golden Axe”, no links.
Golden Axe → 32 px icon + text, both link to https://minecraft.wiki/w/Golden_Axe
Golden Axe
→ icon + text “Golden Axe”, internal link.
→ icon + No text, Minecraft wiki link.
