Difference between revisions of "Template:DecadeCategoryNav"
Jump to navigation
Jump to search
imported>BrownHairedGirl (fix comment) |
imported>BrownHairedGirl (more tracking) |
||
| Line 9: | Line 9: | ||
| 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}} | ||
|}<!-- | |}<!-- | ||
| − | -->{{#ifeq: {{Title decade}} | {{{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}} | | + | {{#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}} | ||
| Line 24: | Line 24: | ||
results in: | results in: | ||
{{{{PAGENAME}}|decade=1980|topic=rail transport}} | {{{{PAGENAME}}|decade=1980|topic=rail transport}} | ||
| + | |||
| + | == 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: | ||
| + | * [[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}}) | ||
[[Category:Works-by-decade templates]] | [[Category:Works-by-decade templates]] | ||
</noinclude> | </noinclude> | ||
Revision as of 15:25, 27 February 2019
| This template employs intricate features of template syntax.
You are encouraged to familiarise yourself with its setup and parser functions before editing the template. If your edit causes unexpected problems, please undo it quickly, as this template may appear on a large number of pages. You can conduct experiments, and should test all major changes, in either this template's sandbox, the general template sandbox, or your user space before changing anything here. |
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: | 1950s • 1960s • 1970s • 1980s • 1990s • 2000s • 2010s |
| Decades: | 1950s • 1960s • 1970s • 1980s • 1990s • 2000s • 2010s |
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:
- (population: 0)
- (population: 0)
Valid use are tracked at:
- (population: 0)
- (population: 0)