Jump to content

Module:Category series navigation/doc: Difference between revisions

From Humanipedia
hp>Gonnym
No edit summary
 
hp>HouseBlaster
See also: remove Template:Year by category, which is being deleted
Line 1: Line 1:
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
{{Documentation subpage}}
{{Category series navigation/doc}}
{{High-use}}
{{Lua|Module:Category series navigation|Module:List|Module:ConvertNumeric|Module:Roman|Module:Check for unknown parameters|Module:Template redirect regex}}
{{Lua sidebar}}


<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
==About==
<!-- Categories below this line, please; interwikis at Wikidata -->
{{tl|Category series navigation}} is intended to be a minimal-input, near-universal template for automatically navigating ''most'' numerically adjacent categories.
{{Clear}}
{| class="wikitable"
|+ Recognized category types
! style="background: #CCCCCC;" | Type
! style="background: #CCCCCC; width: 25%;" | Example category
! style="background: #CCCCCC;" | BC(E)?
! style="background: #CCCCCC;" | Example output
|-
| Season || {{c|2001–02 FA Cup}} || No || {{Category series navigation|testcase=2001–02 FA Cup}}
|-
| TV season || {{c|Futurama season 1 episodes}} || – || {{Category series navigation|testcase=Futurama season 1 episodes}}
|-
| Office term (regular) || {{c|MEPs 2004–2009}} || No || {{Category series navigation|testcase=MEPs 2004–2009}}
|-
| Office term (irregular) || {{c|Wales AMs 2003–2007}} || No || {{Category series navigation|testcase=Wales AMs 2003–2007}}
|-
| Numerical range || {{c|Taxonbars with 30–34 taxon IDs}} || – || <!--{{Category series navigation|testcase=Taxonbars with 20–24 taxon IDs}}'s EPFC = 129-->
<templatestyles src="Module:Category series navigation/styles.css"></templatestyles><div class="categorySeriesNavigation" role="navigation" aria-label="Range">
<div class="toccolours categorySeriesNavigation-range">
<templatestyles src="Hlist/styles.css"></templatestyles><div class="hlist"><ul><li><span class="categorySeriesNavigation-item-inactive">15–19</span></li><li>[[:Category:Taxonbars with 20–24 taxon IDs|20–24]]</li><li>[[:Category:Taxonbars with 25–29 taxon IDs|25–29]]</li><li><b>30–34</b></li><li>[[:Category:Taxonbars with 35–39 taxon IDs|35–39]]</li><li>[[:Category:Taxonbars with 40–44 taxon IDs|40–44]]</li><li>[[:Category:Taxonbars with 45+ taxon IDs|45–49]]</li></ul></div>
</div>[[Category:Category series navigation range redirected (base change)]][[Category:Category series navigation range gaps]][[Category:Category series navigation range irregular]]
</div>
|-
| Decade || {{c|1990s in Scotland}} || BC || {{Category series navigation|testcase=1990s in Scotland}}
|-
| Year || {{c|1999 in Scotland}} || BC(E) || {{Category series navigation|testcase=1999 in Scotland}}
|-
| Year (auto-condensed) || {{c|Candidates in the 2000 United States presidential election|Candidates in the 2000 US presidential election}} || – || {{Category series navigation|testcase=Candidates in the 2000 United States presidential election}}
|-
| Year ({{para|skip-gaps|yes}}) || {{c|Amusement parks opened in 1877|skip-gaps=yes}} || – || {{Category series navigation|testcase=Amusement parks opened in 1877|skip-gaps=yes}}
|-
| Ordinal (temporal) || {{c|2nd-century rabbis}} || BC(E) || {{Category series navigation|testcase=2nd-century rabbis}}
|-
| Ordinal (numeric) || {{c|9th Lok Sabha}} || – || {{Category series navigation|testcase=9th Lok Sabha}}
|-
| Ordinal (word) || {{c|First Dynasty of Egypt}} || – || {{Category series navigation|testcase=First Dynasty of Egypt}}
|-
| Roman numeral || {{c|Deputies of Legislature X of the Kingdom of Italy}} || – || {{Category series navigation|testcase=Deputies of Legislature X of the Kingdom of Italy}}
|-
|colspan="4" style="background:#CCCCCC"|
|-
| Mixed decade || {{c|1760s in the Province of Quebec (1763–1791)}} || – || {{Category series navigation|testcase=1760s in the Province of Quebec (1763–1791)}}
|-
| Mixed year || {{c|1778 establishments in the Province of Quebec (1763–1791)}} || – || {{Category series navigation|testcase=1778 establishments in the Province of Quebec (1763–1791)}}
|}


