Jump to content

Template talk:YYYY in nationality sport category header

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

See also links[edit]

@BrownHairedGirl: please can you tidy the link to omit the last comma in the following?

E.g Category:2019 in Comorian sport

"For more information, see , 2019 in sport"

Presumably it's omitting a link before the comma because the target doesn't exist, and in this case the comma is not needed either. I had a quick look at the template, but couldn't see where this is coded. – Fayenatic London 13:39, 3 October 2020 (UTC)[reply]

@Fayenatic: I know of that bug. Like several other templates, this is from {{YYYY in nationality sport category header/inner core}} using {{Cat more if exists}}, which currently has 36912 transclusion. {{Cat more if exists}} does the best it can without being Lua-ified. But to polish the output properly, really needs a Lua module to test the existence of each entry and fmt the output accordingly.
{{Category see also if exists}} has a similar task, for which it uses Module:See also if exists. That module could be easily adapted to suit {{Cat more if exists}}, but it seems ugly to just fork the code, which is why I held off doing so. I have been meaning for weeks to ask User:Pppery is they might be able to deploy some of their great Lua skills to create another entry point into that module to allow it to be used with {{Cat more if exists}}. Maybe they will catch this ping. --BrownHairedGirl (talk) • (contribs) 13:52, 3 October 2020 (UTC)[reply]
I appear to have been too slow to get to this since you've already created Module:Cat more if exists, but this problem could have been solved without making any changes to other Lua modules by using Template:Comma separated entries, as I've done in Template:Cat more if exists/core/sandbox. * Pppery * it has begun... 15:20, 3 October 2020 (UTC)[reply]
Sorry, @* Pppery *. See my note below, after an edit conflict. I decided best not to presume on your kindness, and go ahead with a Lua hack. I think that my Lua hack is a cleaner solution than retaining the messy /core, but what do you think? --BrownHairedGirl (talk) • (contribs) 15:28, 3 October 2020 (UTC)[reply]
I, as a general rule, have a significantly higher-than-consensus view of what makes a template merit a Lua module, but, after thinking about it for a while, using Lua does make sense. Trying to merge Module:Cat more if exists and Module:See also if exists cleanly runs into problems with the upstream messiness of hatnote modules in general, which I tried to clean up via a series of TfDs in June 2018 and again in February 2019, but ended with "no consensus" both times. On the bright side, you revealed a bug in Module:See also if exists, which has been sitting there un-noticed since I merged Module:Category see also if exists in 2019, and I'll fix shortly. * Pppery * it has begun... 16:03, 3 October 2020 (UTC)[reply]
I just realized while I was trying to clean this up that the switch to the module (a) added an extra colon to the hatnote text, and (b) dropped support for the separate label parameters. * Pppery * it has begun... 16:17, 3 October 2020 (UTC)[reply]
@Pppery, thanks for being so nice about how my indecision messed you about.
a) I was aware that the module added a colon, but thought I had fixed that.
b) I reckoned that the separate label params were unlikely to have ever been used. I had never documented or categorised {{Cat more if exists}} since i created it 6 months ago, so I doubt that it was ever deployed by anyone else. I never used the label params, which were a featured inherited from {{Cat more}}, so I saw no harm in dropping them. --BrownHairedGirl (talk) • (contribs) 00:16, 4 October 2020 (UTC)[reply]
I've fixed the stray colon. As for the label parameters, I don't mind them being dropped, but brought it up just to make sure it hadn't been overlooked. * Pppery * it has begun... 00:32, 4 October 2020 (UTC)[reply]
  • (ec) Update. Sorry, 'Fayenatic, I had a re-think, and decided that I was letting the best be the enemy of the good.
So I forked the module to Module:Cat more if exists, and have deployed it on Template:Cat more if exists. Seems to be working now: no more ugly-formatted links on pages that have been purged.
I had been thinking abut this weeks. Thanks for gently prodding me into action. --BrownHairedGirl (talk) • (contribs) 15:24, 3 October 2020 (UTC)[reply]

Template-protected edit request on 7 April 2023[edit]

Use {{Category explanation}} for header as I've done in the sandbox. –Aidan721 (talk) 01:14, 7 April 2023 (UTC)[reply]

 Completed. P.I. Ellsworth , ed. put'er there 13:13, 9 April 2023 (UTC)[reply]