Template:EnumImage: Difference between revisions

From Phantasy Star Universe Clementine
(refactoring my mess)
 
(potential table fix)
Line 1: Line 1:
<includeonly>{{#if: {{{image|}}} | [[File:{{{image}}}{{!}}{{#if:{{{options|}}}|{{{options}}}|{{!}}alt={{{name}}}{{!}}link=}}{{!}}{{{name|}}}]]{{#if:{{{both|}}} | {{{name}}}}} | {{{name}}} }}
<includeonly>
{{#if: {{{image|}}} | [[File:{{{image}}}{{!}}{{#if:{{{options|}}}|{{{options}}}|{{!}}alt={{{name}}}{{!}}link=}}{{!}}{{{name|}}}]]{{#if:{{{both|}}} | {{{name}}}}} | {{{name}}} }}
</includeonly><noinclude>
</includeonly><noinclude>
==Purpose==
==Purpose==
Line 28: Line 29:
<pre>{{EnumImage|name=Clementine}}</pre>
<pre>{{EnumImage|name=Clementine}}</pre>
{{EnumImage|name=Clementine}}
{{EnumImage|name=Clementine}}
===Clem Logo in a Centered Table===
{| class="wikitable" style="margin:auto"
|+ Caption text
|-
! Header text
|-
| {{EnumImage|image=ClemLogo.png}}
|}
</noinclude>
</noinclude>

Revision as of 12:10, 31 December 2023

Purpose

Shortcut template for images/strings in the enum templates.

Parameter List

{{EnumImage
|name    <!-- Text string provided for alt-text and caption text. -->
|image   <!-- Image path. If left empty, will display the name only. -->
|both    <!-- Whether the name should be added after the image. Ignored if image is left blank. Any non-empty value is treated as true. -->
|options <!-- The desired image options. If options aren't provided, the link to the image is disabled and alt-text is left blank. -->
}}

For image options, a guide on syntax can be found here: [1]

Examples

image="ClemLogo.png"

{{EnumImage|image=ClemLogo.png}}

{{{name}}}

image="ClemLogo.png" and name="Clementine"

{{EnumImage|image=ClemLogo.png|name=Clementine}}

Clementine

image="ClemLogo.png", name="Clementine" and options="24px"

{{EnumImage|image=ClemLogo.png|name=Clementine|options=24px}}

Clementine

image="ClemLogo.png", name="Clementine", options="24px" and both="1"

{{EnumImage|image=ClemLogo.png|name=Clementine|options=24px|both=1}}

ClementineClementine

name="Clementine"

{{EnumImage|name=Clementine}}

Clementine

Clem Logo in a Centered Table

Caption text
Header text

{{{name}}}