Template:Sandbox/Aurelain/Link/stack: Difference between revisions

From Heroes of Might and Magic: Olden Era Official Wiki
No edit summary
No edit summary
Line 1: Line 1:
<includeonly><!--
<includeonly><!--
--><span style='display:inline-block;vertical-align:top;width:100px;text-align:center;line-height:1.1'><!--
--><span style='display:inline-block;vertical-align:top;width:100px;text-align:center;line-height:1.1'><!--
  -->{{#if:{{{filename|}}}
    -->{{#if:{{{filename|}}}
        |[[File:{{{filename}}} | {{{size|64px}}} | link=<!--
            |[[File:{{{filename}}} | {{{size|64px}}} | link=<!--
        -->{{#if:{{{link|}}}
            -->{{#switch: {{{lang|en}}}
            |{{#switch: {{{lang|en}}}
                 |en={{{link}}}
                 |en={{{link}}}
                 |#default={{{link}}}/{{{lang}}}
                 |#default={{{link}}}/{{{lang}}}
             }}<!-- end switch lang -->
             }}<!-- end switch lang -->
        }}<!-- end if link -->
            ]]<!-- end file
        ]]<!--
    -->}}<!-- end if filename
  -->}}<!-- end if filename --><!--
    -->{{#if:{{{text|}}}
  --><span style='display:block; margin:2px 0 12px; font-size:small;'><!--
            |<span style='display:block; margin:2px 0 12px; font-size:small;'><!--
      -->[[{{{link}}}{{
            -->[[{{#switch: {{{lang|en}}}
#switch: {{{lang|en}}}
                |en={{{link}}}
|en=
                |#default={{{link}}}/{{{lang}}}
|#default=/{{{lang}}}
            }}<!-- end switch lang -->
}}|{{{text}}}]]<!--
            |{{{text}}}]]<!--
  --></span><!--
            --></span><!--
    -->}}<!-- end if text
--></span><!--
--></span><!--
####################################################################
####################################################################
Line 45: Line 45:
----
----


2. With {{b|lang}}, to override the default (<code>en</code>):
2. With {{b|lang}}, to override the default (<code>en</code>) and thus change the link:


{{Color|yellow|Input:}}
{{Color|yellow|Input:}}
Line 52: Line 52:
| filename=Ister.png
| filename=Ister.png
| link=Ister
| link=Ister
| text=Ister
| text=イスター
| lang=ja
| lang=ja
}}</nowiki></pre>
}}</nowiki></pre>
Line 87: Line 87:
----
----


4. With empty or missing {{b|filename}}, to disable the icon:
4. With empty or missing {{b|filename}}, to disable the icon (not really useful):


{{Color|yellow|Input:}}
{{Color|yellow|Input:}}
Line 117: Line 117:
| filename=Ister.png
| filename=Ister.png
| link=Ister
| link=Ister
}}
----
6. With empty {{b|link}}, to disable the link:
{{Color|yellow|Input:}}
<pre><nowiki>
{{Sandbox/Aurelain/Link/stack
| filename=Ister.png
| text=Ister
}}</nowiki></pre>
{{Color|lime|Output:}}
{{Sandbox/Aurelain/Link/stack
| filename=Ister.png
| text=Ister
}}
}}


</noinclude>
</noinclude>

Revision as of 08:33, 26 June 2026


This template is called by Template:LinkIcon to display the results of its Cargo query.

Usage

1. Normal:

Input:

{{Sandbox/Aurelain/Link/stack
| filename=Ister.png
| link=Ister
| text=Ister
}}

Output: [[Ister

           |Ister]]

2. With lang, to override the default (en) and thus change the link:

Input:

{{Sandbox/Aurelain/Link/stack
| filename=Ister.png
| link=Ister
| text=イスター
| lang=ja
}}

Output: [[Ister/ja

           |Ister]]

3. With size, to override the default (64px):

Input:

{{Sandbox/Aurelain/Link/stack
| filename=Ister.png
| link=Ister
| text=Ister
| size=128px
}}

Output: [[Ister

           |Ister]]

4. With empty or missing filename, to disable the icon (not really useful):

Input:

{{Sandbox/Aurelain/Link/stack
| link=Ister
| text=Ister
}}

Output: [[Ister

           |Ister]]

5. With empty or missing text, to disable the text:

Input:

{{Sandbox/Aurelain/Link/stack
| filename=Ister.png
| link=Ister
}}

Output: