Template:EnumImage: Difference between revisions

From Phantasy Star Universe Clementine
(potential table fix)
(fix paragraph hack (hopefully), clean up parserfunctions)
Line 1: Line 1:
<includeonly>
<includeonly>{{#if: {{{image|}}}
{{#if: {{{image|}}} | [[File:{{{image}}}{{!}}{{#if:{{{options|}}}|{{{options}}}|{{!}}alt={{{name}}}{{!}}link=}}{{!}}{{{name|}}}]]{{#if:{{{both|}}} | {{{name}}}}} | {{{name}}} }}
| [[File:{{{image}}} | {{#if:{{{options|}}}
  | {{{options}}}
  | {{!}}{{#if: {{{name|}}}
      | alt={{{name}}}}}{{!}}link=}}{{!}}{{{name|}}}]]{{#if:{{{both|}}} | {{{name}}}}}
| {{{name}}}
|
}}
</includeonly><noinclude>
</includeonly><noinclude>
==Purpose==
==Purpose==
Line 35: Line 41:
! Header text
! Header text
|-
|-
| {{EnumImage|image=ClemLogo.png}}
| {{EnumImage|image=ClemLogo.png}}{{EnumImage|image=ClemLogo.png}}
|}
|}
</noinclude>
</noinclude>

Revision as of 14:33, 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}}

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