Template talk:Category series navigation

(Redirected from Template talk:Csn)
Latest comment: 1 month ago by Tom.Reding in topic Module:Category series navigation localization

Question/request regarding non-pages display

edit

Two related questions or requests if this needs to be implemented.

  1. Is there an option to disable the greyed out non-links (without knowing the max amount)?
  2. Is it possible to remove the empty bullets? - see Category:Agent Carter season 1 episodes.

Gonnym (talk) 19:30, 2 April 2024 (UTC)Reply

@Gonnym:
  1. No. Do you mean like @ The Sopranos season 6 episodes?
  2. 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 (talkdgaf)  10:15, 11 July 2024 (UTC)Reply
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)Reply
  Done! |max= can be used to redisplay bullets & grey numbers, if/as needed. That was a fun fix.   ~ Tom.Reding (talkdgaf)  12:12, 17 July 2024 (UTC)Reply
Thanks, looks amazing! Gonnym (talk) 12:22, 17 July 2024 (UTC)Reply

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)Reply

@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 (talkdgaf)  09:52, 11 July 2024 (UTC)Reply
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)Reply
Current again for reference:
YYYY–YY x4 per side:
YYYY–YYYY x3 per side:
Definitely looks good.   ~ Tom.Reding (talkdgaf)  12:32, 17 July 2024 (UTC)Reply
 clock 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 (talkdgaf)  19:43, 9 August 2024 (UTC)Reply
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)Reply
  Fixed   ~ Tom.Reding (talkdgaf)  14:14, 10 August 2024 (UTC)Reply
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)Reply
  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 (talkdgaf)  14:14, 10 August 2024 (UTC)Reply
Thanks, Tom.Reding – I suggest you implement the sandbox! – Fayenatic London 21:25, 10 August 2024 (UTC)Reply
  Live! After a few followup bug fixes, all the testcases now look correct.   ~ Tom.Reding (talkdgaf)  18:15, 12 August 2024 (UTC)Reply
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 (talkdgaf)  19:25, 12 August 2024 (UTC)Reply
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)Reply
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 (talkdgaf)  13:05, 15 August 2024 (UTC)Reply

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)Reply

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 (talkdgaf)  09:59, 11 July 2024 (UTC)Reply
@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 (talkdgaf)  12:46, 11 July 2024 (UTC)Reply
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)Reply
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)Reply
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 (talkdgaf)  14:14, 10 August 2024 (UTC)Reply
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)Reply
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 (talkdgaf)  14:14, 10 August 2024 (UTC)Reply
  Fixed via Category:American soccer clubs 1960 seasonCategory:American soccer clubs 1960–61 season in the meantime.   ~ Tom.Reding (talkdgaf)  14:14, 10 August 2024 (UTC)Reply
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)Reply

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)Reply

@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:
  1. much less tedious to do
  2. much easier to check that they have been created correctly
  3. 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 (talkdgaf)  15:42, 9 August 2024 (UTC)Reply

Edit request: normalize nsText property

edit

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)Reply

@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 (talkdgaf)  11:19, 12 August 2024 (UTC)Reply
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)Reply
  Done   ~ Tom.Reding (talkdgaf)  18:16, 12 August 2024 (UTC)Reply

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)Reply

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)Reply
@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)Reply
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)Reply
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)Reply

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)Reply

@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 (talkdgaf)  12:11, 20 August 2024 (UTC)Reply
Ok alright.this module is very complexly disignd R1F4T (talk) 15:56, 20 August 2024 (UTC)Reply
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)Reply
@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)Reply
@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 (talkdgaf)  13:55, 23 August 2024 (UTC)Reply
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)Reply
@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:
  1. local parentBC = mw.ustring.match(lastpart, '%s(BCE?)') should probably be changed to something like local parentBC = mw.ustring.match(firstpart, '(BCE?)%s?$')
  2. local lastpartNoBC = mw.ustring.gsub(lastpart, '%sBCE?', '') →‎ local firstpartNoBC = mw.ustring.gsub(firstpart, '(BCE?)%s?$', '')
    1. note the change in variable name
  3. follow those variables, and any with BC in the name or in the comments, down through the code to move BC in front
    1. for example, BC = ' '..BCe →‎ BC = BCe..' ', etc.
~ Tom.Reding (talkdgaf)  14:57, 23 August 2024 (UTC)Reply
u can link line this way Module:Category series navigation#L-2073 R1F4T (talk) 15:28, 23 August 2024 (UTC)Reply
Ok lemme try this R1F4T (talk) 15:29, 23 August 2024 (UTC)Reply
that means I have to change all the variables for lastpartnoBC => firstpartnobc R8 R1F4T (talk) 16:22, 23 August 2024 (UTC)Reply
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)Reply
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 (talkdgaf)  17:36, 23 August 2024 (UTC)Reply
[1] now the BC disappeared bn:user:R1F4T/খেলাঘর/পরীক্ষা R1F4T (talk) 06:49, 24 August 2024 (UTC)Reply

Faced a problem

edit

This problem is fixed by self

After this edit it's displaing ?'`UNIQ--templatestyles-০০০০০০০২-QINU`"'? R1F4T (talk) 15:10, 9 October 2024 (UTC)Reply

@tom.reding ig this is happening due to the change of 1st February.when you added templatestyle R1F4T (talk) 16:59, 9 October 2024 (UTC)Reply
@Tom.Reding one help pls. Can you tell me which part or which function of the module generets the decade part in the nav_year like
. I am talking about the decades which are shown below the year R1F4T (talk) 04:49, 13 October 2024 (UTC)Reply
@R1F4T: L-2034--L-2035   ~ Tom.Reding (talkdgaf)  12:21, 13 October 2024 (UTC)Reply