Difference between revisions of "Template:Subcategory"

From Kerbal Space Program Wiki
Jump to: navigation, search
m (*renamed Parameter Table to Parameter table;)
(Edits.)
Line 1: Line 1:
<includeonly>[[Category:{{#titleparts: {{PAGENAME}}|{{#if: {{{2|}}}|{{{2}}}|-1}}}} {{{1}}}|{{#titleparts: {{PAGENAME}}||{{#if: {{{2|}}}|{{{2}}}|-1}}}}]]</includeonly><noinclude>Adds the article to a category which begins with the name of article and is sorted with the rest of the name.
+
<includeonly>[[Category:{{#titleparts: {{PAGENAME}}|{{#if: {{{2|}}}|{{{2}}}|-1}}}} {{{1}}}|{{#titleparts: {{PAGENAME}}||{{#if: {{{2|}}}|{{{2}}}|-1}}}}]]</includeonly>
 
 
== Parameters ==
 
{{Parameter table|name=number|parameters=
 
{{Parameter row|1|Subcategory name suffix}}
 
{{Parameter row|2|Number of [[mw:Help:Extension:ParserFunctions#.23titleparts|title parts]] which are used for the category name.|-1}}
 
}}
 
 
 
== Examples ==
 
For example in <tt style="white-space:nowrap;">Template:Infobox/Part/ISP</tt> this would add it to <tt style="white-space:nowrap;">Category:Infobox/Part {{{1}}}</tt> with the sortkey <tt>ISP</tt>.
 
 
 
'''Currently only negative values for the second parameter are supported.'''
 
  
 +
<noinclude>
 +
{{Documentation}}
 
[[Category:Formatting and function templates]]</noinclude>
 
[[Category:Formatting and function templates]]</noinclude>

Revision as of 02:33, 26 January 2020


Documentation icon Template documentation[view] [edit] [history] [purge]Pages that link to Template:Subcategory

Purpose

This template adds the article to a category which begins with the name of the article and is sorted with the rest of the name.

Usage

# Optional Description Default
1 No Subcategory name suffix
2 Yes Number of title parts which are used for the category name. -1

Examples

For example in Template:Infobox/Part/ISP this would add it to Category:Infobox/Part {{{1}}} with the sortkey ISP.

  • Currently only negative values for the second parameter are supported.

See also