GameCategory – Template

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Add /SortKey link)
m (Add Name template cat argument)
Line 1: Line 1:
<includeonly>{{#if:{{{1|}}}
<includeonly>{{#if:{{{1|}}}
|{{#if:{{{2|}}}
|{{#if:{{{2|}}}
|[[Category: {{Name|{{{1}}}|short}}: {{{2}}}|{{GameCategory/SortKey|{{Name|{{{1}}}|short}}|{{PAGENAME}}}}]]
| [[Category: {{Name|{{{1}}}|cat}}: {{{2}}}|{{GameCategory/SortKey|{{Name|{{{1}}}|cat}}|{{PAGENAME}}}}]]
|[[Category: {{Name|{{{1}}}|short}}|{{GameCategory/SortKey|{{Name|{{{1}}}|short}}|{{PAGENAME}}}}]]
| [[Category: {{Name|{{{1}}}|cat}}|{{GameCategory/SortKey|{{Name|{{{1}}}|cat}}|{{PAGENAME}}}}]]
}}
}}
}}</includeonly><noinclude>
}}</includeonly><noinclude>
Adds a game (sub-)category to the proper format and finds the page Category Sort key (e.g <tt>Arma 2: Editing</tt> gets sorted as <tt>EDITING</tt>).<br>
Adds a game (sub-)category to the proper format and finds the page Category Sort key (e.g <tt>Arma 2: Editing</tt> gets sorted as <tt>EDITING</tt>).<br>
Uses {{Template|GameCategory/SortKey}}.
Uses {{Template|Name}} and {{Template|GameCategory/SortKey}}.


== Usage ==
== Usage ==
Line 21: Line 21:
| {{n/a}}
| {{n/a}}
|-
|-
| <nowiki>{{GameCategory|arma}}</nowiki>
| <nowiki>{{GameCategory|arma1}}</nowiki>
| <tt><nowiki>[[Category: {{Name|arma}}|SORTKEY]]</nowiki></tt><br>End result: <tt>[[<nowiki/>Category: {{Name|arma}}|SORTKEY]]</tt>
| <tt><nowiki>[[Category: {{Name|arma1|cat}}|SORTKEY]]</nowiki></tt><br>End result: <tt>[[<nowiki/>Category: {{Name|arma1|cat}}|SORTKEY]]</tt>
|-
|-
| <nowiki>{{GameCategory|arma3|Editing}}</nowiki>
| <nowiki>{{GameCategory|arma3|Editing}}</nowiki>
| <tt><nowiki>[[Category: {{Name|arma3}}: Editing|SORTKEY]]</nowiki></tt><br>End result: <tt>[[<nowiki/>Category: {{Name|arma3}}: Editing|SORTKEY]]</tt>
| <tt><nowiki>[[Category: {{Name|arma3|cat}}: Editing|SORTKEY]]</nowiki></tt><br>End result: <tt>[[<nowiki/>Category: {{Name|arma3|cat}}: Editing|SORTKEY]]</tt>
|}
|}


[[Category:Templates|{{uc:{{PAGENAME}}}}]]
[[Category:Templates|{{uc:{{PAGENAME}}}}]]
</noinclude>
</noinclude>

Revision as of 20:35, 27 December 2020

Adds a game (sub-)category to the proper format and finds the page Category Sort key (e.g Arma 2: Editing gets sorted as EDITING).
Uses {{Name}} and {{GameCategory/SortKey}}.

Usage

{{GameCategory|game|subCategory}}

  • game: game id, see {{Name}}
  • subCategory: (Optional, default empty) sub-category (e.g Editing)
Examples
Code Result
{{GameCategory}} N/A
{{GameCategory|arma1}} [[Category: {{Name|arma1|cat}}|SORTKEY]]
End result: [[Category: ArmA: Armed Assault|SORTKEY]]
{{GameCategory|arma3|Editing}} [[Category: {{Name|arma3|cat}}: Editing|SORTKEY]]
End result: [[Category: Arma 3: Editing|SORTKEY]]