Template:ANEWS archive nav/doc

From English Wikipedia @ Freddythechick

This template creates links to the previous and next versions of the administrators' newsletter on which this template is transcluded. By contrast, Template:ANEWS nav creates links to the previous and next versions of the most recent newsletter; that is, the newsletter for the current month.

This allows users to easily navigate chronologically through the newsletter archive via links on each newsletter.

Usage

<syntaxhighlight lang="wikitext">

Archives
2017: 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12
2018: 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12
2019: 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12
2020: 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12
2021: 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12
2022: 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12
2023: 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12
2024: 01, 02, 03, 04, 05, 06, 07, 08, 09, 10


<<  Previous Archive    —    Current Archive    —    [[Wikipedia:Administrators' newsletter/doc/Expression error: Missing operand for mod.|Next Archive  >>]]

</syntaxhighlight>

Example

On Wikipedia:Administrators' newsletter/2018/1, the template would produce:

Previous archive Current archive Next archive
Wikipedia:Administrators' newsletter/2017/12 Wikipedia:Administrators' newsletter/2018/1 Wikipedia:Administrators' newsletter/2018/2

Definitions

This is maybe the second time that I've used parser functions in a template, so I apologize for the rustiness of the implementation – it's rather difficult to read. Below are a few definitions that might aid in readability. Mz7 (talk) 05:37, 7 February 2018 (UTC) <syntaxhighlight lang="wikitext"> this year = doc this month =

previous year = Expression error: Unrecognized word "this". previous month = Expression error: Unrecognized word "this".

next year = Expression error: Unrecognized word "this". next month = Expression error: Unrecognized word "this".

if this month == 1, then

   previous issue = Wikipedia:Administrators' newsletter/previous year/previous month

otherwise,

   previous issue = Wikipedia:Administrators' newsletter/this year/previous month

current issue = Template:ANEWS archive nav/doc

if this month == 12, then

   next issue = Wikipedia:Administrators' newsletter/next year/next month

otherwise,

   next issue = Wikipedia:Administrators' newsletter/this year/next month

</syntaxhighlight>

See also