Difference between revisions of "Template:DecadeCategoryNav"

From blackwiki
Jump to navigation Jump to search
imported>BrownHairedGirl
({{Purge|Purge this page to update the totals.}})
imported>BrownHairedGirl
(use {{Category other}} to apply tracking cats only on cat pages)
Line 8: Line 8:
 
| style="text-align:right;" | <small>'''[[List of decades|Decades:]]''' </small>
 
| style="text-align:right;" | <small>'''[[List of decades|Decades:]]''' </small>
 
| style="text-align:center;" | {{LinkCatIfExists2|{{#expr:{{{decade}}}-30}}s|{{#expr:{{{decade}}}-30}}s}} • {{LinkCatIfExists2|{{#expr:{{{decade}}}-20}}s|{{#expr:{{{decade}}}-20}}s}} • {{LinkCatIfExists2|{{#expr:{{{decade}}}-10}}s|{{#expr:{{{decade}}}-10}}s}} • {{LinkCatIfExists2|{{{decade}}}s|{{{decade}}}s}} • {{LinkCatIfExists2|{{#expr:{{{decade}}}+10}}s|{{#expr:{{{decade}}}+10}}s}} • {{LinkCatIfExists2|{{#expr:{{{decade}}}+20}}s|{{#expr:{{{decade}}}+20}}s}} • {{LinkCatIfExists2|{{#expr:{{{decade}}}+30}}s|{{#expr:{{{decade}}}+30}}s}}
 
| style="text-align:center;" | {{LinkCatIfExists2|{{#expr:{{{decade}}}-30}}s|{{#expr:{{{decade}}}-30}}s}} • {{LinkCatIfExists2|{{#expr:{{{decade}}}-20}}s|{{#expr:{{{decade}}}-20}}s}} • {{LinkCatIfExists2|{{#expr:{{{decade}}}-10}}s|{{#expr:{{{decade}}}-10}}s}} • {{LinkCatIfExists2|{{{decade}}}s|{{{decade}}}s}} • {{LinkCatIfExists2|{{#expr:{{{decade}}}+10}}s|{{#expr:{{{decade}}}+10}}s}} • {{LinkCatIfExists2|{{#expr:{{{decade}}}+20}}s|{{#expr:{{{decade}}}+20}}s}} • {{LinkCatIfExists2|{{#expr:{{{decade}}}+30}}s|{{#expr:{{{decade}}}+30}}s}}
|}<!--
+
|}{{Category other|<!--
 
-->{{#ifeq: {{Title decade}} | {{{decade|}}} | [[Category:DecadeCategoryNav where decade param = title decade]] | [[Category:DecadeCategoryNav where decade param ≠ title decade]]}}<!--
 
-->{{#ifeq: {{Title decade}} | {{{decade|}}} | [[Category:DecadeCategoryNav where decade param = title decade]] | [[Category:DecadeCategoryNav where decade param ≠ title decade]]}}<!--
 
-->
 
-->
 
{{#ifeq: {{{topic|}}} | {{#invoke:String|replace|source={{PAGENAME}}|pattern=^%d?%d?%d?0s in|replace=|count=1|plain=false}}  | [[Category:DecadeCategoryNav where topic param = title topic]] | [[Category:DecadeCategoryNav where topic param ≠ title topic]]}}<!--
 
{{#ifeq: {{{topic|}}} | {{#invoke:String|replace|source={{PAGENAME}}|pattern=^%d?%d?%d?0s in|replace=|count=1|plain=false}}  | [[Category:DecadeCategoryNav where topic param = title topic]] | [[Category:DecadeCategoryNav where topic param ≠ title topic]]}}<!--
--></includeonly><noinclude>
+
-->}}</includeonly><noinclude>
 
{{esoteric}}
 
{{esoteric}}
  

Revision as of 15:35, 27 February 2019

Usage

{{DecadeCategoryNav|decade=|topic=}}

Parameters:

  • decade - The first year of the decade to form the "center" of the navigation (e.g. 1980)
  • topic - (optional) The topic for the "DECADE in TOPIC" line (e.g. rail transport)

Example:

{{DecadeCategoryNav|decade=1980|topic=rail transport}}

results in:

Decades in rail transport: 1950s1960s • 1970s1980s1990s2000s2010s
Decades: 1950s1960s1970s1980s1990s2000s2010s

Error checking

This template should be capable of operating without parameters, by deriving the, from the page title. Tracking categories have been set up to test whether there are any valid exceptions:

Valid use are tracked at:

Script error: No such module "Purge".