Template talk:Yearlist

Revision as of 17:00, 16 June 2009 by Revanche (talk | contribs) (→‎{{PAGENAME}}: resp)

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)
Glad I could help. Seeing your efforts sparked a memory of my having done something similar (albiet more simple). However, I'm not at all an expert at coding; I poke, borrow and steal code I see doing something similar to what I want and attempt to get it to work for me. I feel stupid for pointing you to the Version page, because with your skill I assume you know about it, but if you don't, it shows what extensions are loaded. If you don't see anything that relates to that, post a request to Nic's page. When you do, I'll email him with a request to take a look at your request (as it would improve the wiki considerably). Sorry I can't be more help. --Revanche (talk|contribs) 14:00, 16 June 2009 (PDT)