This template is protected from editing.

Difference between revisions of "Template:Lang cat"

From Team Fortress Wiki
Jump to: navigation, search
(clearer doc)
(use space as sortkey if {{{1}}} = basepagename, better documentation)
Line 1: Line 1:
{{#switch:{{{namespace-overrride|{{NAMESPACE}}}}}
+
{{#switch:{{lc:{{{namespace-overrride|{{NAMESPACE}}}}}}}<!--
  | User
 
  | Team Fortress Wiki
 
  
   | User talk
+
    // Blacklist certain namespaces from being placed in categories. -->
   | Team Fortress Wiki talk
+
 
   | Category talk
+
   | user
   | Help talk
+
  | team fortress wiki
   | MediaWiki talk
+
  | user talk
   | Template talk
+
   | team fortress wiki talk
   | File talk
+
   | category talk
   | Talk = <!-- null -->
+
   | 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|}}}
  }}<noinclude>{{protected|small=1}}
+
    | {{{sort|{{BASEPAGENAME}}}}}
== Usage ==
+
    | {{#ifeq:{{{1}}} | {{BASEPAGENAME}}<!-- // If the category matches the base, use a space character as the sort key. -->
* {{tl|Lang cat}} should be used only on template pages to ensure that non-English pages are placed in the correct categories.
+
      | &#32;
* For example, using {{tlx|lang cat|Scout}} on a template will add ''[[Force-A-Nature/ru]]'' to [[:Category:Scout/ru]], and ''[[Force-A-Nature]]'' to [[:Category:Scout]].
+
      | {{BASEPAGENAME}}<!--                // Otherwise just use the page's name. -->
* By default this template will not add pages to a category if they are in the ''User'', ''Team Fortress Wiki'', or any Talk namespace. This can be overridden with the parameter {{code|namespace-override}} being set to {{code|true}}, {{code|yes}} or {{code|1}}.
+
      }}
* Use the parameter {{code|sort}} to define the sortkey. Sort is applied to ''all'' pages.
+
    }}]]<!--
 +
-->}}<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

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 parameter namespace-override to true.
  • 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.