Template:Link: Difference between revisions

From Heroes of Might and Magic: Olden Era Official Wiki
forwarded color
N (talk | contribs)
Added support for specifying link text
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 '''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).  
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). If '''text''' is provided, the link will be rendered as the specified text.




Line 8: Line 8:


{{Link|type=faction|id=human}}
{{Link|type=faction|id=human}}
<pre><nowiki>{{Link|type=spell|id=bonus_spell_astral_summon_1|text=Summon Avatar (Spell)}}</nowiki></pre>
{{Link|type=spell|id=bonus_magic_astral_summon_1|text=Summon Avatar (Spell)}}


<pre><nowiki>{{Link|type=ui|id=starting_army|nolink}}</nowiki></pre>
<pre><nowiki>{{Link|type=ui|id=starting_army|nolink}}</nowiki></pre>
Line 33: Line 37:
     T_disp.language = lang,
     T_disp.language = lang,
     {{#if:{{{color|}}} | CONCAT('{{{color}}}') = color }}
     {{#if:{{{color|}}} | CONCAT('{{{color}}}') = color }}
    {{#if:{{{text|}}} | CONCAT('{{{text}}}') = text }}
|format  = template
|format  = template
|template= Link/render
|template= Link/render

Revision as of 15:43, 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.

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). If text is provided, the link will be rendered as the specified text.


{{Link|type=faction|id=human}}

Temple

{{Link|type=spell|id=bonus_spell_astral_summon_1|text=Summon Avatar (Spell)}}

Summon Avatar (Spell)

{{Link|type=ui|id=starting_army|nolink}}

Starting Army

{{Link|type=faction|id=human|lang=pl}}

Świątynia


{{Link|type=ui|id=stats|link=Hero Basics#Attributes}}

Attributes