Module talk:Excerpt slideshow

Very useful
I want this! Next step would be to combine with Transclude list item excerpt as Transclude list item excerpts as random slideshow, to make a really powerful automation tool to make a portal from an outline list. &middot; &middot; &middot; Peter (Southwood) (talk): 05:13, 25 June 2018 (UTC)

Losing list formatting
This template seems to be losing the formatting of bulleted lists. See example.

The template Transclude lead excerpt seems to do it right. See example.

so the module is working. Cheers, &middot; &middot; &middot; Peter (Southwood) (talk): 12:07, 28 July 2018 (UTC)
 * This is from a limitation of the gallery syntax, where the caption can't contain any new lines, so the module changes them to tags. It might be possible for the module to change a wikitext list into a html list with  and  tags. But allowing for sublists makes it complicated. - Evad37 &#91;talk] 03:46, 29 July 2018 (UTC)
 * , mostly. If different types of list are mixed together, e.g. a numbered sublist (lines beginning  or similar), then the sublist will still be broken. - Evad37 &#91;talk] 04:51, 14 September 2018 (UTC)
 * I can't remember what it used to look like:-/ Current version is nearly right – I see that the return to a lesser indent is missing its bullet. Cheers, &middot; &middot; &middot; Peter (Southwood) (talk): 05:41, 14 September 2018 (UTC)
 * . (Before, the items would have the "*" characters at the start of the line instead of proper bullet points) - Evad37 &#91;talk] 07:01, 15 September 2018 (UTC)
 * Thanks for the reminder, and latest tweak. Cheers, &middot; &middot; &middot; Peter (Southwood) (talk): 08:58, 15 September 2018 (UTC)

Option for title display
Would it be possible to extract the title of the selected excerpt and display it at the top of the rendering? Some excerpts are not very obvious about their topic, and particularly with the slideshow arrangement, it would help to identify what the excerpt is about. In the case of a section, the full section title would probably be most generally useful. &middot; &middot; &middot; Peter (Southwood) (talk): 17:11, 28 July 2018 (UTC)
 * For lead excerpts at least, it sounds more like a content issue that should be addressed at the individual articles – lead sentences should be making it obvious what the topic of the article is (MOS:LEAD). If they do that properly, than showing the page title as well is superfluous. For sections, showing the article title and section makes sense, but should probably be done at Module:Excerpt rather than here. - Evad37 &#91;talk] 03:40, 29 July 2018 (UTC)
 * True, but most portals created using the new structure are going to include some articles with badly formed leads, and having the title displayed may reduce confusion in the reader. It is not reasonably practicable to check every lead, and new articles will be added which will be included automatically. Some of them will have poorly formed leads. &middot; &middot; &middot; Peter (Southwood) (talk): 05:46, 14 September 2018 (UTC)

Images not rendering properly
- The images produced by this template at Portal:India are rendering badly (they seem to be getting cut off after a certain width). Could you check this up. — FR&thinsp;+ 05:34, 6 August 2018 (UTC)
 * I can't see any issues with the excerpt slideshows on that portal, at least on my computer.
 * Can you provide a screenshot of the problem? (see WP:WPSHOT for instructions)
 * Can you test on other browsers or other computers?
 * Does the same problem happen if you use transclude lead excerpt? (If so, that would indicate a problem with Module:Excerpt rather than this module.)
 * - Evad37 &#91;talk] 13:04, 6 August 2018 (UTC)


 * - I have uploaded added the screenshot of the problem. — FR&thinsp;+ 10:51, 7 August 2018 (UTC)

Template stops transcluding lead when it encounters a | character
See Portal:A-ha and Minor Earth Major Sky.

Transclusion stops at the | character, when it shouldn't. Dreamy Jazz 🎷 talk to me &#124; my contributions 10:57, 5 September 2018 (UTC)
 * . Pinging as still a present problem. Dreamy Jazz 🎷 talk to me &#124; my contributions 21:29, 13 September 2018 (UTC)
 * This one works with Transclude lead excerpt, but with Transclude excerpts as random slideshow it's stopping as described: immediately before a "|" character in the text (not wikitext in a piped link etc.) early in the source article Minor Earth Major Sky.  I guess that the "|" prematurely terminates a parameter, perhaps to #tag:gallery in Module:Random slideshow.  Can you gsub it to { {!}} or something? Certes (talk) 00:23, 14 September 2018 (UTC)
 * . Ended up needing to replace pipes not within links or templates with the html enitity  so that it wouldn't get expanded again by Module:Random slideshow - Evad37 &#91;talk] 02:29, 14 September 2018 (UTC)

