Template talk:Category series navigation
![]() | This template does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||
|
![]() | On 22 October 2023, it was proposed that this page be moved to Template:Sequential chronology category navigation. The result of the discussion was moved to Template:Category series navigation. |
|
|||
This page has archives. Sections older than 180 days may be automatically archived by Lowercase sigmabot III when more than 3 sections are present. |
Question/request regarding non-pages display
[edit]Two related questions or requests if this needs to be implemented.
- Is there an option to disable the greyed out non-links (without knowing the max amount)?
- Is it possible to remove the empty bullets? - see Category:Agent Carter season 1 episodes.
Gonnym (talk) 19:30, 2 April 2024 (UTC)
- @Gonnym:
- No. Do you mean like @ The Sopranos season 6 episodes?
- No(t yet).
- These both seem like desirable features for show-seasons. Should they be applied by default, as opposed to switched on? ~ Tom.Reding (talk ⋅dgaf) 10:15, 11 July 2024 (UTC)
- Yes to 1. I'm surprised I didn't add an example, thanks for finding one. Yeah I think having them set by default will be better. Gonnym (talk) 12:14, 11 July 2024 (UTC)
Done!
|max=
can be used to redisplay bullets & grey numbers, if/as needed. That was a fun fix. ~ Tom.Reding (talk ⋅dgaf) 12:12, 17 July 2024 (UTC)- Thanks, looks amazing! Gonnym (talk) 12:22, 17 July 2024 (UTC)
- Yes to 1. I'm surprised I didn't add an example, thanks for finding one. Yeah I think having them set by default will be better. Gonnym (talk) 12:14, 11 July 2024 (UTC)
Number of seasons displayed
[edit]@Tom.Reding: the template currently displays 5 years/decades forward & back, but only 3 seasons. Please would you extend the number of seasons also to 5? Then this template can be used in e.g. {{NHL seasons CatNav}} without loss. – Fayenatic London 08:33, 11 July 2024 (UTC)
- @Fayenatic london: if I can restrict it to YYYY–YY cases where the seasons increment by 1, then ok.
- The current maximum-width case is:
- Proposed is:
- YYYY–YYYY x5 per side produces:
- to abide by MOS:DATERANGE, which is 56% wider than the current widest nav, which I think is too wide.
- Also, technically, {{NHL seasons CatNav}} violates MOS:DATERANGE at the year 2000 by displaying "1999–00" instead of "1999–2000". Admittedly, "1999–00" looks much better since it keeps all nav elements the same width, so maybe WP:IAR just for 2000? ~ Tom.Reding (talk ⋅dgaf) 09:52, 11 July 2024 (UTC)
- I take your point about YYYY–YYYY x5 being too wide.
- Moving between pages in a mixed series (years and seasons), it looks weird when the table width jumps between x5 and x3 links. How about x4 for seasons? Or perhaps x4 for YYYY–YY and x3 for YYYY–YYYY?
- As for 1999–2000, IMHO the guideline should be altered to only rule out 1999–00 in article text, as it's perfectly clear when presented as part of a list of links. – Fayenatic London 13:57, 11 July 2024 (UTC)
- Current again for reference:
- YYYY–YY x4 per side:
- YYYY–YYYY x3 per side:
- Definitely looks good. ~ Tom.Reding (talk ⋅dgaf) 12:32, 17 July 2024 (UTC)
Ready in the sandbox ~ YYYY–YYYY & YYYY–YY used as example cats.
- I made it so up to 2 YYYY–YYYY are allowed for the entire x4-per-side nav before reverting back to x3-per-side, to smooth out any navigational irregularities (e.g. COVID, 2000, etc.). ~ Tom.Reding (talk ⋅dgaf) 19:43, 9 August 2024 (UTC)
- Thanks, Tom. Trying the sandbox template in Category:1996–97 in IndyCar, it extends the range one more than the current limit 2000, but instead of linking to 2001, it returns 2001–02 in grey. – Fayenatic London 20:46, 9 August 2024 (UTC)
- I found a similar thing with the current version at Category:American soccer clubs 1960–61 season where it skips a gap and finds the next category 1967, but after that returns grey 1968–69 instead of linking to 1968. – Fayenatic London 21:07, 9 August 2024 (UTC)
Fixed! This was literally an edge case, where a cat was found at the edge of the search limit, so I decided to just keep moving the goalpost... ~ Tom.Reding (talk ⋅dgaf) 14:14, 10 August 2024 (UTC)
- Thanks, Tom.Reding – I suggest you implement the sandbox! – Fayenatic London 21:25, 10 August 2024 (UTC)
Live! After a few followup bug fixes, all the testcases now look correct. ~ Tom.Reding (talk ⋅dgaf) 18:15, 12 August 2024 (UTC)
- I might even go 1 step further (later) & display 5 elements on each side IF the majority of the elements are only single years (e.g. surrounding Category:2019–20 FIA World Endurance Championship season), now that a lot of relevant code is in place. This will actually go a long way towards effectively (visually) merging nav_hyphen() & nav_year(), which has been in the back of my mind for a long time. Little did I know when starting this that it would be a step in that direction :) ~ Tom.Reding (talk ⋅dgaf) 19:25, 12 August 2024 (UTC)
- That would be nice, if it's doable – thanks, Tom.
- In that series I notice that the 2018–19 and 2019–20 pages show only valid links, whereas 2017 and 2021 have a grey link for 2020 – but that's understandable, so no need to spend time on it unless there's an easy way to skip that gap. I tried using the skip-gaps parameter on the 2017 or 2021 page, but then it wrongly omits 2018–19 and 2019–20 altogether. – Fayenatic London 19:55, 13 August 2024 (UTC)
- I added a 3rd bullet under Template:Category series navigation/doc#Condensation to explain that
|skip-gaps=
only works on and for year categories, and is not intended to find hyphenated ranges. Perhaps the parameter name is a bit misleading by being overly broad, but my planned improvements above will get it a step closer to earning its name - not by finding hyphenated ranges, but by at least skipping years when starting on a hyphenated range.|skip-gaps=
can easily be made to work on TV seasons, ordinals (temporal, numeric, and word), and roman numerals, but I just haven't seen the need for it (i.e. those types of cats don't contain any gaps that I know of. And if they did, and the gaps were small, the gaps themselves would probably be important enough to be shown, and not skipped over.). ~ Tom.Reding (talk ⋅dgaf) 13:05, 15 August 2024 (UTC)
- I added a 3rd bullet under Template:Category series navigation/doc#Condensation to explain that
- I might even go 1 step further (later) & display 5 elements on each side IF the majority of the elements are only single years (e.g. surrounding Category:2019–20 FIA World Endurance Championship season), now that a lot of relevant code is in place. This will actually go a long way towards effectively (visually) merging nav_hyphen() & nav_year(), which has been in the back of my mind for a long time. Little did I know when starting this that it would be a step in that direction :) ~ Tom.Reding (talk ⋅dgaf) 19:25, 12 August 2024 (UTC)
- Definitely looks good. ~ Tom.Reding (talk ⋅dgaf) 12:32, 17 July 2024 (UTC)
Year to season anomaly
[edit]The template picks up most switches between year and season, but at Category:1998 in IndyCar it still omits the anomalous preceding Category:1996–97 in IndyCar.
We could easily make a workaround by adding a redirect from 1997 to 1996–97, but Tom may prefer to cover this instance in the code. – Fayenatic London 09:13, 11 July 2024 (UTC)
- This is indeed anomalous. When a year is found (1996), it stops looking, and moves on to the next year. I'd rather not codify a change in that behavior, unless there are a few more cases like this out there. In the meantime, I think a redirect is the simplest & best solution. ~ Tom.Reding (talk ⋅dgaf) 09:59, 11 July 2024 (UTC)
- @Fayenatic london: ...which makes me wonder about how to design a search for such missing cats...how on Earth did you find 1996–97 in IndyCar? ~ Tom.Reding (talk ⋅dgaf) 12:46, 11 July 2024 (UTC)
- OK, happy to use a workaround if you think this case is very uncommon.
- As for finding this one: I happened to look at Template talk:Year parameter usage check because of some current CFDs, and followed up some old anomalies noted there. – Fayenatic London 13:01, 11 July 2024 (UTC)
- Tom, I have set up 1997 as a redirect. Now 1996 and 1998 display "1997" as a link to 1996–97. That's an improvement at 1998 which previously had a gap. However, it surprises me that the template does not resolve the redirect. – Fayenatic London 21:05, 9 August 2024 (UTC)
- That's actually a feature - the category link resolves correctly, bypassing the 1997 #R, and displays the expected cat (1997).
- However, the nav on 1996–97 in IndyCar displays differently than on 1996/1998/etc., since the starting cat is hyphenated, and so hyphens become the default for the greyed text. ~ Tom.Reding (talk ⋅dgaf) 14:14, 10 August 2024 (UTC)
- Another year-to-season anomaly is Category:American soccer clubs 1967 season where it does not find the preceding 1960–61 season. If skip-gaps=yes is added, it still does not find 1960–61, but leaps all the way back to the last ordinary year category 1934. – Fayenatic London 21:13, 9 August 2024 (UTC)
- @Fayenatic london: ...which makes me wonder about how to design a search for such missing cats...how on Earth did you find 1996–97 in IndyCar? ~ Tom.Reding (talk ⋅dgaf) 12:46, 11 July 2024 (UTC)
- This is kind of a known-issue, but I'll see about adding single-year hyphenation to
|skip-gaps=yes
. It won't be anywhere near as comprehensive as the exhaustive hyphenation search, since|skip-gaps=yes
is meant for breadth and not depth. Enjoying both at the same time I don't think is possible with the WP:EPFC limit of 500. The worst-case scenario, an isolated cat like this, already reaches a WP:EPFC of 279/500, so adding a hyphen check to that would double it to 558/500 and emit a bright red Lua error. Perhaps I can start with a full-breadth search, then do as much depth as I can. I just need some way of reliably keeping tracking of the EPFC. ~ Tom.Reding (talk ⋅dgaf) 14:14, 10 August 2024 (UTC) Fixed via Category:American soccer clubs 1960 season → Category:American soccer clubs 1960–61 season in the meantime. ~ Tom.Reding (talk ⋅dgaf) 14:14, 10 August 2024 (UTC)
- Great. I added further redirects at 1955/57/58/59 so that 1934 no longer appears in the box on the 1967 page. – Fayenatic London 21:23, 10 August 2024 (UTC)
- This is kind of a known-issue, but I'll see about adding single-year hyphenation to
Base-name change
[edit]I have a question about base-name changes. For example, see subcategories in this category: Category:FIBA Asia Cup. Today I tried to join the following two categories:
However, it's very impractical; in such cases, ten redirects (R from category navigation) must be created. Couldn't this be done using the parameters in this template? My proposal for that 2015 category is as follows:
{{Category series navigation | -3 = 2009 FIBA Asia Championship | -2 = 2011 FIBA Asia Championship | -1 = 2013 FIBA Asia Championship | +1 = 2017 FIBA Asia Cup | +2 = 2022 FIBA Asia Cup | +3 = 2025 FIBA Asia Cup }}
What do you think about it? Maiō T. (talk) 20:48, 20 July 2024 (UTC)
- @Maiō T.: Requiring such parameters would defeat the whole purpose of this template, and would do so at great cost.
- Only 2 {{R from category navigation}} need to be created, and even if 10 are desired, that is:
- much less tedious to do
- much easier to check that they have been created correctly
- much less error-free
- than the error-prone addition of 30 such carefully curated parameters across all transitional categories (1+2+3+4+5+5+4+3+2+1=30). ~ Tom.Reding (talk ⋅dgaf) 15:42, 9 August 2024 (UTC)
Edit request: normalize nsText property
[edit]![]() | This edit request to Module:Category series navigation has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Please apply to this module the same change that I have applied to the sandbox: 1239909834. (for completeness, I have also fixed this user sandbox similarly: 1239909570, note it's a completely different module)
Code of my edit summary, if you want to reuse it: « replace underscores with spaces in [[mw:Extension:Scribunto/Lua reference manual#Title objects|nsText property]], so that it works both currently and after [[phab:T369784|T369784]] gets fixed; I'm doing two gsub()'s, I don't think it's worth adding a variable ».
I haven't detected other cases: the search I used.
By the way, T369784 might interest you.
Od1n (talk) 10:48, 12 August 2024 (UTC)
- @Od1n: what is the timeline/urgency of this? I plan on updating the module anyway in the next day or so, depending on however long it takes to fix a few bugs. ~ Tom.Reding (talk ⋅dgaf) 11:19, 12 August 2024 (UTC)
- I'd say the sooner the better: it's a simple change, and after it is implemented no further action is needed, the code is ready for T369784. Od1n (talk) 11:26, 12 August 2024 (UTC)
From bnwiki
[edit]need help! See { {csn|testcase = 1st century BC}} It links the category with Category:1st century BC now in Bengali we are using this BC part in the front is there is a way to bring this in front Like { {CSN|testcase= BC 1st Century}} Will link to category:BC 1st century R1F4T (talk) 08:03, 23 August 2024 (UTC)
- If you imported the whole thing, then Module:Year category type is where the page name patters are. Gonnym (talk) 08:17, 23 August 2024 (UTC)
- @Gonnym but I am not seeing ny link to Module:Year category type in Module: Category series Navigation R1F4T (talk) 09:45, 23 August 2024 (UTC)
- Ah, it seems I was mistaken. I thought for some reason that that template helped this one with the title, but it doesn't. You'll have to wait for Tom to help here as the BC code seems to be in many places in this module. Gonnym (talk) 12:37, 23 August 2024 (UTC)
- Yeah I tested many times in bnwiki few days ago I some how figured out but I forgot the revision id which was worked ah . Lang difference is very painful uh R1F4T (talk) 12:40, 23 August 2024 (UTC)
- Ah, it seems I was mistaken. I thought for some reason that that template helped this one with the title, but it doesn't. You'll have to wait for Tom to help here as the BC code seems to be in many places in this module. Gonnym (talk) 12:37, 23 August 2024 (UTC)
- @Gonnym but I am not seeing ny link to Module:Year category type in Module: Category series Navigation R1F4T (talk) 09:45, 23 August 2024 (UTC)
Module:Category series navigation localization
[edit]Hey @Tom.Reding if you can help me to localize this module in bnwiki Module:Category series navigation BN:module:বিষয়শ্রেণী পরিভ্রমণ sandbox BN:module: Navseasoncats/খেলাঘর R1F4T (talk) 18:16, 19 August 2024 (UTC)
- @R1F4T: I've never done that before, and it looks like it will take some time. There is a bug in the module that I need to fix first. After that, I'll give it a shot. ~ Tom.Reding (talk ⋅dgaf) 12:11, 20 August 2024 (UTC)
- Ok alright.this module is very complexly disignd R1F4T (talk) 15:56, 20 August 2024 (UTC)
- need help! See { {csn|testcase = 1st century BC}} It links the category with Category:1st century BC now in Bengali we are using this BC part in the front is there is a way to bring this in front Like { {CSN|testcase= BC 1st Century}} Will link to category:BC 1st century R1F4T (talk) 09:50, 23 August 2024 (UTC)
- @Tom.Reding also if you can help to translate the input and output year in bnwiki here R1F4T (talk) 13:08, 23 August 2024 (UTC)
- @R1F4T: the more I think about this task, the less inclined I am to do it. The module is/was not designed to be so generalizable. There are many dozens of en.wiki caveats and exceptions baked into the code that I have no interest in pulling out, or turning into even more conditionals. See this talk page's history, the 21 testcase pages, and the code itself for all the nuanced special cases & pitfalls encountered here. Every time I encountered a special case, and made a code correction for it, and remembered to do so, I added a comment with the category name or the relevant string in
"these quotes"
(not'these quotes'
). Looking through all my Lua comments, I find 129"quote pairs"
(an upper bound). I can't imagine myself adapting/providing-support-for these special cases for another language, but feel free to copy the code, play around with, and change it as you or others wish. ~ Tom.Reding (talk ⋅dgaf) 13:55, 23 August 2024 (UTC)- Understand. But if you can answer this question pls
- ([It links the category with Category:1st century BC now in Bengali we are using this BC part in the front is there is a way to bring this in front Like { {CSN|testcase= BC 1st Century}} Will link to category:BC 1st century]) R1F4T (talk) 14:19, 23 August 2024 (UTC)
- @R1F4T: Category:BC 1st Century has a 'vtype' = 'nordinal', which is used @ L-2073 (I'm not sure how to link to a module line) to call nav_nordinal(), which starts @ L-1623. The needed changes that pop out to me are:
local parentBC = mw.ustring.match(lastpart, '%s(BCE?)')
should probably be changed to something likelocal parentBC = mw.ustring.match(firstpart, '(BCE?)%s?$')
local lastpartNoBC = mw.ustring.gsub(lastpart, '%sBCE?', '')
→local firstpartNoBC = mw.ustring.gsub(firstpart, '(BCE?)%s?$', '')
- note the change in variable name
- follow those variables, and any with
BC
in the name or in the comments, down through the code to move BC in front- for example,
BC = ' '..BCe
→BC = BCe..' '
, etc.
- for example,
- ~ Tom.Reding (talk ⋅dgaf) 14:57, 23 August 2024 (UTC)
- u can link line this way Module:Category series navigation#L-2073 R1F4T (talk) 15:28, 23 August 2024 (UTC)
- Ok lemme try this R1F4T (talk) 15:29, 23 August 2024 (UTC)
- that means I have to change all the variables for lastpartnoBC => firstpartnobc R8 R1F4T (talk) 16:22, 23 August 2024 (UTC)
- what if I define local parentBC = mw.ustring.match(lastpart, '%s(BCE?)') as local parentBC = 'BC' @Tom.Reding R1F4T (talk) 16:23, 23 August 2024 (UTC)
- Like I said,
I can't imagine myself adapting/providing-support-for these special cases for another language, but feel free to copy the code, play around with, and change it as you or others wish.
~ Tom.Reding (talk ⋅dgaf) 17:36, 23 August 2024 (UTC)- [1] now the BC disappeared bn:user:R1F4T/খেলাঘর/পরীক্ষা R1F4T (talk) 06:49, 24 August 2024 (UTC)
- Like I said,
- what if I define local parentBC = mw.ustring.match(lastpart, '%s(BCE?)') as local parentBC = 'BC' @Tom.Reding R1F4T (talk) 16:23, 23 August 2024 (UTC)
- @R1F4T: Category:BC 1st Century has a 'vtype' = 'nordinal', which is used @ L-2073 (I'm not sure how to link to a module line) to call nav_nordinal(), which starts @ L-1623. The needed changes that pop out to me are:
- @R1F4T: the more I think about this task, the less inclined I am to do it. The module is/was not designed to be so generalizable. There are many dozens of en.wiki caveats and exceptions baked into the code that I have no interest in pulling out, or turning into even more conditionals. See this talk page's history, the 21 testcase pages, and the code itself for all the nuanced special cases & pitfalls encountered here. Every time I encountered a special case, and made a code correction for it, and remembered to do so, I added a comment with the category name or the relevant string in
- @Tom.Reding also if you can help to translate the input and output year in bnwiki here R1F4T (talk) 13:08, 23 August 2024 (UTC)
- need help! See { {csn|testcase = 1st century BC}} It links the category with Category:1st century BC now in Bengali we are using this BC part in the front is there is a way to bring this in front Like { {CSN|testcase= BC 1st Century}} Will link to category:BC 1st century R1F4T (talk) 09:50, 23 August 2024 (UTC)
- Ok alright.this module is very complexly disignd R1F4T (talk) 15:56, 20 August 2024 (UTC)