Template:Sandbox/Aurelain/LinkIcon: Difference between revisions

From Heroes of Might and Magic: Olden Era Official Wiki
No edit summary
No edit summary
Line 3: Line 3:
#cargo_query:
#cargo_query:
tables =
tables =
     Translation=T_en,
     Translation = E,
     Translation=T_disp
     Translation = T
|join on =
|join on =
     T_en.target_id = T_disp.target_id
     E.target_id = T.target_id
|where =
|where =
     (T_en.target_id  = '{{{id}}}' OR T_en.subtype = '{{{id}}}')
     (E.target_id  = '{{{id}}}' OR E.subtype = '{{{id}}}')
     AND T_en.type    = '{{{type}}}'
     AND E.type    = '{{{type}}}'
     AND T_en.language  = 'en'
     AND E.language  = 'en'
     AND T_disp.type  = '{{{type}}}'
     AND T.type  = '{{{type}}}'
     AND T_disp.language = '{{{lang|en}}}'
     AND T.language = '{{{lang|en}}}'
|fields =
|fields =
     T_en.name = link,
     E.name = link,
     T_disp.name = text,
     T.name = text,
     T_disp.language = lang,
     T.language = lang,
     CONCAT('{{{prefix|}}}', T_en.target_id,'{{{suffix|.png}}}') = filename,
     CONCAT('{{{prefix|}}}', E.target_id,'{{{suffix|.png}}}') = filename,
     {{#if:{{{size|}}} | CONCAT('{{{size}}}') = size }}
     {{#if:{{{size|}}} | CONCAT('{{{size}}}') = size }}
|format =
|format =
     template
     template
|template =
|template =
     Sandbox/Aurelain/Link/render
     Sandbox/Aurelain/Link/stack
|named args =
|named args =
     yes
     yes

Revision as of 21:23, 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

Input: {{LinkIcon|type=faction|id=human|suffix=_icon.png}}
Output: Temple


Input: {{LinkIcon|type=faction|id=human|suffix=_icon.png|lang=pl}}
Output: Świątynia


Input: {{LinkIcon|type=faction|id=human|suffix=_icon.png|size=64px}}
Output: Temple