Difference between revisions of "Template:Century name from title year"

From blackwiki
Jump to navigation Jump to search
imported>Fuzheado
m (Changed protection level for "Template:Century name from title year": Highly visible template ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite)))
imported>Fuzheado
(Adding {{pp-template}})
Line 1: Line 1:
<includeonly><!--
+
<noinclude>{{pp-template|small=yes}}</noinclude><includeonly><!--
 
-->{{Century name from decade or year|{{Title year}}|{{{1|}}}|nomatch={{{nomatch|}}}}}<!--
 
-->{{Century name from decade or year|{{Title year}}|{{{1|}}}|nomatch={{{nomatch|}}}}}<!--
 
--></includeonly><!--
 
--></includeonly><!--

Revision as of 14:19, 8 October 2020

Template documentation[view] [edit] [history] [purge]

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

  1. The single word "dash" changes the output from "nth century" to "nth-century"
  2. 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

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