Module talk:Excerpt slideshow: Difference between revisions

Content deleted Content added
Cewbot (talk | contribs)
m Maintain {{WPBS}}: 1 WikiProject template. Create {{WPBS}}.
 
(11 intermediate revisions by 3 users not shown)
Line 1:
{{WikiProject banner shell|
{{WikiProject Portals}}
}}
{{central|text=the talk pages for all the excerpt slideshow templates redirect here:
<div style="font-size:95%">{{flatlist|
Line 218 ⟶ 220:
:Note that I'm fairly sure blacklisting templates is the normal approach taken in scenarios like this anyways judging from [[Module talk:Excerpt]], so for now I've just blacklisted it anyways. [[User:Aidan9382|Aidan9382]] <sub>([[User talk:Aidan9382|talk]])</sub> 09:36, 19 December 2022 (UTC)
::Yes, blacklisting the template will omit the template's expansion from the portal if that's what's wanted here. [[User:Certes|Certes]] ([[User talk:Certes|talk]]) 09:50, 19 December 2022 (UTC)
 
== Handling onlyincludes ==
 
I've come back to the goal of trying to fix all the [https://en.wikipedia.org/wiki/Special:LintErrors/bogus-image-options?namespace=100 bogus file options] errors in the portal namespace caused by this module and its family, and I've managed to cut nearly every page out. However, the situation for [[Portal:Victoria]] was a little complicated. Some of the pages listed ([[2018 Geelong Football Club season|1]], [[2019 Geelong Football Club women's season|2]]) had an {{tag|onlyinclude}} tag in them, which was causing the module to try transclude something it really can't handle. Luckily, both of the articles using the tags weren't being transcluded at all, so it was safe to remove the tags. However, what's the best approach when this isn't an option? Based off my memory I don't think theres anything that can just bypass the onlyincludes in the code, and I've never seen this kind of situation before, so I'm not sure what a more proper fix would be here. Any ideas? [[User:Aidan9382|Aidan9382]] <sub>([[User talk:Aidan9382|talk]])</sub> 19:43, 23 January 2023 (UTC)
 
:[[Module:Excerpt/portals#L-575]] has code to handle onlyinclude, if that helps. [[User:Certes|Certes]] ([[User talk:Certes|talk]]) 20:01, 23 January 2023 (UTC)
 
::Let me clarify - that exact code ''is'' my problem. The slideshow attempts to grab some text to display for the article, but instead of getting the lead, it grabs the onlyinclude section, which isn't what we want, and also leads to linter errors in this specific scenario due to how complicated the sections are. Is there a way around that from a code side of things, or do we simply just have to re-format the article to work with the situation? [[User:Aidan9382|Aidan9382]] <sub>([[User talk:Aidan9382|talk]])</sub> 20:21, 23 January 2023 (UTC)
:::I suppose we need to look at why the article uses onlyinclude. I naively assumed that it would be for the rare occasions when we should only include the text within the tag and ignore the rest. We need to ask "what else transcludes the article?" and "how does onlyinclude help those transclusions?" In these examples, the answers were "nothing" and "it doesn't, so get rid of it". In general, onlyinclude may not be the best solution to whatever problem it was trying to solve. For example, [[Portal:The Simpsons]] was unable to transclude the lead of [[The Simpsons]], because the article had onlyinclude around the episode count so that other articles could just transclude the entire article to get an up-to-date number. (D'oh!) We fixed that by ripping out the inappropriate noinclude tag and using {{tlx|Template parameter value|The Simpsons|Infobox television||num_episodes}} in the transcluding pages. [[User:Certes|Certes]] ([[User talk:Certes|talk]]) 21:00, 23 January 2023 (UTC)
::::Yeah alright, that makes sense. Thanks for the example, too. I'll keep that in mind for the future. [[User:Aidan9382|Aidan9382]] <sub>([[User talk:Aidan9382|talk]])</sub> 21:06, 23 January 2023 (UTC)
 
== Another rendering / invalid file options error with [[Template:Transclude list item excerpts as random slideshow]] ==
 
In [https://en.wikipedia.org/w/index.php?title=User:Jonesey95/sandbox&oldid=1240141507 this version of my sandbox], I have used [[Template:Transclude list item excerpts as random slideshow]] to pull in a group of five articles. The article [[2022 Clackmannanshire Council election]] causes significant rendering errors, showing me things like <code>UNIQ--templatestyles-00000010-QINU</code> instead of an excerpt. The excerpting also causes Linter "bogus file options" errors. Can someone please look at this error?
 
This is a simplified case of a problem that is happening in Portal pages, including [[Portal:Scotland/Featured]]. I can provide a screen shot if necessary. It may appear only sometimes in the Portal pages, depending on which articles are excerpted. Pinging {{U|Evad37}}, who has been helpful in the past in tracking down these edge cases. – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 19:31, 13 August 2024 (UTC)
:Note: In a [[Module_talk:Excerpt_slideshow#Template:Transclude_list_item_excerpts_as_random_slideshow_pulls_in_unwanted_templates|discussion above]], {{U|Aidan9382}} blacklisted a template that was causing trouble. In this case, it may be a table that is causing trouble. If that is the case, can we exclude tables from the excerpts? – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 19:37, 13 August 2024 (UTC)
::This seems to be the same issue that was had in {{slink||Handling onlyincludes}} above, where an <code><nowiki><onlyinclude></nowiki></code> tag is causing the module to target text that it isn't designed to handle (in this and the above case, a table, which don't work with the gallery format this creates). Unfortunately, I'm not sure what the best solution here is. I think in this module's context, it would make sense for it to ignore onlyincludes, since this module is generally just interested in extracting the lead. [[User:Aidan9382|Aidan9382]] <sub>([[User talk:Aidan9382|talk]])</sub> 10:37, 18 August 2024 (UTC)
:::I've implemented what I suggested above, which fixes the specific case you provide as well as 2 portals with a current linter error (unsure about the 3rd's issue). Bogus file options is very much a game of whack-a-mole when it comes to portals since the page selection tends to be randomised, but this should help a decent bit with avoiding the weirder cases. [[User:Aidan9382|Aidan9382]] <sub>([[User talk:Aidan9382|talk]])</sub> 11:27, 18 August 2024 (UTC)
::::Thank you. The randomization of excerpts can indeed make error-finding and error-fixing a little tricky. I'll keep an eye on the Linter error list. – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 15:15, 19 August 2024 (UTC)