Difference between revisions of "Template:Category U.S. State elections by year"

From blackwiki
Jump to navigation Jump to search
imported>GoldRingChip
(undo, this allows for easier category creation and identification)
imported>BrownHairedGirl
(Reverted to revision 763028583 by BrownHairedGirl: Remove redlinks again. Turning this on makes Wikipedia:Database reports/Red-linked categories with incoming links almost unusable, and redlinks are not needed when creating new categs. (TW))
Line 2: Line 2:
 
| place = {{#if:{{{place|}}}|{{{place}}}|{{Str left|{{BASEPAGENAME}}|{{#expr:{{Str find|{{BASEPAGENAME}}|elections}}-1}}}}}}
 
| place = {{#if:{{{place|}}}|{{{place}}}|{{Str left|{{BASEPAGENAME}}|{{#expr:{{Str find|{{BASEPAGENAME}}|elections}}-1}}}}}}
 
| year = {{Str rightc|{{PAGENAME}}|4}}
 
| year = {{Str rightc|{{PAGENAME}}|4}}
 +
| noredlinks = yes
 +
<!--
 
| noredlinks = {{{noredlinks|}}}
 
| noredlinks = {{{noredlinks|}}}
 +
-->
 
}}</includeonly><noinclude>
 
}}</includeonly><noinclude>
 
{{documentation}}
 
{{documentation}}
 
</noinclude>
 
</noinclude>

Revision as of 19:27, 11 March 2017

Template documentation[view] [edit] [history] [purge]

This template is used as a category header for election by year categories for state elections in the United States.

e.g.

Usage

Just use: {{Category U.S. State elections by year}}

Both the place and the year are derived automatically, from the category name.

To override place and year, use |place=(place) and |year=(year).

Automatic categorization

The template automatically adds the transcluding page to the following categories:

  • [[Category:YEAR elections in the United States by state]], with a sort key of PLACE
  • [[Category:PLACE elections by year]], with a sort key of YEAR
  • [[Category:YEAR in PLACE]], with a sort key of "Elections"

To suppress categorization, use |nocategories=y.