Template:Link: Difference between revisions
From Heroes of Might and Magic: Olden Era Official Wiki
adding support for article override |
refactoring article -> link |
||
| Line 2: | Line 2: | ||
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. | ||
If ''' | If '''nolink''' is provided, it will render with no link. If ```link``` is provided, it will override the lookup (normally linking to the English article, optionally with the specific-language subarticle). | ||
| Line 18: | Line 18: | ||
<pre><nowiki>{{Link|type=ui|id=stats| | <pre><nowiki>{{Link|type=ui|id=stats|link=Hero Basics#Attributes}}</nowiki></pre> | ||
{{Link|type=ui|id=stats| | {{Link|type=ui|id=stats|link=Hero Basics#Stats}} | ||
</noinclude><includeonly>{{#cargo_query: | </noinclude><includeonly>{{#cargo_query: | ||
| Line 28: | Line 28: | ||
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 = IF(CONCAT('{{{1|}}}') != '', '', IF('{{{ | |fields = IF(CONCAT('{{{1|}}}') != '', '', IF('{{{link|}}}' != '', '{{{link}}}', T_en.name)) = link, T_disp.name = text, T_disp.language = lang | ||
|format = template | |format = template | ||
|template= Link/render | |template= Link/render | ||
Revision as of 05:34, 16 May 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.
If nolink is provided, it will render with no link. If ```link``` is provided, it will override the lookup (normally linking to the English article, optionally with the specific-language subarticle).
{{Link|type=faction|id=human}}
{{Link|type=ui|id=starting_army}}
Starting Army
{{Link|type=faction|id=human|lang=pl}}
{{Link|type=ui|id=stats|link=Hero Basics#Attributes}}