Problems when including a page with a mathematics formula
Portal:Tires uses this module via and creates maths rendering error when transcluding Slip angle which has a mathematical expression at the end of its second paragraph. The error message generated is It looks like the  part got stripped, perhaps thinking this is a table rather than part of a math's formula. --Salix alba (talk): 12:07, 8 September 2018 (UTC)

Annotated links in lists
I think I may be repaying your helpfulness by creating more work. Sorry about that.

I have made a template which is useful in lists to annotate the item using the short description from the linked article. This obviously changes the format and now this template does not recognise the links any more - they are now inside, where article title represents the link.

Can this be managed without excessive overhead? An example can be seen in Portal:Underwater diving in box Diving modes, which gets a list from Outline of underwater diving, which now has examples of the Annotated link template. &middot; &middot; &middot; Peter (Southwood) (talk): 08:12, 13 September 2018 (UTC)
 * ✅ - Evad37 &#91;talk] 10:28, 13 September 2018 (UTC).
 * Also fixed in Module:Excerpt, so that Transclude linked excerpt and Transclude list item excerpt will work with annotated links. - Evad37 &#91;talk] 10:36, 13 September 2018 (UTC)
 * Good work mate, Thanks, &middot; &middot; &middot; Peter (Southwood) (talk): 12:09, 13 September 2018 (UTC)

This module is not rendering numbered lists or tabs using colons
Pinging and

This module does not render numbered lists or tabs using colons. It is this module that has the problem, as this test on my sandbox confirms it works as normal for Module:Excerpt. See Portal:Sandgrouse and Order (biology). Thanks, Dreamy Jazz 🎷 talk to me &#124; my contributions 20:14, 14 September 2018 (UTC)
 * numbered lists. Colon markup is going to be more difficult, since it can be also be used with semi-colons as definition list markup. - Evad37 &#91;talk] 07:50, 15 September 2018 (UTC)

Use with navboxes
This template is being used with navboxes to semi-automate portal construction, but as far as I can tell, only for the whole content of the navbox. Is it possible to extract a group from a navbox template, and ideally use the group title in the header and to select the group with its subgroups for a random slideshow? This way several selected article boxes could be populated from the same navbox. &middot; &middot; &middot; Peter (Southwood) (talk): 19:15, 19 September 2018 (UTC)

Missing image
Portal:Buffalo Braves transcludes 1972–73 Buffalo Braves season which has, but Image:Buffalo Braves logo.png doesn't exist. Can Transclude list item excerpts as random slideshow ignore the logo parameter here? (Also, the image would also probably be non-free if it did exist, though that's hard to guess without an image.) Thanks, Certes (talk) 10:42, 21 September 2018 (UTC)
 * This is a Module:Excerpt problem, per Template:Transclude_lead_excerpt/testcases. Lua can access file data such as existence, but it is expensive. So its probably better to fix the articles where these occur. - Evad37 &#91;talk] 05:29, 22 September 2018 (UTC)
 * Oops, you're right on both counts. I've fixed the article.  Thanks for adding the test case. Certes (talk) 11:00, 22 September 2018 (UTC)

Page layout error
The Template:Transclude excerpts as random slideshow when used in the Portal:Sexuality presents a page formatting error. See the erro here Guilherme Burn (talk) 15:01, 5 November 2018 (UTC)
 * I am getting the same problem on Portal:Minerals with the following code:

RockMagnetist (DCO visiting scholar) (talk) 17:29, 13 November 2018 (UTC)

Only lead images
In Portal:Geophysics, this template only displays the two images in the lead of Geophysics. RockMagnetist(talk) 16:52, 11 November 2018 (UTC)

Read more
We have a few slideshow items just saying "Read more... Read more...". (Sadly, the output is being ridiculed as proof by example that all portals are "shit".)

I've tracked this down and made a couple of changes in the sandbox. They affect makeGalleryArgs when excerpt consists of just "Read more". Firstly, a blank lead sets readmore_start_index to 1, so  equals sub(excerpt, 1, -1) which is the whole string, and fails to remove the "Read more". I've changed the -2 to -1, and kept the leading space in readmore_text to compensate. Secondly, #excerpt needs to be checked again after removing "Read more" in case it just dropped below 10.

Please can you cast your eye over the code to see that it still looks reasonable? I've added a testcase for it here. The sandbox also includes your new constants which could be a good idea, depending where the best trade-off is between run time and content.

Thanks, Certes (talk) 01:33, 22 March 2019 (UTC)
 * Looks good Certes, ✅ - Evad37 &#91;talk] 02:23, 22 March 2019 (UTC)

