This template is protected from editing.
Difference between revisions of "Template:Lang cat"
(clearer doc) |
(use space as sortkey if {{{1}}} = basepagename, better documentation) |
||
Line 1: | Line 1: | ||
− | {{#switch:{{{namespace-overrride|{{NAMESPACE}}}}} | + | {{#switch:{{lc:{{{namespace-overrride|{{NAMESPACE}}}}}}}<!-- |
− | |||
− | |||
− | | | + | // Blacklist certain namespaces from being placed in categories. --> |
− | | | + | |
− | | | + | | user |
− | | | + | | team fortress wiki |
− | | | + | | user talk |
− | | | + | | team fortress wiki talk |
− | | | + | | category talk |
− | | | + | | help talk |
+ | | mediawiki talk | ||
+ | | template talk | ||
+ | | file talk | ||
+ | | talk = <!-- null --> | ||
| true | | true | ||
| 1 | | 1 | ||
| yes | | yes | ||
+ | | y | ||
+ | |||
| blank | | blank | ||
| none | | none | ||
− | | #default = [[Category:{{{1}}}{{if lang}}|{{{sort|{{BASEPAGENAME}}}}}]] | + | | #default = [[Category:{{{1}}}{{if lang}}|{{#if:{{{sort|}}} |
− | + | | {{{sort|{{BASEPAGENAME}}}}} | |
− | + | | {{#ifeq:{{{1}}} | {{BASEPAGENAME}}<!-- // If the category matches the base, use a space character as the sort key. --> | |
− | + | |   | |
− | * | + | | {{BASEPAGENAME}}<!-- // Otherwise just use the page's name. --> |
− | + | }} | |
− | * | + | }}]]<!-- |
+ | -->}}<noinclude>{{doc begin}} | ||
+ | {{tl|lang cat}} places pages in their correct language category. It should only be used directly on [[:Category:Templates|templates]]. | ||
+ | |||
+ | === Usage === | ||
+ | * On [[Scattergun]], {{tlx|lang cat|Scout}} will add the page to [[:Category:Scout]] | ||
+ | * On [[Scattergun/fr]], {{tlx|lang cat|Scout}} will add the page to [[:Category:Scout/fr]] | ||
+ | * On [[Scout]], {{tlx|lang cat|Scout}} will add the page to [[:Category:Scout]], but will use a space character as the sort key so it appears first in the category listing | ||
+ | |||
+ | '''Advanced usage''' | ||
+ | * By default {{tl|lang cat}} will ignore any Talk page or page in the User or Team Fortress Wiki namespace. However, this can be overriden for specific instances by setting the parameter {{code|namespace-override}} to {{code|true}}. | ||
+ | * A specific sort-key can also be defined with the parameter {{code|sort}}. Keep in mind that using this parameter will use the specified sortkey for ''every'' page that the template is used on. | ||
[[Category:Templates|Lang cat]] | [[Category:Templates|Lang cat]] | ||
[[Category:Language templates|Lang cat]] | [[Category:Language templates|Lang cat]] | ||
</noinclude> | </noinclude> |
Revision as of 10:12, 30 September 2010
[[Category:{{{1}}}|Lang cat]]
Documentation for Lang cat
{{lang cat}}
places pages in their correct language category. It should only be used directly on templates.
Usage
- On Scattergun,
{{lang cat|Scout}}
will add the page to Category:Scout - On Scattergun/fr,
{{lang cat|Scout}}
will add the page to Category:Scout/fr - On Scout,
{{lang cat|Scout}}
will add the page to Category:Scout, but will use a space character as the sort key so it appears first in the category listing
Advanced usage
- By default
{{lang cat}}
will ignore any Talk page or page in the User or Team Fortress Wiki namespace. However, this can be overriden for specific instances by setting the parameternamespace-override
totrue
. - A specific sort-key can also be defined with the parameter
sort
. Keep in mind that using this parameter will use the specified sortkey for every page that the template is used on.