Template talk:Year nav topic2
Edit request
edit{{editprotected}}
This template generates a link like 1700s for the first decade of a given century; however, this page and others like it are now disambiguation pages, because the title might refer to a decade or a century. The link to the first decade of any given century needs to be formatted as [[1700–1709|1700s]]. This affects each link ending with "s]]" in the following section:
<!--DECADES--><small>[[List of decades|…]] [[{{#expr:({{{1|1700}}}-({{{1|1700}}} mod 10))-30}}s]] <sup>.</sup> [[{{#expr:({{{1|1700}}}-({{{1|1700}}} mod 10))-20}}s]] <sup>.</sup> [[{{#expr:({{{1|1700}}}-({{{1|1700}}} mod 10))-10}}s]] </small><!-- THE DECADE--><small>-'''[[{{#expr:({{{1|1700}}}-({{{1|1700}}} mod 10))}}s]]'''-</small><!-- --><small> [[{{#expr:({{{1|1700}}}-({{{1|1700}}} mod 10))+10}}s]] <sup>.</sup> [[{{#expr:({{{1|1700}}}-({{{1|1700}}} mod 10))+20}}s]] <sup>.</sup> [[{{#expr:({{{1|1700}}}-({{{1|1700}}} mod 10))+30}}s]]
The replacement code is far more complex, unfortunately, but here it is:
<!--DECADES--><small>[[List of decades|…]] [[{{#ifeq:{{#expr:(({{{1|1700}}}-({{{1|1700}}} mod 10))-30) mod 100}} | 0 | {{#expr:({{{1|1700}}}-({{{1|1700}}} mod 10))-30}}–{{#expr:({{{1|1700}}}-({{{1|1700}}} mod 10))-30+9}}{{!}}}}{{#expr:({{{1|1700}}}-({{{1|1700}}} mod 10))-30}}s]] <sup>.</sup> [[{{#ifeq:{{#expr:(({{{1|1700}}}-({{{1|1700}}} mod 10))-20) mod 100}} | 0 | {{#expr:({{{1|1700}}}-({{{1|1700}}} mod 10))-20}}–{{#expr:({{{1|1700}}}-({{{1|1700}}} mod 10))-20+9}}{{!}}}}{{#expr:({{{1|1700}}}-({{{1|1700}}} mod 10))-20}}s]] <sup>.</sup> [[{{#ifeq:{{#expr:(({{{1|1700}}}-({{{1|1700}}} mod 10))-10) mod 100}} | 0 | {{#expr:({{{1|1700}}}-({{{1|1700}}} mod 10))-10}}–{{#expr:({{{1|1700}}}-({{{1|1700}}} mod 10))-10+9}}{{!}}}}{{#expr:({{{1|1700}}}-({{{1|1700}}} mod 10))-10}}s]] </small><!-- THE DECADE--><small>-'''[[{{#ifeq:{{#expr:(({{{1|1700}}}-({{{1|1700}}} mod 10))) mod 100}} | 0 | {{#expr:({{{1|1700}}}-({{{1|1700}}} mod 10))}}–{{#expr:({{{1|1700}}}-({{{1|1700}}} mod 10))+9}}{{!}}}}{{#expr:({{{1|1700}}}-({{{1|1700}}} mod 10))}}s]]'''-</small><!-- --><small> [[{{#ifeq:{{#expr:(({{{1|1700}}}-({{{1|1700}}} mod 10))+10) mod 100}} | 0 | {{#expr:({{{1|1700}}}-({{{1|1700}}} mod 10))+10}}–{{#expr:({{{1|1700}}}-({{{1|1700}}} mod 10))+10+9}}{{!}}}}{{#expr:({{{1|1700}}}-({{{1|1700}}} mod 10))+10}}s]] <sup>.</sup> [[{{#ifeq:{{#expr:(({{{1|1700}}}-({{{1|1700}}} mod 10))+20) mod 100}} | 0 | {{#expr:({{{1|1700}}}-({{{1|1700}}} mod 10))+20}}–{{#expr:({{{1|1700}}}-({{{1|1700}}} mod 10))+20+9}}{{!}}}}{{#expr:({{{1|1700}}}-({{{1|1700}}} mod 10))+20}}s]] <sup>.</sup> [[{{#ifeq:{{#expr:(({{{1|1700}}}-({{{1|1700}}} mod 10))+30) mod 100}} | 0 | {{#expr:({{{1|1700}}}-({{{1|1700}}} mod 10))+30}}–{{#expr:({{{1|1700}}}-({{{1|1700}}} mod 10))+30+9}}{{!}}}}{{#expr:({{{1|1700}}}-({{{1|1700}}} mod 10))+30}}s]]
FWIW, I intentionally left expressions like "-30+9" in the code, rather than simplify them, to make future maintenance easier. --Russ (talk) 11:52, 19 October 2008 (UTC)
- The requested edit has been made, and tested, in Template:Year nav topic2/sandbox, so you can copy and paste the source code from there. --Russ (talk) 10:41, 23 October 2008 (UTC)
- Done and thanks for using the sandbox, makes things much easier. Stifle (talk) 11:24, 24 October 2008 (UTC)
2000s
edit{{editprotect}}
I am not sure where to put it, but the code for the decades needs to be fixed. Instead of linking to "2000-2009", it should be fixed to link to "2000s (decade)". TJ Spyke 20:26, 29 September 2009 (UTC)
- This cannot be done without adding quite a bit more complexity to the template. If all the xx00-xx09 pages were moved, it'd be a bit more straightforward. Seems like we move these pages around a lot. Flavor of the month... — RockMFR 22:59, 29 September 2009 (UTC)
Template-protected edit request on 1 January 2018
editThis edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
This template has a missing end tag for <small>
. To fix it, place </small>
as shown in this line:
-->}}</small><!-- endif other_subjects 5
Anomalocaris (talk) 21:55, 1 January 2018 (UTC)
- Done — JJMC89 (T·C) 22:33, 1 January 2018 (UTC)
- JJMC89: Thanks! —Anomalocaris (talk) 02:55, 2 January 2018 (UTC)