Template:MediumIconDisplay: Difference between revisions

From Heroes of Might and Magic: Olden Era Official Wiki
Adding a template for use in infoboxes
 
refactoring the if statement
 
(2 intermediate revisions by the same user not shown)
Line 11: Line 11:
{{MediumIconDisplay|filename=Hive_icon|name=Example Unlinked Text}}
{{MediumIconDisplay|filename=Hive_icon|name=Example Unlinked Text}}


</noinclude><includeonly>{{#if:{{{pagelink|}}}|[[File:{{{filename}}}.png|50px|link={{{pagelink}}}|{{{name}}}]][[{{{pagelink}}}|{{{name}}}]]|[[File:{{{filename}}}.png|50px|link=|{{{name}}}]]{{{name}}}}}</includeonly>
</noinclude><includeonly><!--
This replacement is a hack since pages nor icons for Masterful versions of spells are differentiated.  They are identical in the game files for now, but I highly suspect that will change in the future.  Doing this upstream is difficult due to the intervening templates.
-->[[File:{{#replace:{{{filename|}}}|Masterful |}}.png|50px|link={{{pagelink|}}}|{{{name}}}]] {{#if:{{{pagelink|}}}|[[{{{pagelink}}}|{{{name}}}]]|{{{name}}}}}</includeonly>

Latest revision as of 00:30, 14 May 2026


Displays an icon at a medium size suitable for infoboxes, with a text label + an optional link.

{{MediumIconDisplay|filename=Hive_icon|pagelink=Hive|name=Example Linked Text}}

Example Linked Text Example Linked Text

{{MediumIconDisplay|filename=Hive_icon|name=Example Unlinked Text}}

Example Unlinked Text Example Unlinked Text