Template:PixelImage: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
<includeonly> | <includeonly> | ||
{{#if: {{{wiki|}}}{{#ifeq: {{{wiki}}} | minecraft| <!-- Link icon to the Minecraft Wiki page (using display or filename base) -->[[File:{{{filename}}}|{{{size|24}}}px|class=pixelated|link=https://minecraft.fandom.com/wiki/{{#replace:{{{display|{{#replace:{{{filename}}}|.png|}}}}| | _}}]]|[[File:{{{filename}}}|{{{size|24}}}px|class=pixelated|link={{{display|{{#replace:{{{filename}}}|.png|}}}}}]]}}|[[File:{{{filename}}}|{{{size|24}}}px|class=pixelated|link={{{display|{{#replace:{{{filename}}}|.png|}}}}}]]}} | {{#if: {{{wiki|}}}{{#ifeq: {{{wiki}}} | minecraft| <!-- Link icon to the Minecraft Wiki page (using display or filename base) -->[[File:{{{filename}}}|{{{size|24}}}px|class=pixelated|link=https://minecraft.fandom.com/wiki/{{#replace:{{{display|{{#replace:{{{filename}}}|.png|}}}}| | _}}]]|[[File:{{{filename}}}|{{{size|24}}}px|class=pixelated|link={{{display|{{#replace:{{{filename}}}|.png|}}}}}]]}}|[[File:{{{filename}}}|{{{size|24}}}px|class=pixelated|link={{{display|{{#replace:{{{filename}}}|.png|}}}}}]]}}{{#if: {{{display|}}}|{{#ifeq: {{{wiki|}}} | minecraft|[https://minecraft.wiki/w/{{#replace:{{{display}}}| | _}} {{{display}}}]|[[{{{display}}}]]}}}} | ||
{{#if: {{{display|}}}|{{#ifeq: {{{wiki|}}} | minecraft|[https://minecraft.wiki/w/{{#replace:{{{display}}}| | _}} {{{display}}}]|[[{{{display}}}]]}}}} | |||
</includeonly> | </includeonly> | ||
<noinclude> | <noinclude> | ||
Revision as of 05:02, 1 June 2025
Usage
{{PixelImage
|filename=MyImage.png
|display=My Display Name
|size=32
|wiki=minecraft
}}
- • **filename** (required): the exact file name (including extension), e.g. `Minecraft-goldenaxe.png`.
- • **display** (optional): the text to show next to the icon. If omitted, no text is shown.
- • **size** (optional): width in pixels; defaults to 24.
- • **wiki** (optional): if set to `minecraft`, both icon and display link to the Minecraft Wiki article; otherwise, they link to our wiki.
Examples
test text
test text
- Renders a 24 px icon of “Minecraft-goldenaxe.png” that links internally to page `Minecraft-goldenaxe` (no text).
test text
test text
- Renders a 24 px icon and text “Minecraft Golden Axe,” both linking internally to page `Minecraft Golden Axe`.
test text
test text
- Renders a 32 px icon of the “Golden Axe,” and “Golden Axe” text—both linking to
- `https://minecraft.fandom.com/wiki/Minecraft-GoldenAxe`.