Difference between revisions of "Template:DecadeCategoryNav"

From blackwiki
Jump to navigation Jump to search
imported>Fayenatic london
(→‎Error checking: note on valid exceptions)
imported>Primefac
(as near as I can tell this merger doesn't actually require changes to existing template calls; implementing TfD outcome (merge to Template:Navseasoncats))
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<includeonly>{{portal|{{#ifexist:Portal:{{{topic}}}|{{ucfirst:{{{topic}}}}}}} |History|Years |{{#ifexist:Portal:{{{decade|}}}s|{{{decade|}}}s }}}}
+
#REDIRECT [[Template:Navseasoncats]]
{| class="toc"
 
|-
 
{{#if:{{{topic|}}}|
 
{{!}} style="text-align:right;"  {{!}} <small>'''Decades in {{{topic}}}:''' </small>
 
{{!}} style="text-align:center;" {{!}} {{LinkCatIfExists2|{{#expr:{{{decade}}}-30}}s in {{{topic}}}|{{#expr:{{{decade}}}-30}}s}} • {{LinkCatIfExists2|{{#expr:{{{decade}}}-20}}s in {{{topic}}}|{{#expr:{{{decade}}}-20}}s}} • {{LinkCatIfExists2|{{#expr:{{{decade}}}-10}}s in {{{topic}}}|{{#expr:{{{decade}}}-10}}s}} • {{LinkCatIfExists2|{{{decade}}}s in {{{topic}}}|{{{decade}}}s}} • {{LinkCatIfExists2|{{#expr:{{{decade}}}+10}}s in {{{topic}}}|{{#expr:{{{decade}}}+10}}s}} • {{LinkCatIfExists2|{{#expr:{{{decade}}}+20}}s in {{{topic}}}|{{#expr:{{{decade}}}+20}}s}}}} • {{LinkCatIfExists2|{{#expr:{{{decade}}}+30}}s in {{{topic}}}|{{#expr:{{{decade}}}+30}}s}}
 
|- style="background-color:#f3f3f3"
 
| 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}}
 
|}{{Category other|<!--
 
-->{{#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]]}}<!--
 
-->}}</includeonly><noinclude>
 
{{esoteric}}
 
  
== Usage ==
+
{{r from merge}}
<nowiki>{{</nowiki>{{PAGENAME}}|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:
 
<nowiki>{{</nowiki>{{PAGENAME}}|decade=1980|topic=rail transport}}
 
results in:
 
{{{{PAGENAME}}|decade=1980|topic=rail transport}}
 
 
 
== Error checking ==
 
This template should be capable of operating without parameters, by deriving them from the page title.
 
Tracking categories have been set up to test whether there are any valid exceptions:
 
* [[:Category:DecadeCategoryNav where topic param ≠ title topic]] (population: {{PAGESINCATEGORY:DecadeCategoryNav where topic param ≠ title topic}})
 
* [[:Category:DecadeCategoryNav where decade param ≠ title decade]] (population: {{PAGESINCATEGORY:DecadeCategoryNav where decade param ≠ title decade}})
 
 
 
Valid use are tracked at:
 
* [[:Category:DecadeCategoryNav where topic param = title topic]] (population: {{PAGESINCATEGORY:DecadeCategoryNav where topic param = title topic}})
 
* [[:Category:DecadeCategoryNav where decade param = title decade]] (population: {{PAGESINCATEGORY:DecadeCategoryNav where decade param = title decade}})
 
 
 
{{Purge|Purge this page to update the totals.}}
 
 
 
Valid exceptions include cases where the centre decade is intentionally different from the title decade, in order to link both backwards and forwards where there are currently long gaps between decade categories.
 
 
 
[[Category:Works-by-decade templates]]
 
</noinclude>
 

Latest revision as of 02:08, 2 September 2019

  • From a merge: This is a redirect from a page that was merged into another page. This redirect was kept in order to preserve this page's edit history after its content was merged into the target page's content. Please do not remove the tag that generates this text (unless the need to recreate content on this page has been demonstrated) or delete this page.