GameCategory – Template
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Add example) |
Lou Montana (talk | contribs) m (Fix space in link) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
|#default= {{#if:{{{2|}}} | |#default= {{#if:{{{2|}}} | ||
| {{#if:{{{link|}}}{{{text|}}} | | {{#if:{{{link|}}}{{{text|}}} | ||
| [[:Category: {{Name|{{{1}}}|cat}}: {{{2}}} | {{{text|{{Name|{{{1}}}|cat}}: {{{2}}}}}}]] | | [[:Category: {{Name|{{{1}}}|cat}}: {{{2}}} |{{{text|{{Name|{{{1}}}|cat}}: {{{2}}}}}}]]<!-- no space otherwise <a> linkWithSpace</a> --> | ||
| [[ Category: {{Name|{{{1}}}|cat}}: {{{2}}} | {{#if:{{{sortKey|}}} | {{uc:{{{sortKey}}}}} | {{GameCategory/SortKey|{{Name|{{{1}}}|cat}}|{{PAGENAME}}}}}}]] | | [[ Category: {{Name|{{{1}}}|cat}}: {{{2}}} | {{#if:{{{sortKey|}}} | {{uc:{{{sortKey}}}}} | {{GameCategory/SortKey|{{Name|{{{1}}}|cat}}|{{PAGENAME}}}}}}]] | ||
}} | }} | ||
| {{#if:{{{link|}}}{{{text|}}} | | {{#if:{{{link|}}}{{{text|}}} | ||
| [[:Category: {{Name|{{{1}}}|cat}} | {{{text|{{Name|{{{1}}}|cat}}}}}]] | | [[:Category: {{Name|{{{1}}}|cat}} |{{{text|{{Name|{{{1}}}|cat}}}}}]]<!-- same --> | ||
| [[ Category: {{Name|{{{1}}}|cat}} | {{#if:{{{sortKey|}}} | {{uc:{{{sortKey}}}}} | {{GameCategory/SortKey|{{Name|{{{1}}}|cat}}|{{PAGENAME}}}}}}]] | | [[ Category: {{Name|{{{1}}}|cat}} | {{#if:{{{sortKey|}}} | {{uc:{{{sortKey}}}}} | {{GameCategory/SortKey|{{Name|{{{1}}}|cat}}|{{PAGENAME}}}}}}]] | ||
}} | }} | ||
}} | }} | ||
|armar | |armar | ||
|arma4= {{#if:{{{link|}}} | |arma4= {{#if:{{{link|}}}{{{text|}}} | ||
| [[:Category: {{Concat|/|{{Name|{{{1}}}|cat}}|{{{2|}}}|{{{3|}}}|{{{4|}}}|{{{5|}}}|{{{6|}}}}} | {{{text|{{Concat|/|{{Name|{{{1}}}|cat}}|{{{2|}}}|{{{3|}}}|{{{4|}}}|{{{5|}}}|{{{6|}}}}}}}}]] | | [[:Category: {{Concat|/|{{Name|{{{1}}}|cat}}|{{{2|}}}|{{{3|}}}|{{{4|}}}|{{{5|}}}|{{{6|}}}}} |{{{text|{{Concat|/|{{Name|{{{1}}}|cat}}|{{{2|}}}|{{{3|}}}|{{{4|}}}|{{{5|}}}|{{{6|}}}}}}}}]]<!-- same --> | ||
| [[ Category: {{Concat|/|{{Name|{{{1}}}|cat}}|{{{2|}}}|{{{3|}}}|{{{4|}}}|{{{5|}}}|{{{6|}}}}} | {{uc:{{{sortKey|{{SUBPAGENAME}}}}}}}]] | | [[ Category: {{Concat|/|{{Name|{{{1}}}|cat}}|{{{2|}}}|{{{3|}}}|{{{4|}}}|{{{5|}}}|{{{6|}}}}} | {{uc:{{{sortKey|{{SUBPAGENAME}}}}}}}]] | ||
}} | }} |
Latest revision as of 23:32, 1 November 2023
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}}, {{Concat}} and {{GameCategory/SortKey}}.
This template is used on these pages.
Usage
{{GameCategory|game|subCategory|link|text|sortKey}}
- game: game id, see {{Name}}
- subCategory: (Optional, default empty) sub-category (e.g Editing) - for ≥ Arma Reforger can be up to 5 sub-levels
- link: (Optional, default empty - named argument) y to make it a link to the category
- text: (Optional, default empty - named argument) requires link. The link's text (otherwise, the category name will be used) - activates link as well
- sortKey: (Optional, default {{uc:{{PAGENAME}}}} (see {{GameCategory/SortKey}}) or {{SUBPAGENAME}} (for ≥ Arma Reforger) - named argument) category sort key - will be uppercased
Code | Result |
---|---|
{{GameCategory}} | -no category provided- |
{{GameCategory|ofpr}} | [[Category: {{Name|ofpr|cat}}|PAGENAME]] End result: [[Category: Operation Flashpoint: Resistance|PAGENAME]] |
{{GameCategory|ofpr|link= y}} | Operation Flashpoint: Resistance |
{{GameCategory|arma2|sortKey= the sort key}} | [[Category: {{Name|arma2|cat}}|THE SORT KEY]] End result: [[Category: Arma 2|THE SORT KEY]] |
{{GameCategory|arma1}} | [[Category: {{Name|arma1|cat}}|PAGENAME]] End result: [[Category: ArmA: Armed Assault|PAGENAME]] |
{{GameCategory|arma1qg}} | [[Category: {{Name|arma1qg|cat}}|PAGENAME]] End result: [[Category: ArmA: Queen's Gambit|PAGENAME]] |
{{GameCategory|arma3|Editing}} | [[Category: {{Name|arma3|cat}}/Editing|PAGENAME]] End result: [[Category: Arma 3: Editing|PAGENAME]] |
{{GameCategory|armaR|Editing|Scripting}} | [[Category: {{Name|armaR|cat}}/Editing/Scripting|PAGENAME]] End result: [[Category: Arma Reforger/Editing/Scripting|PAGENAME]] |
{{GameCategory|arma3|Editing|Scripting|link= y}} {{GameCategory|arma4|0|1|2|3|4|5|6|7|8|9|10|link= y}} |
Arma 3: Editing Arma 4/0/1/2/3/4 |
{{GameCategory|ofp|link= y|text= OFP!}} {{GameCategory|arma2|text= Game 2}} {{GameCategory|arma4|link= y|text= A4 is great :)}} |
OFP! Game 2 A4 is great :) |