Difference between revisions of "Template talk:Yearlist"

({{PAGENAME}})
 
Line 10: Line 10:
 
|}</pre>
 
|}</pre>
 
--[[User:Revanche|Revanche]] <sup>([[User_talk:Revanche|talk]]|[[Special:Contributions/Revanche|contribs]])</sup> 16:19, 15 June 2009 (PDT)
 
--[[User:Revanche|Revanche]] <sup>([[User_talk:Revanche|talk]]|[[Special:Contributions/Revanche|contribs]])</sup> 16:19, 15 June 2009 (PDT)
 +
 +
:Thanks a lot Revanche. It's a great idea, and I've rewritten the template to automate the entire process. The trial template is called [[template:yearbox alt]]. You can see it in action here: [[3133]].
 +
 +
:The template itself looks awful when the <nowiki>{{PAGENAME}}</nowiki> is not an integer. This can be fixed with the {{#iferror}} parser function, but I'm unsure whether it's been installed since I can't get it to work in any manner. Would you please check and see whether this extension is available. Thanks for the help. --[[User:Ebakunin|Ebakunin]] 10:06, 16 June 2009 (PDT)

Revision as of 13:06, 16 June 2009

Yearlist

Have you considered using the {{PAGENAME}} code in your timeline tags? At the least, it would save the user from having to type in the year, and there is a way to use math to account for the adjoining years. Here is example I use on my private wiki that has the previous and next year bookending the center column that depicts the century and decade, all using the {{PAGENAME}} code:

{| class="browser" align="center" border="2" style="background:#BDBDBD; text-align: center"
|-
| class="prev" width="75"|[[{{{1|{{#expr:{{PAGENAME}}-1}}}}}]]
| class="topic" width="125"|[[{{nth|{{#expr:(({{PAGENAME}}-({{PAGENAME}} mod 100))/100)+1}}}} century]]<br />[[{{#expr: {{PAGENAME}} - ({{PAGENAME}} mod 10)}}s]]
| class="next" width="75"|[[{{{2|{{#expr:{{PAGENAME}}+1}}}}}]]
|}

--Revanche (talk|contribs) 16:19, 15 June 2009 (PDT)

Thanks a lot Revanche. It's a great idea, and I've rewritten the template to automate the entire process. The trial template is called template:yearbox alt. You can see it in action here: 3133.
The template itself looks awful when the {{PAGENAME}} is not an integer. This can be fixed with the {{#iferror}} parser function, but I'm unsure whether it's been installed since I can't get it to work in any manner. Would you please check and see whether this extension is available. Thanks for the help. --Ebakunin 10:06, 16 June 2009 (PDT)