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

From blackwiki
Jump to navigation Jump to search
imported>MusikBot II
m (Protected "Template:Century name from title decade": High-risk template or module (more info) ([Edit=Require autoconfirmed or confirmed access] (indefinite)))
imported>BrownHairedGirl
({{Century name from decade or year|{{Title decade}}s}} -- add "s" to ensure that it is treated as a decade)
 
Line 1: Line 1:
 
<includeonly><!--
 
<includeonly><!--
-->{{Century name from decade or year|{{Title decade}}|{{{1|}}}|nomatch={{{nomatch|}}}}}<!--
+
-->{{Century name from decade or year|{{Title decade}}s|{{{1|}}}|nomatch={{{nomatch|}}}}}<!--
 
--></includeonly><!--
 
--></includeonly><!--
 
--><noinclude><!--
 
--><noinclude><!--
 
-->{{Documentation}}<!--
 
-->{{Documentation}}<!--
 
--></noinclude>
 
--></noinclude>

Latest revision as of 13:19, 21 March 2020

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

Extracts a 4-digit decade from the current page title, and returns the name of the century in which that decade was.

Usage

  • {{Century name from title decade}}

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. The default behaviour is to 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 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