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

From blackwiki
Jump to navigation Jump to search
imported>BrownHairedGirl
({{CatAutoTOC}})
imported>BrownHairedGirl
(track use of parameters which don't match title)
 
(One intermediate revision by the same user not shown)
Line 5: Line 5:
 
}}<!--
 
}}<!--
 
  # Track use of place and year parameters
 
  # Track use of place and year parameters
-->{{#if: {{{place|}}}|[[Category:Template Category U.S. State elections by year with place parameter]]}}<!--
+
-->{{Category other|<!--
-->{{#if: {{{year|}}}|[[Category:Template Category U.S. State elections by year with year parameter]]}}<!--
+
    -->{{#if: {{{place|}}}<!--
 +
        -->|<!--
 +
            -->[[Category:Template Category U.S. State elections by year with place parameter]]<!--
 +
            -->{{#ifeq: {{{place|}}}|{{str sub new|{{BASEPAGENAME}}|5|-10}}<!--
 +
                -->||[[Category:Template Category U.S. State elections by year with place parameter not matching title place]]<!--
 +
            -->}}<!--
 +
    -->}}<!--
 +
    -->{{#if: {{{year|}}}<!--
 +
        -->|<!--
 +
            -->[[Category:Template Category U.S. State elections by year with year parameter]]<!--
 +
            -->{{#ifeq: {{{year|}}}|{{Str left|{{PAGENAME}}|4}}<!--
 +
                -->||[[Category:Template Category U.S. State elections by year with year parameter not matching title year]]<!--
 +
            -->}}<!--
 +
    -->}}<!--
 +
-->}}<!--
 
--></includeonly><!--
 
--></includeonly><!--
 
  # Note {{CatAutoTOC}} needs to be available whether or not this template page has been transcluded
 
  # Note {{CatAutoTOC}} needs to be available whether or not this template page has been transcluded

Latest revision as of 19:45, 14 April 2020

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.