Difference between revisions of "Template:Century name from title year/doc"
Jump to navigation
Jump to search
imported>Vanisaac m (→See also: clean up per WP:CAT#T and WP:AWBREQ add template:Sandbox other) |
imported>BrownHairedGirl ({{High use|2155 }}) |
||
Line 1: | Line 1: | ||
{{Documentation subpage}} | {{Documentation subpage}} | ||
<!-- Place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> | <!-- Place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> | ||
+ | {{High use|2155 }} | ||
Extracts a 4-digit year from the current page title, and returns the name of the century in which that year was. | Extracts a 4-digit year from the current page title, and returns the name of the century in which that year was. | ||
Latest revision as of 02:19, 5 May 2020
![]() | This is a documentation subpage for Template:Century name from title year. It contains usage information, categories and other content that is not part of the original template page. |
![]() | This template is used on approximately 5,000 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.
Transclusion count updated automatically (see documentation). |
Extracts a 4-digit year from the current page title, and returns the name of the century in which that year was.
Usage
{{Century name from title year}}
Mostly used in categorisation.
Parameters
All 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. Default behaviour is return an empty string if there is no match
Examples
{{Century name from title year}}
When used on e.g. Category:1798 in Ireland, returns →18th century
{{Century name from title year|dash}}
When used on e.g. Category:1910s in Ireland, returns →20th-century
{{Century name from title year}}
When used on e.g. Category:Bantry, returns →{{Century name from title year|nomatch=FAIL}}
When used on e.g. Category:Ballyjamesduff, returns →FAIL
Implementation
This template is implemented by using {{Century name from decade or year}} around {{Title year}}.
The same effect can be achieved by using {{Century name from decade or year|{{Title year}}}}
... but this wrapper makes more easily-read markup
See also
- Template:Title year range
- Template:Title decade
- Template:Title century
- Template:Century name from decade or year
- Template:Century name from title decade