Template:CenturyNav: Difference between revisions

From Tardis Wiki, the free Doctor Who reference
adding automatic placement of centuries in century category; may take this out later, but I need one category that has all the centuries for later manipulation
No edit summary
(adding automatic placement of centuries in century category; may take this out later, but I need one category that has all the centuries for later manipulation)
Line 4: Line 4:
|-
|-
|previous: [[{{nth|{{#expr:{{#sub:{{PAGENAME}}|0|2}}-1}}}} century]] next: [[{{nth|{{#expr:{{#sub:{{PAGENAME}}|0|2}}+1}}}} century]]  
|previous: [[{{nth|{{#expr:{{#sub:{{PAGENAME}}|0|2}}-1}}}} century]] next: [[{{nth|{{#expr:{{#sub:{{PAGENAME}}|0|2}}+1}}}} century]]  
|}[[Category:{{nth|{{#expr:{{#sub:{{PAGENAME}}|0|2}}}}}} century|*]] </includeonly>
|}[[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>
85,404

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.