Template:Century name from title decade
This template is used on approximately 7,600 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
Extracts a 4-digit decade from the current page title, and returns the name of the century in which that decade was.
Usage
lemba{{Century name from title decade}}
Mostly used in categorisation.
Parameters
lembaAll parameters are optional
- The single word "dash" changes the output from "nth century" to "nth-century"
- A "nomatch" parameter may be used to specify text to be return if the input cannot be processed. The default behaviour is to return an empty string if there is no match
Examples
lemba{{Century name from title decade}}
When used on e.g. Category:2010s in Northern Ireland, returns →21st century
{{Century name from title decade|dash}}
When used on e.g. Category:1970s in Northern Ireland, returns →20th-century
{{Century name from title decade}}
When used on e.g. Category:Belfast, returns →{{Century name from title decade|nomatch=FAIL}}
When used on e.g. Category:Ballymena, returns →FAIL
Implementation
lembaThis template is implemented by using {{Century name from decade or year}} around {{Title decade}}.
The same effect can be achieved by using {{Century name from decade or year|{{Title decade}}s}}
... but this wrapper makes more easily-read markup
See also
lemba- Template:Title year
- Template:Title year+1
- Template:Title year-1
- Template:Title year range
- Template:Title year2range
- Template:Title year2range+1
- Template:Title year2range-1
- Template:Title monthname
- Template:Title decade
- Template:Title century
- Template:Title number
- Template:Make YYYY–YY
- Template:Century name from title year
- Template:Century name from title decade
- Template:Century name from decade or year