Bizarre behavior
In Portal:Earth sciences, this template is broken in a very strange way. It is supposed to select from one of the links on Portal:Earth sciences/Selected articles, but always loads Geography of Indonesia, even though that article is not one of the links (although it used to be). No amount of twiddling with parameters or page reloading makes any difference. I use exactly the same syntax in Portal:Geophysics, and it works fine there. RockMagnetist(talk) 22:56, 23 May 2019 (UTC)
 * It's actually picking List of volcanoes in Indonesia, which is the last entry on the Selected articles list. Removing that entry fixes things, though I'd prefer not to do that as it's a featured list.  The volcano list starts with an &lt;onlyinclude> section, instructing any transcluding page to hide the rest of the article.  Constructing the portal puts this wikitext onto the same page as the other selected articles, so the portal duly hides the rest of the page, including the other selected articles.  If you think that this portal stands any chance of not being killed off then I'll look into enhancing Module:Excerpt to deal with this syntax. Certes (talk) 23:17, 23 May 2019 (UTC)
 * Thank you, Certes. This portal is very likely to survive: I maintain both it and Portal:Geophysics, and the latter just survived an MfD. Indeed, some of the most active deletionists at that MfD consider Portal:Geophysics a model for how to use the new tools. Earth sciences is a broader subject and I have modified it using the same tools to get rid of one of the biggest problems with the old portals - content forking. RockMagnetist(talk) 23:41, 23 May 2019 (UTC)
 * , thanks for the report. Certes (talk) 00:10, 24 May 2019 (UTC)
 * And thank you for fixing it so quickly! RockMagnetist(talk) 15:13, 24 May 2019 (UTC)

Move discussion in progress
There is a move discussion in progress on Template talk:Transclude selected current events which affects this page. Please participate on that page and not in this talk page section. Thank you. —RMCD bot 23:03, 31 July 2019 (UTC)

Change default "Read more..." link text
You are invited to join the discussion at. —⁠andrybak (talk) 12:09, 6 November 2020 (UTC)

Why use Module:Excerpt/portals?
Hey! During some recent testing after a portal page was coming up under a tracking category due to a page being edited in a weird way, I noticed that this module explicitly used a /portal version of the Excerpt module. My question is - why? After some investigating (see this page (will break at some point, if it has, use this) ), and I noticed that the module covers less edge cases, trips up easier, and is even considered "deprecated", so I'm unsure why its still in use for these templates. Is there something this sub-module covers thats critical to these templates but not found in the main module? If so, what? If a conversion to the main module is possible, that would probably be a good move. If not, then I could potentially work on sorting any issues between them. Aidan9382 (talk) 21:19, 21 June 2022 (UTC)
 * If you can make the slideshow work with Module:Excerpt then I don't see any reason not to. As you're probably aware, the history is that Module:Excerpt was created for portals (I wrote much of the code) then extended for articles (mainly by ).  The two namespaces have conflicting requirements – for example, portals strip references but articles retain them – and it proved more practical to develop their functionality separately.  If one module can do both jobs, so much the better.  I wasn't aware that Module:Excerpt/portals was "deprecated".  Is that simply because it's used in portals which some editors would like to delete, or is there something specific about the code that needs attention? Certes (talk) 23:11, 21 June 2022 (UTC)
 * Well, I'm not particularly sure why its deprecated, but thats what it was saying within the code of Module:Excerpt/portals. I'd imagine its more akin to "out of date" than "deprecated", but I don't know. Features like stripping references are currently implemented within Module:Excerpt, so a swap may be possible, however I'm not gonna guarantee anything until I've read the entire thing and what its used for. If it is possible to convert, I probably will, but if not, it's not like /portals is falling apart, so its fine. Aidan9382 (talk) 05:02, 22 June 2022 (UTC)
 * why its deprecated, but thats what it was saying within the code of Module:Excerpt/portals – that's a question to User:Sophivorus, who've added the deprecation comment when Module:Excerpt/portals was created: Special:Permalink/975118421. It's not clear from the edit summary: Merge Module:Excerpt, Module:Excerpt/templates and Module:Excerpt/i18n. —⁠andrybak (talk) 12:09, 22 June 2022 (UTC)
 * Hi guys! Sorry for the delay, I'm kind of on holidays right now, will resume next week. @Certes I thought you'd seen the deprecation notice since I made it conspicuous, my bad. If I recall correctly, I put the notice based on this talk where you expressed that "I'm happy to treat my work as a proof of concept which I hope has provided some useful ideas for the more generic modules which can replace it." Still if you'd rather remove the notice, by all means do it! :-) @Aidan9382 Merging /portals into the main module would require adding an extra method or two to reproduce the missing behavior, for example the slideshows. If you feel like giving it a try, it would be a very valuable next step! Sorry if I can't give a more detailed or thoughtful reply right now, but as I mentioned, I'll resume properly next week, cheers! Sophivorus (talk) 00:29, 25 June 2022 (UTC)
 * To me, deprecated means "use something else instead", and we don't quite have anything else that does the job completely yet. If someone can enhance the main module to do everything that /portals does, then we can deprecate the /portals variant and perhaps even replace it by a   statement.  Until then, I think we need it.  Certes (talk) 09:59, 25 June 2022 (UTC)
 * @Certes Fair enough, I just removed the notice. @Aidan9382 Thinking a bit more about this, perhaps rather than adding methods to the main module, a better approach may be to write a new module that does what /portals does but using Module:Transcluder as much as possible. This would keep each module more modular, smaller and easier to understand, develop, maintain and update. Sophivorus (talk) 16:39, 25 June 2022 (UTC)
 * That sounds like a better idea. The /portals version does seem to contain a lot of functions used for specifically this, and the use of transcluder would probably help clear up a few of the minor problems with it just fine. I'll start taking a look, see what there is to this and what can be improved. Aidan9382 (talk) 16:49, 25 June 2022 (UTC)
 * Yes, if Module:Transcluder had existed when I worked on /portals (then called Module:Excerpt), I would certainly have used it rather than reinventing several wheels. We have extensive testcases that should give us confidence that a replacement does the job properly, and we may even fix a few bugs no one has spotted. Certes (talk) 17:48, 25 June 2022 (UTC)

