Template:TagKey/sandbox: Difference between revisions
Minh Nguyen (talk | contribs) (Copied from Template:TagKey (1514233)) |
Minh Nguyen (talk | contribs) (Migrated to Module:Tag) |
||
Line 1: | Line 1: | ||
<tt style="background:#EEF;font-size:1em;line-height:1.6;white-space:nowrap" dir="ltr" class="mw-content-ltr">{{#invoke:tag|key<noinclude>|removed|:=flag:type</noinclude>}}</tt><noinclude>{{Documentation}}</noinclude> |
|||
Which style of key linking do we have? |
|||
-->{{#if: {{{:|}}} |
|||
| <!-- |
|||
Type 1: Each key part is separately linked. |
|||
-->[[{{TagPagename |
|||
| lang = {{{kl|{{{lang|}}}}}} |
|||
| 1 = {{{1<noinclude>|name</noinclude>}}} |
|||
}}<!-- |
|||
-->|{{{1<noinclude>|name</noinclude>}}}<!-- |
|||
-->]]<!-- |
|||
-->:<!-- |
|||
-->[[{{TagPagename |
|||
| lang = {{{kl:|{{{lang|}}}}}} |
|||
| 1 = {{{:|}}} |
|||
}}<!-- |
|||
-->|{{{:|}}}<!-- |
|||
-->]]<!-- |
|||
-->{{#if: {{{::|}}} |
|||
| <nowiki />:<!-- |
|||
-->[[{{TagPagename |
|||
| lang = {{{kl::|{{{lang|}}}}}} |
|||
| 1 = {{{::|}}} |
|||
}}<!-- |
|||
-->|{{{::|}}}<!-- |
|||
-->]] |
|||
}} |
|||
| <!-- |
|||
Type 2: Whole key is linked to main key page. |
|||
-->[[{{TagPagename |
|||
| lang = {{{kl|{{{lang|}}}}}} |
|||
| 1 = {{{1<noinclude>|name</noinclude>}}} |
|||
}}<!-- |
|||
-->|{{{1<noinclude>|name</noinclude>}}}<!-- |
|||
-->{{#if: {{{subkey|}}} |
|||
| <nowiki />:<!-- |
|||
-->{{{subkey|}}}<!-- |
|||
-->{{#if: {{{subkey2|}}} |
|||
| <nowiki />:<!-- |
|||
-->{{{subkey2|}}} |
|||
}} |
|||
}}<!-- |
|||
-->]] |
|||
}}</tt></includeonly><noinclude>{{Documentation}}</noinclude> |
Latest revision as of 15:27, 25 April 2024
Note to editors: Please don't categorize this template by editing it directly. Instead, place the category in its documentation page, in its "includeonly" section.
Inserts a linked reference to a key.
This template is powered by Module:Tag.
Usage
If you explicitly specify the language code in the kl (or lang) parameter, its letter case is not significant and the link with the correct language prefix for that language is generated directly to that language, using {{LangPrefix}}, even if there's still no such translation (a red link may appear in that case).
Otherwise the language to use will be determined from the current page using Module:Languages: a single existence test will be (costly) made to find a relevant page in that language, or otherwise it will default to the (unprefixed) English version of the key description page (no additional test is made to find another fallback language). No costly test occurs for linking to the English page, which is assumed to exist (a red link may appear in that case too).
See also
- {{TagValue}} Template:TagValue - for showing only the value
- {{Tag}} Template:Tag - for showing key and value
- {{Value}} Template:Value - mark with light blue background and after font, looks similar like code
- {{Role}} Template:Role - mark with light blue background and after font, looks similar like code