===Searching behavior===
Most multi-year seasons/office terms/numerical ranges are acceptable, as long as the season duration/term length/range size is <= {{Category series navigation|show=term-limit}}, ''and'' the gap between seasons is <= {{Category series navigation|show=hgap-limit}}. For series exceeding either of these criteria, see/use {{tl|Irregular category series navigation}}.
The length of each season is automatically determined from the originating category name, up to and including {{Category series navigation|show=term-limit}} years. [[MOS:DATERANGE]] compliance is preferred, but some deviation is allowed and [[:Category:Category series navigation range abbreviated (MOS)|tracked]] for regular series with seasons > 1 year long. {{tl|Category redirect}}s are followed, and tracked for either [[:Category:Category series navigation range redirected (MOS)|MOS contravention]] (to be corrected) or for [[:Category:Category series navigation range redirected (base change)|navigational aid]] (no error). The gap size between successive seasons is ''also'' automatically determined, up to and including {{Category series navigation|show=hgap-limit}} years, and defaults to 0 (e.g. {{nowrap|1995–96}} → {{nowrap|1996–97}}).
Automatically condensed years are supported for ''presidential'' categories only (but can be easily expanded as needed), for gaps up to and including {{Category series navigation|show=ygap-limit}} years, and defaults to 1. To skip gaps of up to {{Category series navigation|show=skip-gaps}} years in any ''year'' categories, use {{para|skip-gaps|yes}}.
===Limitations===
====Numerical limitations and AD/BC/E====
* 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====
* Automatically condensed ''Olympics'' display is not supported due to peculiarities; use {{tl|Winter Olympics by year category navigation}}, etc., instead.
* Automatically condensed ''years'' ''are'' supported for ''US presidential'' categories only, due to their consistency; use {{para|skip-gaps|yes}} as desired on other ''year'' categories.
* {{para|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====
* '''Base-name changes:''' create at least 2 logically numbered {{tl|R from category navigation}} (1 [[Special:Permalink/1040103249|backward]] & 1 [[Special:Permalink/1040102736|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. ''{{c|Companies that filed for Chapter 11 bankruptcy in 2020|Chapter 11 bankruptcies}}'', a non-breaking space may force the template to work. See [[Special:Diff/948223374|this fix]], where {{tl|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<sup>†</sup> between successive categories, use {{tl|Preceding category}}, {{tl|Category pair}}, {{tl|Succeeding category}}, as needed, in addition to {{tl|Category series navigation}} on both sides, or in the middle, of the gap. Even if {{tl|Category series navigation}} is [[:Category:Category series navigation isolated|isolated]], it has the benefit of confirming the absence of nearby categories to the reader or maintainer.<br/><sup>†</sup>''Permanent gaps'', where there is a confirmed  permanent absence of data, and not just a temporary, yet to be filled, gap on Wikipedia.
* {{para|skip-gaps}}: create {{tl|R from category navigation}} from an appropriate year to the hyphenated category that was not found.
===Related CfDs===
* [[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==
;Typical usage
* <syntaxhighlight inline lang="wikitext">{{Category series navigation}}</syntaxhighlight>
;Specify a minimum and/or maximum year to display
* <syntaxhighlight inline lang="wikitext">{{Category series navigation|min=-100}}</syntaxhighlight>
* <syntaxhighlight inline lang="wikitext">{{Category series navigation|min=100 BC}}</syntaxhighlight>
* <syntaxhighlight inline lang="wikitext">{{Category series navigation|min=1753|max=1810}}</syntaxhighlight>
* <syntaxhighlight inline lang="wikitext">{{Category series navigation|max=2030}}</syntaxhighlight>
;To skip gaps in year categories
* <syntaxhighlight inline lang="wikitext">{{Category series navigation|skip-gaps=yes}}</syntaxhighlight>
;To ''not'' automatically follow {{tl|Category redirect}}s
* <syntaxhighlight inline lang="wikitext">{{Category series navigation|follow-redirects=no}}</syntaxhighlight>
;Exceptional cases
* <syntaxhighlight inline lang="wikitext">{{Category series navigation|cat=2010s albums}}</syntaxhighlight> &mdash; to behave as if placed on {{para|cat}}; consider using {{tl|Category pair}} instead of {{para|cat}}
==Testing & debugging==
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)|min=1760}}</syntaxhighlight> →
{{Category series navigation | testcase=1770s in the Province of Quebec (1763–1791) | min=1760}}
* <syntaxhighlight lang="wikitext" inline>{{Category series navigation|testcase=1770s in the Province of Quebec (1763–1791)|max=1790s}}</syntaxhighlight> →
{{Category series navigation | testcase=1770s in the Province of Quebec (1763–1791) | max=1790s}}
<br/>
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> →
# [[:Category:Nations at the 2006 World Athletics Championships]] (<span style="color:#888">2006</span>) (<span style="visibility:hidden">2006</span>)
# [[:Category:Nations at the 2007 World Athletics Championships]] (<span style="color:#888">2007</span>) (<span style="visibility:hidden">2007</span>)
# [[:Category:Nations at the 2008 World Athletics Championships]] (<span style="color:#888">2008</span>)
# [[:Category:Nations at the 2008–2009 World Athletics Championships]] (<span style="color:#888">2008–2009</span>) (tried; not displayed)<sup>2</sup>
# [[:Category:Nations at the 2008–09 World Athletics Championships]] (<span style="color:#888">2008–09</span>) (tried; not displayed)<sup>4</sup>
# [[:Category:Nations at the 2009 World Athletics Championships]] → [[:Category:Nations at the 2009 World Championships in Athletics]] ([[: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]] ([[: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]] ([[: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]] ([[:Category:Nations at the 2017 World Championships in Athletics|2017]])
# [[:Category:Nations at the 2019 World Athletics Championships]] ([[:Category:Nations at the 2019 World Athletics Championships|2019]])
# [[:Category:Nations at the 2020 World Athletics Championships]] (<span style="color:#888">2020</span>)
# [[:Category:Nations at the 2020–2021 World Athletics Championships]] (<span style="color:#888">2020–2021</span>) (tried; not displayed)<sup>2</sup>
# [[:Category:Nations at the 2020–21 World Athletics Championships]] (<span style="color:#888">2020–21</span>) (tried; not displayed)<sup>4</sup>
# [[:Category:Nations at the 2021 World Athletics Championships]] (<span style="color:#888">2021</span>)
# [[:Category:Nations at the 2021–2022 World Athletics Championships]] (<span style="color:#888">2021–2022</span>) (tried; not displayed)<sup>2</sup>
# [[:Category:Nations at the 2021–22 World Athletics Championships]] (<span style="color:#888">2021–22</span>) (tried; not displayed)<sup>4</sup>
* All possible element types are shown above (blue, red/grey, hidden, and redirect), and would otherwise display as:
{| class="toccolours hlist" style="text-align: center; margin: auto;"
|
*<span style="visibility:hidden">2006</span>
*<span style="visibility:hidden">2007</span>
*<span style="color:#888">2008</span>
*[[:Category:Nations at the 2009 World Championships in Athletics|2009]]
*[[:Category:Nations at the 2011 World Championships in Athletics|2011]]
*'''2013'''
*[[:Category:Nations at the 2015 World Championships in Athletics|2015]]
*[[:Category:Nations at the 2017 World Championships in Athletics|2017]]
*[[:Category:Nations at the 2019 World Athletics Championships|2019]]
*<span style="color:#888">2020</span>
*<span style="color:#888">2021</span>
|}
==Tracking categories==
:<small>''{{Purge|Purge this page to update the totals}}''</small>
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:
{{Columns-start}}
===Maintenance required===
* {{Category link with count|Category series navigation failed to generate navbox}}
* {{Category link with count|Category series navigation redirection error}}
* {{Category link with count|Category series navigation range abbreviated (MOS)}}
* {{Category link with count|Category series navigation range redirected (MOS)}}
* {{Category link with count|Category series navigation range ends (blank, MOS)}}
* {{Category link with count|Category series navigation range not using en dash}}
* {{Category link with count|Category series navigation in mainspace}}
===Maintenance possible===
* {{Category link with count|Category series navigation isolated}}
* {{Category link with count|Category series navigation default season gap size}}
* {{Category link with count|Category series navigation using cat parameter}}
* {{Category link with count|Category series navigation using testcase parameter}}
* {{Category link with count|Category series navigation using unknown parameter}}
===Module maintenance possible===
* {{Category link with count|Category series navigation year redirected (other)}}
* {{Category link with count|Category series navigation range redirected (other)}}
{{Column}}
===Tracking only===
* {{Category link with count|Category series navigation range redirected (base change)}}
* {{Category link with count|Category series navigation range redirected (var change)}}
* {{Category link with count|Category series navigation range redirected (end)}}
* {{Category link with count|Category series navigation range gaps}}
* {{Category link with count|Category series navigation range irregular}}
* {{Category link with count|Category series navigation range irregular, 0-length}}
* {{Category link with count|Category series navigation range ends (present)}}
* {{Category link with count|Category series navigation TV season redirected}}
* {{Category link with count|Category series navigation decade redirected}}
* {{Category link with count|Category series navigation year redirected (base change)}}
* {{Category link with count|Category series navigation year redirected (var change)}}
* {{Category link with count|Category series navigation roman numeral redirected}}
* {{Category link with count|Category series navigation nordinal redirected}}
* {{Category link with count|Category series navigation wordinal redirected}}
* {{Category link with count|Category series navigation using skip-gaps parameter}}
* {{Category link with count|Category series navigation year and range}}
* {{Category link with count|Category series navigation year and decade}}
* {{Category link with count|Category series navigation decade and century}}
{{Columns-end}}
==See also==
* {{tl|Irregular category series navigation}}&mdash;for use on categories
* {{tl|Irregular series navigation}}&mdash;for use outside categories
* {{tl|R from category navigation}}
* {{tl|Category TOC custom}}
<includeonly>{{sandbox other||
[[Category:Chronology category templates]]
}}</includeonly>
}}</includeonly>

Revision as of 14:03, 24 September 2024

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

{{Category series navigation}} is intended to be a minimal-input, near-universal template for automatically navigating most numerically adjacent categories.

Recognized category types
Type Example category BC(E)? Example output
Season 2001–02 FA Cup No Template:Category series navigation
TV season Futurama season 1 episodes Template:Category series navigation
Office term (regular) MEPs 2004–2009 No Template:Category series navigation
Office term (irregular) Wales AMs 2003–2007 No Template:Category series navigation
Numerical range Taxonbars with 30–34 taxon IDs
Decade 1990s in Scotland BC Template:Category series navigation
Year 1999 in Scotland BC(E) Template:Category series navigation
Year (auto-condensed) Candidates in the 2000 US presidential election Template:Category series navigation
Year (|skip-gaps=yes) Amusement parks opened in 1877 Template:Category series navigation
Ordinal (temporal) 2nd-century rabbis BC(E) Template:Category series navigation
Ordinal (numeric) 9th Lok Sabha Template:Category series navigation
Ordinal (word) First Dynasty of Egypt Template:Category series navigation
Roman numeral Deputies of Legislature X of the Kingdom of Italy Template:Category series navigation
Mixed decade 1760s in the Province of Quebec (1763–1791) Template:Category series navigation
Mixed year 1778 establishments in the Province of Quebec (1763–1791) Template:Category series navigation

Searching behavior

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–961996–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

Numerical limitations and AD/BC/E

  • 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

  • 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

  • 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

Usage

Typical usage
Specify a minimum and/or maximum year to display
To skip gaps in year categories
To not automatically follow {{Category redirect}}s
Exceptional cases

Testing & debugging

To test the output of the template on a particular category name, use the |testcase= parameter, and |testcasegap= if necessary:

Template:Category series navigation

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:

  1. Category:Nations at the 2006 World Athletics Championships (2006) (2006)
  2. Category:Nations at the 2007 World Athletics Championships (2007) (2007)
  3. Category:Nations at the 2008 World Athletics Championships (2008)
  4. Category:Nations at the 2008–2009 World Athletics Championships (2008–2009) (tried; not displayed)2
  5. Category:Nations at the 2008–09 World Athletics Championships (2008–09) (tried; not displayed)4
  6. Category:Nations at the 2009 World Athletics ChampionshipsCategory:Nations at the 2009 World Championships in Athletics (2009)
  7. Category:Nations at the 2011 World Athletics ChampionshipsCategory:Nations at the 2011 World Championships in Athletics (2011)
  8. Category:Nations at the 2015 World Athletics ChampionshipsCategory:Nations at the 2015 World Championships in Athletics (2015)
  9. Category:Nations at the 2017 World Athletics ChampionshipsCategory:Nations at the 2017 World Championships in Athletics (2017)
  10. Category:Nations at the 2019 World Athletics Championships (2019)
  11. Category:Nations at the 2020 World Athletics Championships (2020)
  12. Category:Nations at the 2020–2021 World Athletics Championships (2020–2021) (tried; not displayed)2
  13. Category:Nations at the 2020–21 World Athletics Championships (2020–21) (tried; not displayed)4
  14. Category:Nations at the 2021 World Athletics Championships (2021)
  15. Category:Nations at the 2021–2022 World Athletics Championships (2021–2022) (tried; not displayed)2
  16. 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:

Tracking categories

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:

Template:Columns-start

Maintenance required

Maintenance possible

Module maintenance possible

Template:Column

Tracking only

Template:Columns-end

See also