Module talk:Excerpt/Archive 1
![]() | This is an archive of past discussions about Module:Excerpt. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Archive 1 | Archive 2 | Archive 3 | Archive 4 |
Paragraph selection not working

I have tried using this template in Portal:Earth sciences/Selected article/2, selecting for the first two paragraphs, and it is transcluding all of them. RockMagnetist(talk) 17:08, 27 April 2018 (UTC)
- Fixed in Portal:Earth sciences/Selected article/2. The paragraph selection option is a named parameter, so the template needs paragraphs=1-2 rather then just 1-2. I'll see if I can make the documentation clearer. Certes (talk) 17:41, 27 April 2018 (UTC)
- Thanks! RockMagnetist(talk) 23:36, 27 April 2018 (UTC)
A hidden template breaker

I ran into a curious problem with Portal:Earth sciences/Selected article/8. In a previous revision of Climate of India, there was a break in the middle of the caption of the third figure, and the transclusion displayed the figure as well as a badly formatted chunk of the caption in the lead. I didn't request a figure in the template. After I fixed the caption (this revision), it worked fine. RockMagnetist(talk) 23:36, 27 April 2018 (UTC)
- Thanks for the report. File: and Image: can contain nested wikilinks and I've been a bit lazy in parsing them (which speeds the module up). I'm assuming that they take up the rest of the line, which is usually but not always the case. I should probably fix that soon, but it's good that you've patched things up for now. Certes (talk) 00:11, 28 April 2018 (UTC)
- Yes, it's not urgent but I'll let you know if there are any more issues. RockMagnetist(talk) 02:05, 28 April 2018 (UTC)
- Fixed. Certes (talk) 14:02, 28 April 2018 (UTC)
- Yes, it's not urgent but I'll let you know if there are any more issues. RockMagnetist(talk) 02:05, 28 April 2018 (UTC)
"Bad argument #1 to 'title.new' (number or string expected, got nil)"
I keep seeing the error above (clicking on it links to line 16) on some of the selections at User:Waggers/sandpit/portal selection random. (If you don't see the error at first, click "purge" to select a different article). Annoyingly the error doesn't always occur - but seems to more often than not.
It seems to be indicating that the pagename variable is not populated, yet the same page name is fed to {{more about}}, which always seems to display correctly, and the supposed lack of a pagename is not captured and handled by line 7, which looks like it's testing for pagename=nil. Am I doing something wrong? WaggersTALK 13:04, 3 May 2018 (UTC)
- Thanks for the report. Whisper it quietly, but function
lead
(for Transclude lead excerpt) and functionrandom
(for Transclude random excerpt) are identical. They pick one of their unnamed parameters at random and treat it as an article title. In this case you're passing three unnamed parameters tolead
. If your random number is 3 then these are article3, paragraphs3 and leadimages3, which evaluate to "Jane Austen", "" and "" respectively. One time in three you show part of Jane Austen; two times in three you try to show the article "" and get an error message. I can change the module solead
ignores all unnamed parameters except the first (making it differ fromrandom
), and I'll see if I can put out a more helpful error message. I should probably also makerandom
ignore blank parameters and possibly try a different random number if it hits a missing article. Certes (talk) 13:35, 3 May 2018 (UTC)
- I see, thanks. My bad - I've now named those parameters in the call to {{Transclude lead excerpt}} (they should be
|paragraphs=
and|files=
instead of unnamed. Thanks v much for the quick response. WaggersTALK 15:06, 3 May 2018 (UTC)- Module changed as above. Choosing a random excerpt from "cat" and a bunch of invalid titles now always tells you what a cat is. I've also added errors= to show conventional Lua error messages rather than a blank excerpt. Certes (talk) 16:30, 3 May 2018 (UTC)
- I see, thanks. My bad - I've now named those parameters in the call to {{Transclude lead excerpt}} (they should be
Bug fix request

I would like to request a small bug-fix if possible. The Transclude Lead Excerpt template leaves out the Template:Rp. An example below (note the superscript “:11” after “integral part of the airline's business”):
Biman Bangladesh Airlines, commonly known as Biman (/biːmɑːn/ bee-mah-n, Bengali: [ˈbimaːn]), is the national flag carrier of Bangladesh. With its main hub at Hazrat Shahjalal International Airport in Dhaka, the airline also operates flights from its secondary hubs at Shah Amanat International Airport in Chittagong and as well as Osmani International Airport in Sylhet. The airline provides international passenger and cargo services to multiple destinations and has air service agreements in 42 countries. The headquarters of the airline, Balaka Bhaban, is located in Kurmitola, in the northern part of Dhaka. Annual Hajj flights, transporting tourists, migrants, and non-resident Bangladeshi workers and the activities of its subsidiaries form an integral part of the corporate business of the airline.
Created in February 1972, Biman enjoyed an internal monopoly in the aviation industry of Bangladesh for 24 years, until 1996. In the decades following its founding, the airline expanded its fleet and destinations but it was adversely affected by corruption and mismanagement. At its peak, Biman operated flights to 29 international destinations, extending from New York City in the west to Tokyo in the east. The airline was wholly owned and managed by the government of Bangladesh until 23 July 2007, when it was transformed into the country's largest public limited company by the Caretaker Government of Bangladesh. Since becoming a public limited company in 2007, the airline has reduced staff and begun to modernize its fleet. The airline had signed a deal with Boeing to buy ten new aircraft and options for ten more in 2008. After taking delivery of the new planes, Biman expanded its destinations and added in-flight amenities such as onboard internet, WiFi, mobile telephony and live TV streams.
During his visit to Dhaka in September 2023, French President Emmanuel Macron and then Bangladesh Prime Minister Sheikh Hasina announced the order of ten Airbus A350 aircraft for Biman. The Airbus order consists of the purchase by Biman Bangladesh Airlines of two A350F cargo aircraft and eight A350 passenger aircraft. The aircraft will be delivered in stages with two passenger A350 aircraft joining the Biman fleet first. Biman Bangladesh Airlines is certified as safe to fly in Europe by the European Union Aviation Safety Agency. In addition, Biman has also successfully passed the IATA Operational Safety Audit and since then, the airline has resumed flights to some of its previous destinations in Asia and Europe. In recent times, Biman Bangladesh Airlines has seen a marked improvement in punctuality, as well as in on-time flight performance, under its new management team. (Full article...)
Regards, Arman (Talk) 09:48, 6 May 2018 (UTC)
Done in Module:Excerpt. @Armanaziz: thanks, good catch. Certes (talk) 18:50, 6 May 2018 (UTC)
Bug?

Default for parameter files
appears to be no files rather than all files as stated on the description page. · · · Peter (Southwood) (talk): 04:51, 7 May 2018 (UTC)
- I see that the description varies in different places. I will fix it to comply with reality. · · · Peter (Southwood) (talk): 04:54, 7 May 2018 (UTC)
issue
On the CKB Wikipedia nothing seems to be happening when I use the Transclude lead excerpt template. It doesn't display any text from the main article. Do you think this is because it doesn't support RTL languages or I'm doing something wrong? I used it here.--◂ épine Ⓥ 01:01, 2 May 2018 (UTC)
- I don't know! To be honest, I wrote the alpha draft of the module with English Wikipedia in mind and didn't think very hard about internationalisation at this early stage. I am quite surprised that the module has been taken up so widely and so quickly. Please can you provide links to the module and the template on CKB Wikipedia? I've not seen Sorani before and I can't actually work out how Excerpt was being used in the Evanescence portal. Arabic Wikipedia seems to be using the module ar:وحدة:Excerpt with RTL text in ar:بوابة:تشريح. Hope that helps, Certes (talk) 01:29, 2 May 2018 (UTC)
- @Certes: this is the template and this is the module. Note: @مصعب: has edited the coding today. Also please ping me for future responses.--◂ épine Ⓥ 16:55, 13 May 2018 (UTC)
- @Épine: It works on Kurdish wiki. Look here brother. I am happy to help.-مصعب (talk) 17:08, 13 May 2018 (UTC)
- @مصعب: I see, it seems I wasn't using the template quite correctly, however, in my defense, the documentation for the template is not really clear. That's understandable since it's still being worked on.--◂ épine Ⓥ 19:54, 13 May 2018 (UTC)
- @Épine: Please feel free to suggest what is unclear in the documentation, or just go ahead and improve it. But as you say, although several portals are already using the templates, this is an alpha module and is still being developed. The module was specifically aimed at a current initiative to improve English portals, but if other wikis are using the software then perhaps we should think more seriously about making it work better in other languages, including RTL text. Certes (talk) 20:46, 13 May 2018 (UTC)
- You should definitely keep the other wikis in mind. We rely on these types of modules more than you think.--◂ épine Ⓥ 21:15, 13 May 2018 (UTC)
- @Épine: Please feel free to suggest what is unclear in the documentation, or just go ahead and improve it. But as you say, although several portals are already using the templates, this is an alpha module and is still being developed. The module was specifically aimed at a current initiative to improve English portals, but if other wikis are using the software then perhaps we should think more seriously about making it work better in other languages, including RTL text. Certes (talk) 20:46, 13 May 2018 (UTC)
- @مصعب: I see, it seems I wasn't using the template quite correctly, however, in my defense, the documentation for the template is not really clear. That's understandable since it's still being worked on.--◂ épine Ⓥ 19:54, 13 May 2018 (UTC)
- @Épine: It works on Kurdish wiki. Look here brother. I am happy to help.-مصعب (talk) 17:08, 13 May 2018 (UTC)
Transclude lead excerpt not removing {{sfnm}}

The transclude lead excerpt template does not remove the {{sfnm}} template, which is a template for multiple refrences in one note. Dreamy Jazz (talk) 15:07, 20 May 2018 (UTC)
- @Dreamy Jazz: I've now attempted to fix that problem, but I can't find an example of Sfnm being used in the lead. Please can you check the page which was broken, and confirm whether it has improved? Thanks, Certes (talk) 15:28, 20 May 2018 (UTC)
- @Certes: I can no longer see them on Portal:Argentina, which is the place I noticed the problem. It seems to be fixed, thanks Dreamy Jazz (talk) 16:02, 20 May 2018 (UTC)
Possible bug with italics and bolding

I have an instance of failing to return to unitalicised text on text starting The '''SS ''Vienna''''' was built in 1873 . Text starting with "Vienna" and continuing through "was built..." until next instance of '' all in italics. Possibly misinterpreting the '''''. See below
The SS Vienna was built in 1873 during the era when steamers were built with sail rigging. She had a 19 year career marked with maritime incidents including sinking when she was just three years old. She sank for her final time in fair weather in Whitefish Bay in Lake Superior after she received a mortal blow when she was inexplicably rammed by the steamer Nipigon. Although there were no deaths when the Vienna sank for the last time, more than 100 years later her wreck claimed the lives of 4 scuba divers, the most of all the wrecks in the Whitefish Point Underwater Preserve that now protects her as part of an underwater museum. Her wreck was stripped of artifacts that resulted in the Michigan Department of Natural Resources seizing her artifacts in a raid on the Great Lakes Shipwreck Museum in 1992. Her artifacts are now on display in this museum as loan from the State of Michigan. (Full article...)
Cheers, · · · Peter (Southwood) (talk): 10:20, 22 May 2018 (UTC)
- @Pbsouthwood:
Fixed. Thanks for the report. The nested apostrophe parser now handles partially italic titles in bold, such as '''SS ''Vienna''''' and '''''Billboard'' 200'''. I've also tweaked the image parsing so that it displays the ship image in preference to the U.S. flag. Certes (talk) 12:20, 22 May 2018 (UTC)
- Thank you for fixing it. The least we can do as users is try to give you accurate bug reports. It is getting better than it was, so a net gain for the project. · · · Peter (Southwood) (talk): 12:37, 22 May 2018 (UTC)
Request to include image from infobox

Many article leads only have an image in the infobox. These would be desirable in the transcluded leads for portal selected articles if parameter files
is set. It would also be better to specify image size in the template than to transclude the size used in the article, which is often much too large for the portal frame. · · · Peter (Southwood) (talk): 04:38, 7 May 2018 (UTC)
- I agree that these are good ideas. In theory, an infobox which uses full image syntax per {{Infobox/doc#Illustration image}} should be easy to parse. In practice, each project has invented its own syntax such as {{Infobox film/doc#Image}} (which also has optional alt= and image_size= parameters). I'll have a look at it but it's probably better to leave the feature out than to implement it unreliably.
- I could add an image size (or a list of sizes for multiple images?), but would it be better simply to use the [[File:...]] syntax outside the template? If the article changes to use a different image, we may well want to change the size in the excerpt too, rather than have it automatically apply the sizing chosen for a different image. Certes (talk) 09:35, 7 May 2018 (UTC)
- Possibly my ignorance will show here, but how difficult would it be to extract just the file name and the caption, and combine them as a default size thumbnail at the top of the excerpt? · · · Peter (Southwood) (talk): 18:03, 7 May 2018 (UTC)
- It seems to be almost getting the image from the infobox at James Talacek here:
[[File:NEEMO 14 James Talacek wearing LifeShirt.jpg|Talacek inside Aquarius during the |thumb| James Raymond Talacek is an American professional aquanaut with the University of North Carolina Wilmington (UNCW). He serves as Oceanographic Field Operations Manager at Aquarius Reef Base, the world's only undersea research laboratory. Read more...
- It seems to have hit a problem with a link in the caption. · · · Peter (Southwood) (talk): 11:19, 22 May 2018 (UTC)
- Yes: it misreads the | within the piped link as ending the infobox's caption= parameter. I'll see what I can do, but a bulletproof wikitext parser would take years to write and shouldn't really go in such a specialised module. Certes (talk) 12:23, 22 May 2018 (UTC)
- Whatever you can do is appreciated. Cheers, · · · Peter (Southwood) (talk): 12:33, 22 May 2018 (UTC)
Fixed, though that bit of code is more complex than I'd have liked. I see a separate bug with his name not being wikilinked. I'll take a look at that next. Certes (talk) 14:46, 22 May 2018 (UTC)
- Name linking bug also fixed. (The long image caption made it appear that the bold text occurred too late in the article to be a synonym for its title.) Certes (talk) 14:59, 22 May 2018 (UTC)
- Yes: it misreads the | within the piped link as ending the infobox's caption= parameter. I'll see what I can do, but a bulletproof wikitext parser would take years to write and shouldn't really go in such a specialised module. Certes (talk) 12:23, 22 May 2018 (UTC)
- Possibly my ignorance will show here, but how difficult would it be to extract just the file name and the caption, and combine them as a default size thumbnail at the top of the excerpt? · · · Peter (Southwood) (talk): 18:03, 7 May 2018 (UTC)
Idea
It would be really helpful if the module could include the infobox picture in the excerpt instead of ignoring it completely.--◂ épine Ⓥ 04:14, 22 May 2018 (UTC)
- I've made some changes today which should make the picture appear more often. The problem is that there are so many ways to "hide" an image in an infobox. One example I've just added support for: {{Infobox ship image}} names its parameter
Ship image=
rather than the more commonimage=
. I can't just take anything containing the string "image", because we don't want parameters such as map_image. If you're seeing the problem on a non-English wiki then it may be an internationalisation issue (because infoboxes on that wiki name their parameters using non-English words that I didn't think of). Certes (talk) 15:09, 22 May 2018 (UTC)
FA stars transcluded?

It looks like the code for the FA star is being transcluded on Portal:Underwater diving. I checked by taking out that specific transclusion (Underwater diving), but it took a few tries, so I think it does it for all FA articles - there can be up to three in that portal. Cheers, · · · Peter (Southwood) (talk): 11:58, 23 May 2018 (UTC)
- @Pbsouthwood: Clicking the star takes me to WP:Featured pictures, so I think it may be coming from an image rather than a transcluded article excerpt.
- Most FA display their star using {{featured article}} at the top (which gets removed along with the rest of the heading tag junk) or at the bottom (which gets removed along with the non-lead text). It is possible that someone buried the tag in the middle of the lead instead, in which case it will display the star, but without knowing which article is causing a problem that's hard to verify. I've changed the module to explicitly remove that sort of template wherever it appears, just in case. Certes (talk) 12:46, 23 May 2018 (UTC)
Problem with custom templates

On a very few pages, custom templates are used that are not needed for Transclude lead excerpt (such as {{Mithun Chakraborty sidebar}} and although templates like this can be removed, we could not always prepare for all eventualities. I propose that a parameter is added that allows removal of certain templates that would be included. Dreamy Jazz (talk) 22:04, 24 May 2018 (UTC)
- @Dreamy Jazz:
Fixed. Portal:Bengali cinema/Selected biography/7 no longer transcludes the sidebar from Mithun Chakraborty. That article positions the sidebar unusually at the end of the lead. The module removes templates found before the lead, but retains templates within or at the end of the lead unless they're on a blacklist. I've now changed Module:Excerpt to blacklist sidebars. Certes (talk) 22:31, 24 May 2018 (UTC)