Template:Sandbox/Aurelain/LinkIcon: Difference between revisions

From Heroes of Might and Magic: Olden Era Official Wiki
No edit summary
No edit summary
Line 105: Line 105:
----
----


7. With {{b|empty filename}}, to disable the icon:
7. With {{b|zero filename}}, to disable the icon:


{{Color|yellow|Input:}} <code><nowiki>{{Sandbox/Aurelain/LinkIcon | id=magic_demon | filename=}}</nowiki></code>
{{Color|yellow|Input:}} <code><nowiki>{{Sandbox/Aurelain/LinkIcon | id=magic_demon | filename=0}}</nowiki></code>


{{Color|lime|Output:}} {{Sandbox/Aurelain/LinkIcon | id=magic_demon | filename=}}
{{Color|lime|Output:}} {{Sandbox/Aurelain/LinkIcon | id=magic_demon | filename=0}}


----
----
Line 121: Line 121:
----
----


9. With {{b|empty text}}, to disable the text:
9. With {{b|zero text}}, to disable the text:


{{Color|yellow|Input:}} <code><nowiki>{{Sandbox/Aurelain/LinkIcon | id=magic_demon | text=}}</nowiki></code>
{{Color|yellow|Input:}} <code><nowiki>{{Sandbox/Aurelain/LinkIcon | id=magic_demon | text=0}}</nowiki></code>


{{Color|lime|Output:}} {{Sandbox/Aurelain/LinkIcon | id=magic_demon | text=}}
{{Color|lime|Output:}} {{Sandbox/Aurelain/LinkIcon | id=magic_demon | text=0}}


----
----
Line 137: Line 137:
----
----


11. With {{b|empty link}}, to disable the link:
11. With {{b|zero link}}, to disable the link:


{{Color|yellow|Input:}} <code><nowiki>{{Sandbox/Aurelain/LinkIcon | id=magic_demon | link=}}</nowiki></code>
{{Color|yellow|Input:}} <code><nowiki>{{Sandbox/Aurelain/LinkIcon | id=magic_demon | link=0}}</nowiki></code>


{{Color|lime|Output:}} {{Sandbox/Aurelain/LinkIcon | id=magic_demon | link=}}
{{Color|lime|Output:}} {{Sandbox/Aurelain/LinkIcon | id=magic_demon | link=0}}


----
----

Revision as of 12:50, 26 June 2026


This template is meant to handle the linking of articles in a way that is language-agnostic, meaning that it can be used in language-aware infoboxes and other contexts which need to be able to handle multiple languages. This template only works with concepts which have their translation managed by Cargo.

The default assumption for the icon's filename is that it is identical to the id, plus the .png extension. This can be further configured with the suffix parameter, or be completely overridden by the filename parameter.

Usage

1. Basic (rarely used, as you usually need to specify type and suffix):

Input: {{Sandbox/Aurelain/LinkIcon | id=magic_demon}}

Output: Herald


2. With type:

Input: {{Sandbox/Aurelain/LinkIcon | id=skill_assault | type=skill}}

Output: Offense


3. With suffix, to override the default (.png):

Input: {{Sandbox/Aurelain/LinkIcon | id=angel | suffix=_icon.png}}

Output: Angel


4. With lang, to override the default (en):

Input: {{Sandbox/Aurelain/LinkIcon | id=magic_demon || lang=ja}}

Output: ヘラルド


5. With size, to override the default (32px):

Input: {{Sandbox/Aurelain/LinkIcon | id=magic_demon | size=64px}}

Output: Herald


6. With filename, to override the automated file path:

Input: {{Sandbox/Aurelain/LinkIcon | id=human_hero_1 | type=hero | filename=Ister.png}}

Output: Ister


7. With zero filename, to disable the icon:

Input: {{Sandbox/Aurelain/LinkIcon | id=magic_demon | filename=0}}

Output: Herald


8. With text, to override the automated text:

Input: {{Sandbox/Aurelain/LinkIcon | id=magic_demon | text=Hello}}

Output: Hello


9. With zero text, to disable the text:

Input: {{Sandbox/Aurelain/LinkIcon | id=magic_demon | text=0}}

Output:


10. With link, to override the automated link:

Input: {{Sandbox/Aurelain/LinkIcon | id=magic_demon | link=Heroes}}

Output: Herald


11. With zero link, to disable the link:

Input: {{Sandbox/Aurelain/LinkIcon | id=magic_demon | link=0}}

Output: Herald


12. With color:

Input: {{Sandbox/Aurelain/LinkIcon | id=magic_demon | color=magenta}}

Output: Herald


13. With stack=1, to switch to a vertical layout:

Input: {{Sandbox/Aurelain/LinkIcon | id=magic_demon | stack=1}}

Output: Herald