Template:Sandbox/Aurelain/LinkIcon: Difference between revisions
From Heroes of Might and Magic: Olden Era Official Wiki
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
<noinclude> | <includeonly>{{ | ||
#cargo_query: | |||
tables = | |||
Translation=T_en, | |||
Translation=T_disp | |||
|join on = | |||
T_en.target_id = T_disp.target_id | |||
|where = | |||
(T_en.target_id = '{{{id}}}' OR T_en.subtype = '{{{id}}}') | |||
AND T_en.type = '{{{type}}}' | |||
AND T_en.language = '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 }} | |||
|format = | |||
template | |||
|template = | |||
Sandbox/Aurelain/Link/render | |||
|named args = | |||
yes | |||
|limit = | |||
1 | |||
|more results text = | |||
}}<!-- | |||
################################################################################ | |||
--></includeonly><noinclude> | |||
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. | 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. | ||
===Usage=== | |||
<pre><nowiki>{{LinkIcon|type=faction|id=human|suffix=_icon.png}}</nowiki></pre> | <pre><nowiki>{{LinkIcon|type=faction|id=human|suffix=_icon.png}}</nowiki></pre> | ||
| Line 12: | Line 44: | ||
{{Sandbox/Aurelain/LinkIcon|type=faction|id=human|suffix=_icon.png|size=64px}} | {{Sandbox/Aurelain/LinkIcon|type=faction|id=human|suffix=_icon.png|size=64px}} | ||
</noinclude | </noinclude> | ||
Revision as of 21:08, 25 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.
Usage
{{LinkIcon|type=faction|id=human|suffix=_icon.png}}
{{LinkIcon|type=faction|id=human|suffix=_icon.png|lang=pl}}
{{LinkIcon|type=faction|id=human|suffix=_icon.png|size=64px}}