Template:Transclude list item excerpts as random slideshow pulls in unwanted templates
Portal:Video games includes this markup:

Among the articles listed in Portal:Video games/Recognized content is Super Columbine Massacre RPG!. In that article, immediately following the infobox is the following markup:

Super Columbine Massacre RPG! is a role-playing video game created by Danny Ledonne and released in April 2005. The game recreates the 1999 Columbine High School shootings near Littleton, Colorado. Players assume the roles of gunmen Eric Harris and Dylan Klebold and act out the massacre, with flashbacks relating parts of Harris and Klebold's past experiences. The game begins on the day of the shootings and follows Harris and Klebold after their suicides to fictional adventures in perdition.

Ledonne had spent many years conceptualizing games, but never created one due to his lack of game design and programming knowledge. He was inspired to create a video game about Columbine by his own experience being bullied and the effect the shooting had on his life. The game represents a critique of how traditional media sensationalized the shooting (in particular the role of video games), as well as parodying video games themselves. Super Columbine Massacre was created with ASCII's game development program RPG Maker 2000 and took approximately six months to complete. Ledonne initially published the game anonymously, releasing an artist's statement about the work after his identity was revealed. Super Columbine Massacre was released for free online and attracted little attention until 2006, when widespread media coverage fueled hundreds of thousands of downloads. If the random transclusion happens to bring in Super Columbine Massacre RPG!, it includes this:

which is Multiline table in list lint error. Template:Transclude list item excerpts as random slideshow needs to recognize templates that should not be brought in, and not bring them in. —Anomalocaris (talk) 08:46, 19 December 2022 (UTC)
 * Thanks for the notice. Not too long ago I was doing related work on this module (and associated modules) to try and clear a seperate linter error (bogus image options), as well as introducing some formatting changes to help display some wikitext. Some of the discussion can be seen at Module talk:Excerpt and Module talk:Random slideshow. These linter issues have been happening for some time, though this one is new to me, so I'll look into fixing that (or finding what causes it at least). If this is a substantial issue in the meantime, or if I'm unable to find a satisfactory solution (I doubt this is a simple fix), It's probably safe to put it in the blacklist of Module:Excerpt/portals, which should fix the issue for now. Aidan9382 (talk) 09:18, 19 December 2022 (UTC)
 * 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. Aidan9382 (talk) 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. Certes (talk) 09:50, 19 December 2022 (UTC)

Handling onlyincludes
I've come back to the goal of trying to fix all the 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 (1, 2) had an  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? Aidan9382 (talk) 19:43, 23 January 2023 (UTC)


 * Module:Excerpt/portals has code to handle onlyinclude, if that helps. 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? Aidan9382 (talk) 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  in the transcluding pages. 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. Aidan9382 (talk) 21:06, 23 January 2023 (UTC)