Template:Sandbox/Aurelain/LinkIcon: Difference between revisions

From Heroes of Might and Magic: Olden Era Official Wiki
No edit summary
No edit summary
Line 34: Line 34:
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.


The default assumption for the icon's filename is that it is identical to the '''id''', plus the <code>.png</code> extension. This can be further configured with the {{Color|peru|prefix}} and {{Color|peru|suffix}} parameters, or be completely overridden by the '''filename''' parameter.
The default assumption for the icon's filename is that it is identical to the '''id''', plus the <code>.png</code> extension. This can be further configured with the {{b|prefix}} and {{b|suffix}} parameters, or be completely overridden by the '''filename''' parameter.


===Usage===
===Usage===


1. Basic (rarely used, as you usually also need to specify '''type''' and '''suffix'''):
1. Basic (rarely used, as you usually also need to specify {{b|type}} and {{b|suffix}}):


{{Color|yellow|Input:}} <code><nowiki>{{Sandbox/Aurelain/LinkIcon | id=magic_demon}}</nowiki></code>
{{Color|yellow|Input:}} <code><nowiki>{{Sandbox/Aurelain/LinkIcon | id=magic_demon}}</nowiki></code>

Revision as of 06:25, 26 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.

The default assumption for the icon's filename is that it is identical to the id, plus the .png extension. This can be further configured with the prefix and suffix parameters, or be completely overridden by the filename parameter.

Usage

1. Basic (rarely used, as you usually also need to specify type and suffix):

Input: {{Sandbox/Aurelain/LinkIcon | id=magic_demon}}

Output: Herald


2. With type:

Input: {{Sandbox/Aurelain/LinkIcon | id=skill_assault | type=skill}}

Output: Offense


Input: {{Sandbox/Aurelain/LinkIcon|type=faction|id=human|suffix=_icon.png}}

Output: Temple


Input: {{Sandbox/Aurelain/LinkIcon|type=faction|id=human|suffix=_icon.png|lang=pl}}

Output: Świątynia


Input: {{Sandbox/Aurelain/LinkIcon|type=faction|id=human|suffix=_icon.png|size=64px}}

Output: Temple


Input: {{Sandbox/Aurelain/LinkIcon|type=faction|id=human|suffix=_icon.png|size=128px}}

Output: Temple