Template:CenturyNav: Difference between revisions
(css switch) |
(installing 1 digit century switch, though not like the inline notes suggested.) |
||
Line 3: | Line 3: | ||
| style="margin-left: 0px;margin-top:2px;line-height:110%;text-align:center; font-size:150%;"|[[Timeline]] | | style="margin-left: 0px;margin-top:2px;line-height:110%;text-align:center; font-size:150%;"|[[Timeline]] | ||
|- | |- | ||
|previous: [[{{nth|{{#expr:{{#sub:{{PAGENAME}}|0|2}}-1}}}} century]] next: [[{{nth|{{#expr:{{#sub:{{PAGENAME}}|0|2}}+1}}}} century]] | |previous: {{#switch:{{PAGENAME}} | ||
|}[[Category:{{nth|{{#expr:{{#sub:{{PAGENAME}}|0|2}}}}}} century| *]][[Category:Centuries]] </includeonly> | |1st century= | ||
|2nd century= | |||
|3rd century= | |||
|4th century= | |||
|5th century= | |||
|6th century= | |||
|7th century= | |||
|8th century= | |||
|9th century=[[{{nth|{{#expr:{{#sub:{{PAGENAME}}|0|1}}-1}}}} century]] next: [[{{nth|{{#expr:{{#sub:{{PAGENAME}}|0|1}}+1}}}} century]]}|} | |||
|#default=[[{{nth|{{#expr:{{#sub:{{PAGENAME}}|0|2}}-1}}}} century]] next: [[{{nth|{{#expr:{{#sub:{{PAGENAME}}|0|2}}+1}}}} century]] | |||
|} | |||
}} | |||
{{#switch:{{PAGENAME}} | |||
|1st century= | |||
|2nd century= | |||
|3rd century= | |||
|4th century= | |||
|5th century= | |||
|6th century= | |||
|7th century= | |||
|8th century= | |||
|9th century=[[Category:{{nth|{{#expr:{{#sub:{{PAGENAME}}|0|1}}}}}} century| *]][[Category:Centuries]] | |||
|#default=[[Category:{{nth|{{#expr:{{#sub:{{PAGENAME}}|0|2}}}}}} century| *]][[Category:Centuries]] | |||
}}</includeonly> | |||
<noinclude>{{documentation}}[[Category:Timeline templates|C]] | <noinclude>{{documentation}}[[Category:Timeline templates|C]] | ||
next up is how to get the thing to work for centuries with 1 digit and 3 digits. Probably will use some kind of #switch. Something like #switch:{{#pos:{{PAGENAME}}|c. Then if the position of c is 5 it's a 1 digit century. if it's 7 it's a 3 digit century. and therefore the sub will have to take either the first, or the first 3 digits. </nowiki></noinclude> | next up is how to get the thing to work for centuries with 1 digit and 3 digits. Probably will use some kind of #switch. Something like #switch:{{#pos:{{PAGENAME}}|c. Then if the position of c is 5 it's a 1 digit century. if it's 7 it's a 3 digit century. and therefore the sub will have to take either the first, or the first 3 digits. </nowiki></noinclude> |
Revision as of 12:13, 12 August 2011
It is completely automatic, and has no user-definable parameters.
Sample output
Because this template is dependent upon detecting a PAGENAME that is a century, its output can only be seen on a century page. It is impossible to reproduce its results here. If you wish to test it, go to any century and add {{timeline}} to the page.
Special note
Please remember that the word "century" should not be capitalized in the PAGENAME of any new century page that you create.
next up is how to get the thing to work for centuries with 1 digit and 3 digits. Probably will use some kind of #switch. Something like #switch:{{#pos:CenturyNav|c. Then if the position of c is 5 it's a 1 digit century. if it's 7 it's a 3 digit century. and therefore the sub will have to take either the first, or the first 3 digits. </nowiki>