Template:Timeline test: Difference between revisions
From Tardis Wiki, the free Doctor Who reference
No edit summary |
(eliminating space) |
||
Line 1: | Line 1: | ||
<noinclude>{{Documentation}}</noinclude> | <noinclude>{{Documentation}}</noinclude> | ||
<includeonly> | <includeonly><!-- | ||
{{#switch:{{#rpos:{{PAGENAME}}|tury}} | Tests for the last four letters of the word "century" in the PAGENAME. If it finds them, it calls for the CenturyNav template. If it doesn't, nothing happens. | ||
-->{{#switch:{{#rpos:{{PAGENAME}}|tury}} | |||
|-1=Not a century | |-1=Not a century | ||
|Am a century | |Am a century | ||
}} | }}<!-- | ||
Tests for the letter "s" in the title of a time-related page. Of these types of pages, only decade pages contain the letter s. This part of the template will obviously wreak havoc on non-time related pages. If it finds the letter "s", it will call the DecadeNav template. If it doesn't, nothing happens. | |||
{{#switch:{{#rpos:{{PAGENAME}}|s}} | -->{{#switch:{{#rpos:{{PAGENAME}}|s}} | ||
|-1=Not a decade | |-1=Not a decade | ||
| Am a decade | | Am a decade | ||
}} | }}<!-- | ||
Tests for the number 1 as the result of dividing the PAGENAME by itself. Only year pages will result in a perfect 1 with this expression. If the calculation results in 1, Bob's your uncle — the YearNav template is called. If it doesn't, nothing happens. | |||
{{#ifeq:{{#expr:{{PAGENAME}}/{{PAGENAME}}}} | -->{{#ifeq:{{#expr:{{PAGENAME}}/{{PAGENAME}}}} | ||
|1 | |1 | ||
|{{YearNav}} | |{{YearNav}} | ||
|Not a year | |Not a year | ||
}} | }}</includeonly><noinclude>{{timeline test}}[[Category:Template sandbox]]</noinclude> | ||
</includeonly> | |||
<noinclude>{{timeline test}} | |||
[[Category:Template sandbox]]</noinclude> |
Revision as of 02:33, 31 March 2010
Instructions for {{Timeline test}}
Not a centuryAm a decadeNot a year