Module:Category series navigation/doc: Difference between revisions
hp>HouseBlaster →See also: remove Template:Year by category, which is being deleted |
Humanipedia (talk | contribs) m 1 revision imported |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 102: | Line 102: | ||
==Testing & debugging== | ==Testing & debugging== | ||
To test the output of the template on a particular category name, use the {{para|testcase}} parameter, and {{para|testcasegap}} if necessary: | To test the output of the template on a particular category name, use the {{para|testcase}} parameter, and {{para|testcasegap}} if necessary: | ||
* <syntaxhighlight lang="wikitext" inline>{{Category series navigation|testcase=1770s in the Province of Quebec (1763–1791) | * <syntaxhighlight lang="wikitext" inline>{{Category series navigation|testcase=1770s in the Province of Quebec (1763–1791)}}</syntaxhighlight> → | ||
{{Category series navigation | testcase=1770s in the Province of Quebec (1763–1791)}} | |||
<br /> | |||
{{Category series navigation | testcase=1770s in the Province of Quebec (1763–1791) | |||
<br/> | |||
To see all links produced and/or tested, and what effect each has on their display, use {{para|list-all-links|yes}}: | To see all links produced and/or tested, and what effect each has on their display, use {{para|list-all-links|yes}}: | ||
* <syntaxhighlight lang="wikitext" inline>{{Category series navigation|testcase=Nations at the 2013 World Athletics Championships|min=2008|skip-gaps=yes|list-all-links=yes}}</syntaxhighlight> → | * <syntaxhighlight lang="wikitext" inline>{{Category series navigation|testcase=Nations at the 2013 World Athletics Championships|min=2008|skip-gaps=yes|list-all-links=yes}}</syntaxhighlight> → | ||
Line 141: | Line 138: | ||
*<span style="color:#888">2021</span> | *<span style="color:#888">2021</span> | ||
|} | |} | ||
<br /> | |||
If {{para|list-all-links|yes}} is used on a hyphenated category, then all tested categories will also be shown: | |||
* <syntaxhighlight lang="wikitext" inline>{{Category series navigation|cat=2018–19 NHL season|list-all-links=yes}}</syntaxhighlight> → | |||
{{Collapse top}} | |||
<templatestyles src="Module:Category series navigation/styles.css"></templatestyles><div class="categorySeriesNavigation" role="navigation" aria-label="Range"> | |||
<span class="error mw-ext-cite-error"><b>Error!</b> The <b><code>|list-all-links=yes</code></b> parameter/utility should not be saved in category space, only previewed.</span>***Category series navigation failed to generate navbox*** | |||
# [[:Category:2018 NHL season]] (<span class="categorySeriesNavigation-item-inactive">2018 NHL season</span>) | |||
# [[:Category:2017 NHL season]] (<span class="categorySeriesNavigation-item-inactive">2017 NHL season</span>) | |||
# [[:Category:2016 NHL season]] (<span class="categorySeriesNavigation-item-inactive">2016 NHL season</span>) | |||
# [[:Category:2015 NHL season]] (<span class="categorySeriesNavigation-item-inactive">2015 NHL season</span>) | |||
# [[:Category:2019 NHL season]] (<span class="categorySeriesNavigation-item-inactive">2019 NHL season</span>) | |||
# [[:Category:2020 NHL season]] (<span class="categorySeriesNavigation-item-inactive">2020 NHL season</span>) | |||
# [[:Category:2021 NHL season]] (<span class="categorySeriesNavigation-item-inactive">2021 NHL season</span>) | |||
# [[:Category:2022 NHL season]] (<span class="categorySeriesNavigation-item-inactive">2022 NHL season</span>) | |||
# [[:Category:2014–15 NHL season]] ([[:Category:2014–15 NHL season|2014–15]]) | |||
# [[:Category:2015–16 NHL season]] ([[:Category:2015–16 NHL season|2015–16]]) | |||
# [[:Category:2016–17 NHL season]] ([[:Category:2016–17 NHL season|2016–17]]) | |||
# [[:Category:2017–18 NHL season]] ([[:Category:2017–18 NHL season|2017–18]]) | |||
# [[:Category:2019–20 NHL season]] ([[:Category:2019–20 NHL season|2019–20]]) | |||
# [[:Category:2020–21 NHL season]] ([[:Category:2020–21 NHL season|2020–21]]) | |||
# [[:Category:2021–22 NHL season]] ([[:Category:2021–22 NHL season|2021–22]]) | |||
# [[:Category:2022–23 NHL season]] ([[:Category:2022–23 NHL season|2022–23]]) | |||
backward search: | |||
# [<span style="color:green">j, g, k = -4, 0, 0</span>] 2018 NHL season | |||
# [<span style="color:green">j, g, k = -4, 0, 1</span>] 2017–2018 NHL season | |||
# <span style="color:blue">[<span style="color:green">j, g, k = -4, 0, 1</span>] 2017–18 NHL season</span> (found) | |||
# [<span style="color:green">j, g, k = -3, 0, 0</span>] 2017 NHL season | |||
# [<span style="color:green">j, g, k = -3, 0, 1</span>] 2016–2017 NHL season | |||
# <span style="color:blue">[<span style="color:green">j, g, k = -3, 0, 1</span>] 2016–17 NHL season</span> (found) | |||
# [<span style="color:green">j, g, k = -2, 0, 0</span>] 2016 NHL season | |||
# [<span style="color:green">j, g, k = -2, 0, 1</span>] 2015–2016 NHL season | |||
# <span style="color:blue">[<span style="color:green">j, g, k = -2, 0, 1</span>] 2015–16 NHL season</span> (found) | |||
# [<span style="color:green">j, g, k = -1, 0, 0</span>] 2015 NHL season | |||
# [<span style="color:green">j, g, k = -1, 0, 1</span>] 2014–2015 NHL season | |||
# <span style="color:blue">[<span style="color:green">j, g, k = -1, 0, 1</span>] 2014–15 NHL season</span> (found) | |||
forward search: | |||
# [<span style="color:green">j, g, k = 1, 0, -2</span>] 2019 NHL season | |||
# [<span style="color:green">j, g, k = 1, 0, -1</span>] 2019–present NHL season | |||
# [<span style="color:green">j, g, k = 1, 0, 0</span>] 2019– NHL season | |||
# [<span style="color:green">j, g, k = 1, 0, 1</span>] 2019–2020 NHL season | |||
# <span style="color:blue">[<span style="color:green">j, g, k = 1, 0, 1</span>] 2019–20 NHL season</span> (found) | |||
# [<span style="color:green">j, g, k = 2, 0, -2</span>] 2020 NHL season | |||
# [<span style="color:green">j, g, k = 2, 0, -1</span>] 2020–present NHL season | |||
# [<span style="color:green">j, g, k = 2, 0, 0</span>] 2020– NHL season | |||
# [<span style="color:green">j, g, k = 2, 0, 1</span>] 2020–2021 NHL season | |||
# <span style="color:blue">[<span style="color:green">j, g, k = 2, 0, 1</span>] 2020–21 NHL season</span> (found) | |||
# [<span style="color:green">j, g, k = 3, 0, -2</span>] 2021 NHL season | |||
# [<span style="color:green">j, g, k = 3, 0, -1</span>] 2021–present NHL season | |||
# [<span style="color:green">j, g, k = 3, 0, 0</span>] 2021– NHL season | |||
# [<span style="color:green">j, g, k = 3, 0, 1</span>] 2021–2022 NHL season | |||
# <span style="color:blue">[<span style="color:green">j, g, k = 3, 0, 1</span>] 2021–22 NHL season</span> (found) | |||
# [<span style="color:green">j, g, k = 4, 0, -2</span>] 2022 NHL season | |||
# [<span style="color:green">j, g, k = 4, 0, -1</span>] 2022–present NHL season | |||
# [<span style="color:green">j, g, k = 4, 0, 0</span>] 2022– NHL season | |||
# [<span style="color:green">j, g, k = 4, 0, 1</span>] 2022–2023 NHL season | |||
# <span style="color:blue">[<span style="color:green">j, g, k = 4, 0, 1</span>] 2022–23 NHL season</span> (found) | |||
</div> | |||
{{Collapse bottom}} | |||
==Tracking categories== | ==Tracking categories== |
Latest revision as of 01:14, 6 February 2025
Lua error in package.lua at line 80: module 'Module:Yesno' not found. Script error: No such module "High-use". Lua error in package.lua at line 80: module 'Module:Yesno' not found. Script error: No such module "Sidebar".
About[edit source]
{{Category series navigation}} is intended to be a minimal-input, near-universal template for automatically navigating most numerically adjacent categories.
Searching behavior[edit source]
Most multi-year seasons/office terms/numerical ranges are acceptable, as long as the season duration/term length/range size is <= Template:Category series navigation, and the gap between seasons is <= Template:Category series navigation. For series exceeding either of these criteria, see/use {{Irregular category series navigation}}.
The length of each season is automatically determined from the originating category name, up to and including Template:Category series navigation years. MOS:DATERANGE compliance is preferred, but some deviation is allowed and tracked for regular series with seasons > 1 year long. {{Category redirect}}s are followed, and tracked for either MOS contravention (to be corrected) or for navigational aid (no error). The gap size between successive seasons is also automatically determined, up to and including Template:Category series navigation years, and defaults to 0 (e.g. 1995–96 → 1996–97).
Automatically condensed years are supported for presidential categories only (but can be easily expanded as needed), for gaps up to and including Template:Category series navigation years, and defaults to 1. To skip gaps of up to Template:Category series navigation years in any year categories, use |skip-gaps=yes
.
Limitations[edit source]
Numerical limitations and AD/BC/E[edit source]
- Season/office term categories do not work for any years BC, which will be hidden, because no working examples were found.
- Decade categories recognize BC, but not BCE, because no working examples were found.
- Ordinal & numeral words do not work above the ninety-ninth & ninety-nine, because no working examples were found.
Condensation[edit source]
- Automatically condensed Olympics display is not supported due to peculiarities; use {{Winter Olympics by year category navigation}}, etc., instead.
- Automatically condensed years are supported for US presidential categories only, due to their consistency; use
|skip-gaps=yes
as desired on other year categories. |skip-gaps=yes
currently only works when starting on a year category, and is not intended to find all hyphenated ranges, which allows it to span much larger gaps.
Work-arounds[edit source]
- Base-name changes: create at least 2 logically numbered {{R from category navigation}} (1 backward & 1 forward), to join both related series.
- Unaccounted-for name+number conventions: where a fixed number is part of the prefix or suffix text, e.g. Chapter 11 bankruptcies, a non-breaking space may force the template to work. See this fix, where {{title year}} skipped over 11 as part of a word rather than a discrete number. (This case has been accounted for and is no longer required in this example.)
- General: for large, permanent gaps† between successive categories, use {{Preceding category}}, {{Category pair}}, {{Succeeding category}}, as needed, in addition to {{Category series navigation}} on both sides, or in the middle, of the gap. Even if {{Category series navigation}} is isolated, it has the benefit of confirming the absence of nearby categories to the reader or maintainer.
†Permanent gaps, where there is a confirmed permanent absence of data, and not just a temporary, yet to be filled, gap on Wikipedia. |skip-gaps=
: create {{R from category navigation}} from an appropriate year to the hyphenated category that was not found.
Related CfDs[edit source]
- Wikipedia:Categories for discussion/Log/2019 June 8#Category:Northern Ireland MLAs 2016–17
- Wikipedia:Categories for discussion/Log/2019 May 29#Category:MEPs 1952–58
- Wikipedia:Categories for discussion/Log/2019 April 19#Category:Aircraft piston engines 1900–1909
Usage[edit source]
- Typical usage
- <syntaxhighlight inline lang="wikitext">Template:Category series navigation</syntaxhighlight>
- Specify a minimum and/or maximum year to display
- <syntaxhighlight inline lang="wikitext">Template:Category series navigation</syntaxhighlight>
- <syntaxhighlight inline lang="wikitext">Template:Category series navigation</syntaxhighlight>
- <syntaxhighlight inline lang="wikitext">Template:Category series navigation</syntaxhighlight>
- <syntaxhighlight inline lang="wikitext">Template:Category series navigation</syntaxhighlight>
- To skip gaps in year categories
- <syntaxhighlight inline lang="wikitext">Template:Category series navigation</syntaxhighlight>
- To not automatically follow {{Category redirect}}s
- <syntaxhighlight inline lang="wikitext">Template:Category series navigation</syntaxhighlight>
- Exceptional cases
- <syntaxhighlight inline lang="wikitext">Template:Category series navigation</syntaxhighlight> — to behave as if placed on
|cat=
; consider using {{Category pair}} instead of|cat=
Testing & debugging[edit source]
To test the output of the template on a particular category name, use the |testcase=
parameter, and |testcasegap=
if necessary:
- <syntaxhighlight lang="wikitext" inline>Template:Category series navigation</syntaxhighlight> →
Template:Category series navigation
To see all links produced and/or tested, and what effect each has on their display, use |list-all-links=yes
:
- <syntaxhighlight lang="wikitext" inline>Template:Category series navigation</syntaxhighlight> →
- Category:Nations at the 2006 World Athletics Championships (2006) ( )
- Category:Nations at the 2007 World Athletics Championships (2007) ( )
- Category:Nations at the 2008 World Athletics Championships (2008)
- Category:Nations at the 2008–2009 World Athletics Championships (2008–2009) (tried; not displayed)2
- Category:Nations at the 2008–09 World Athletics Championships (2008–09) (tried; not displayed)4
- Category:Nations at the 2009 World Athletics Championships → Category:Nations at the 2009 World Championships in Athletics (2009)
- Category:Nations at the 2011 World Athletics Championships → Category:Nations at the 2011 World Championships in Athletics (2011)
- Category:Nations at the 2015 World Athletics Championships → Category:Nations at the 2015 World Championships in Athletics (2015)
- Category:Nations at the 2017 World Athletics Championships → Category:Nations at the 2017 World Championships in Athletics (2017)
- Category:Nations at the 2019 World Athletics Championships (2019)
- Category:Nations at the 2020 World Athletics Championships (2020)
- Category:Nations at the 2020–2021 World Athletics Championships (2020–2021) (tried; not displayed)2
- Category:Nations at the 2020–21 World Athletics Championships (2020–21) (tried; not displayed)4
- Category:Nations at the 2021 World Athletics Championships (2021)
- Category:Nations at the 2021–2022 World Athletics Championships (2021–2022) (tried; not displayed)2
- Category:Nations at the 2021–22 World Athletics Championships (2021–22) (tried; not displayed)4
- All possible element types are shown above (blue, red/grey, hidden, and redirect), and would otherwise display as:
If |list-all-links=yes
is used on a hyphenated category, then all tested categories will also be shown:
- <syntaxhighlight lang="wikitext" inline>Template:Category series navigation</syntaxhighlight> →
Extended content
|
---|
Tracking categories[edit source]
- Script error: No such module "Purge".
If the template encounters an issue, it displays an error message and/or places the category into one or more of the following tracking categories:
Maintenance required[edit source]
- Category:Category series navigation failed to generate navbox (0)
- Category:Category series navigation redirection error (0)
- Category:Category series navigation range abbreviated (MOS) (0)
- Category:Category series navigation range redirected (MOS) (0)
- Category:Category series navigation range ends (blank, MOS) (0)
- Category:Category series navigation range not using en dash (0)
- Category:Category series navigation in mainspace (0)
Maintenance possible[edit source]
- Category:Category series navigation isolated (0)
- Category:Category series navigation default season gap size (0)
- Category:Category series navigation using cat parameter (0)
- Category:Category series navigation using testcase parameter (0)
- Category:Category series navigation using unknown parameter (0)
Module maintenance possible[edit source]
- Category:Category series navigation year redirected (other) (0)
- Category:Category series navigation range redirected (other) (0)
Tracking only[edit source]
- Category:Category series navigation range redirected (base change) (2)
- Category:Category series navigation range redirected (var change) (0)
- Category:Category series navigation range redirected (end) (0)
- Category:Category series navigation range gaps (2)
- Category:Category series navigation range irregular (2)
- Category:Category series navigation range irregular, 0-length (0)
- Category:Category series navigation range ends (present) (0)
- Category:Category series navigation TV season redirected (0)
- Category:Category series navigation decade redirected (0)
- Category:Category series navigation year redirected (base change) (0)
- Category:Category series navigation year redirected (var change) (0)
- Category:Category series navigation roman numeral redirected (0)
- Category:Category series navigation nordinal redirected (0)
- Category:Category series navigation wordinal redirected (0)
- Category:Category series navigation using skip-gaps parameter (0)
- Category:Category series navigation year and range (0)
- Category:Category series navigation year and decade (0)
- Category:Category series navigation decade and century (0)
See also[edit source]
- {{Irregular category series navigation}}—for use on categories
- {{Irregular series navigation}}—for use outside categories
- {{R from category navigation}}
- {{Category TOC custom}}