Template:LinkIcon: Difference between revisions

From Heroes of Might and Magic: Olden Era Official Wiki
No edit summary
N (talk | contribs)
Added support for custom link colours
Line 9: Line 9:
{{LinkIcon|type=faction|id=human|suffix=_icon.png|lang=pl}}
{{LinkIcon|type=faction|id=human|suffix=_icon.png|lang=pl}}


<pre><nowiki>{{LinkIcon|type=faction|id=human|suffix=_icon.png|size=64px}}</nowiki></pre>
<pre><nowiki>{{LinkIcon|type=faction|id=human|suffix=_icon.png|size=64px|color=yellow}}</nowiki></pre>
{{LinkIcon|type=faction|id=human|suffix=_icon.png|size=64px}}
{{LinkIcon|type=faction|id=human|suffix=_icon.png|size=64px|color=yellow}}


</noinclude><includeonly>{{#cargo_query:
</noinclude><includeonly>{{#cargo_query:
Line 18: Line 18:
           AND T_en.type    = '{{{type}}}'  AND T_en.language  = 'en'
           AND T_en.type    = '{{{type}}}'  AND T_en.language  = 'en'
           AND T_disp.type  = '{{{type}}}'  AND T_disp.language = '{{{lang|en}}}'
           AND T_disp.type  = '{{{type}}}'  AND T_disp.language = '{{{lang|en}}}'
|fields  = T_en.name = link, T_disp.name = text, T_disp.language = lang, CONCAT('{{{prefix|}}}', T_en.target_id,'{{{suffix|.png}}}') = filename, {{#if:{{{size|}}} | CONCAT('{{{size}}}') = size }}
|fields  = T_en.name = link, T_disp.name = text, T_disp.language = lang, CONCAT('{{{prefix|}}}', T_en.target_id,'{{{suffix|.png}}}') = filename, {{#if:{{{size|}}} | CONCAT('{{{size}}}') = size }}, {{#if:{{{color|}}} | CONCAT('{{{color}}}') = color }}
|format  = template
|format  = template
|template= Link/render
|template= Link/render

Revision as of 11:25, 21 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.


{{LinkIcon|type=faction|id=human|suffix=_icon.png}}

Temple

{{LinkIcon|type=faction|id=human|suffix=_icon.png|lang=pl}}

Świątynia

{{LinkIcon|type=faction|id=human|suffix=_icon.png|size=64px|color=yellow}}

Temple