The series box in Biotechnology was breaking the gallery syntax. Fixed by moving the it onto its own line, so the slideshow module can know to remove it. - Evad37[talk]
Multi-argument-types slideshow?
Currently, we have a slideshow template that accepts file names, and another that accepts source page names (from which it gathers all the files for the slideshow).
Is it possible to create a template that accepts both kinds of arguments?
That way, if there's a file name you want to add, you can just add it, even if the slideshow uses sourcepages.
One way to insert individual filenames into slideshows that use sourcepages, is to have a holding area for them, such as a section near the bottom of the portal. A gallery or filename list could be put in that section. Then the portal's title and that section can be specified as a sourcepage argument in the slideshow. Thus, the portal will be harvesting itself.
Self-harvesting, having the page calling the Lua module be the same page the Lua module then looks at doesn't seem like a good idea... I'm not sure how the software would handle the possible recursion could occur with a lua module finding itself on the page... particularly with modules that expand templates, since then it would be trying to expand itself, while it hasn't even finished running the first time... its just messy, and not what it was designed for, and thus more liable to be broken from changes that may be made later down the line.
@Evad37 and Certes: On retrospect, accepting filenames as unnamed parameters would probably be best, while using sourcepage1=, sourcepage2=, and so on for sourcepage parameters. That's because filenames are more likely to outnumber sourcepage names, rather than the other way around. — The Transhumanist23:16, 28 August 2018 (UTC)
Just using the unnamed/positional parameters, and have the module work out if it is a file or a page containing files, turned out to be easier - Evad37[talk]01:30, 29 August 2018 (UTC)
Something happened while I was replacing existing 'Selected image' sections that had ten or fewer images with slideshows that automatically transcluded the pics from the root article. On Portal:German Empire, this action replaced a very high quality hand-picked selection of ten pictures with customized captions (that were written for a more prominent displaying). The replacement looked like this: https://en.wikipedia.org/w/index.php?title=Portal:German_Empire&oldid=854567132
Somebody restored the original selection, and so I migrated the subpage content and converted it into the slideshow presently on the page. I think you'll agree that this is a high-quality set of pictures that supports the subject well.
The "Selected picture" subpages of the other 200 portals that received "upgrades" are still in existence. It would be a shame to lose the work that was put into gathering the pictures and writing captions for them. In many cases, the selection goes beyond the set of pictures presented on the root article. What I'd like to do is harvest the filenames and captions from those subpages and insert them as parameters into the image slideshow on the respective portal base page.
But, in order to do that, the template used for the slideshow would need to support both sourcepage names and filenames. So, please put this one at the top of your portal to do list. ;)
@Evad37: Initially, I couldn't get it to work, but then I came back here and noticed you mentioned that the "File:" prefix needs to be included. Then, it worked like a charm. See:
This might pave the way for harvesting file and caption data from subpages using AWB. But I'm not sure there is a way to insert the captionn parameters in there with AWB, due to the need of incrementing the variable n. Suggestions? — The Transhumanist03:36, 5 September 2018 (UTC)
With the necessity to number them, it makes harvesting the pics and captions from subpages using AWB infeasible, unless it has incrementing capabilities I don't know about.
Without numbered captions, many of the portals' subpages could be harvested in 4 AWB passes:
Convert portal basepage to one-page design
Substitute all the "Selected picture" subsubpages for the portal to the "Selected picture" subpage, by editing that subpage using AWB's search/replace, stripping the page down to just substitution calls
Massage the resulting filenames and captions into parameter format
Substitute the "Selected picture" subpage into the {{Transclude filenames as random slideshow}} instance, as its block of filename parameters on the portal's base page
If the captions have to be numbered, I don't know how that can be done within the above method. Doing the numbering by hand would slow this process down immensely.
I have seen many portals that use the caption and credit parameters. We could go around this problem, by writing some kind of bot that would be able to place captions etc., as a bot can do this via some kind of list that maps captions/credits to images. I don't think it is possible using AWB. Dreamy Jazz 🎷 talk to me | my contributions10:25, 5 September 2018 (UTC)
I'm not talking about getting rid of the parameters, just the numbered part of them. Or, add the ability to process unnumbered parameters while retaining the numbered capability. To do either of these things, the lua modules would have to be modified. Doing so would allow the above AWB procedure to work. — The Transhumanist11:26, 5 September 2018 (UTC)
@The Transhumanist: Done, you can now specify captions and credits in the same parameter as the filename, using ## as a separator – i.e. File:Filename.ext##Caption goes here##Credit goes here, or File:SomeOtherFile ## Some caption without a credit line. Whitespace around the ## doesn't matter, and raw equals signs have to be replaced with {{=}}. - Evad37[talk]05:14, 24 September 2018 (UTC)
I have created a template which may be useful on some portals
I'm sorry if this is the wrong place to mention this but I have created a template that displays articles as boxes with an image and a description: {{article card}}. It could be used an interesting way for portals to showcase their featured content. Please tell me if anyone thinks it would actually be usable because it does need improvement and i'd rather not waste my time creating something pointless. 🌸 WeegaweeK^ 🌸 19:58, 27 September 2018 (UTC)
@Weegaweek: Hmm, I like it. Perhaps there should be some styling options exposed as parameters. One thing I have my eye on is the enormous box-shadow, which might get annoying if several of these are used on a page. @The Transhumanist: what do you think about these? — AfroThundr (u · t · c)03:31, 28 September 2018 (UTC)
I've added a scroll bar but the problem with transcluding the lead on to it is that the nesting of links causes bugs:
having link syntax appear at the end and start of the text.
bold sans-serif text in the second half.
the text being repeated twice.
if there is any way to transclude without links please tell me as I could use it as a default for the description. 🌸 WeegaweeK^ 🌸 15:33, 28 September 2018 (UTC)
Aside: this article is an oddity in that "Howard G." is in bold but the quotation mark before "Ward" is not. This fools Module:Excerpt into thinking that "Howard G." is the subject's entire name, and it terminates the wikilink before the non-bold quotation mark. I hope that this syntax is rare enough to be not worth fixing, or to be fixed in the article by putting the entire name into a single stretch of bold text. Certes (talk) 16:05, 28 September 2018 (UTC)
Yes, the article has an <imagemap> tag, and we're not handling those well. {{Transclude lead excerpt|Morpeth, Northumberland|files=1}} also shows several images which, whilst of reasonable size individually, combine to make a huge composite. That template does render the lead properly, except that it fails to link Morpeth to Morpeth, Northumberland (because the image section is so long that the bold text is rejected for occurring too late in the lead). What do we think the excerpt should look like when we encounter an imagemap? I'm tempted to take the first image, but that would illustrate Morpeth with a signpost to somewhere else, which is hardly representative. Certes (talk) 11:29, 14 October 2018 (UTC)
Please ignore (parts of) my previous comment! On further inspection, Evad has added code which does handle imagemap well. There is just one image: File:Morpeth montage.jpg. Its format is good for a whole page but clearly not what's wanted in such a small panel.
@Evad37: Editing convertImagemap to stop appending "]]" (see Module:Excerpt/sandbox) fixes this, but I don't understand why. I think you added that code, and it looks necessary to me to match the opening brackets that are added earlier in the line. Certes (talk) 12:00, 14 October 2018 (UTC)
Removing the appended "]]" would be a bad idea, and would probably break other imagemaps. What that function does is extract the first line from within the image map (File:...), and then puts it within square brackets [[...]] – effectively making it into a normal file as far as the rest of the module is concerned. I'm not yet sure exactly what is happening here, but removing the "]]" is not the correct fix. - Evad37[talk]00:35, 17 October 2018 (UTC)
Putting {{Transclude lead excerpt | paragraphs=1-3 | files=1 | more=| Morpeth, Northumberland }} into Special:ExpandTemplates shows that the following wikitext is being generated:
[[File:Morpeth montage.jpg|alt=Morpeth montage. Clicking on an image in the picture causes the browser to load the appropriate article.]]</center>|thumb]]
'''Morpeth''' is a historic [[market town]] in [[Northumberland]], [[North East England|north-east]] England, lying on the [[River Wansbeck]]. Nearby villages include [[Mitford, Northumberland|Mitford]] and [[Pegswood]]. In the [[United Kingdom Census 2011|2011 census]], the population of Morpeth was given as 14,017, up from 13,833 in the [[United Kingdom Census 2001|2001 census]]. '''[[Morpeth, Northumberland|Read more...]]'''
So it seems the code that extracts a [[File:...]] block from a template parameter is not removing the trailing </center>, and that |thumb]] is just tacked on at the end, causing mismatched square brackets. - Evad37[talk]00:44, 17 October 2018 (UTC)
Thanks; that's a big improvement for Morpeth but it also fails to collect captions for Cat and Dubh Artach. It's not immediately obvious what unusual property those two articles share with James Talacek. You've also managed to link the bold title in the lead to the article, though that may just be a consequence of moving it to the first 100 characters by removing the caption. I'll continue investigating. Certes (talk) 12:32, 17 October 2018 (UTC)
@Evad37: I think I've fixed the bugs in the sandbox. ImageCaption=, image_size=, image_upright=, etc. were misinterpreted as introducing an image. ImageCaption appears in Dubh Artach and wasn't recognised as a caption because it looked like a second image. image_size= appears in James Talacek; again it was mistaken for image= and the caption became associated with it rather than the actual image. Similarly for image_upright= in Cat. Certes (talk) 18:45, 17 October 2018 (UTC)
Template:Transclude list item excerpts as random slideshow seems to be causing weird problems, depending on which list item is displayed initially. Effects range from the page truncating after the selected herb or spice section, to rendering in single-column only, to gobble-dee-gook showing up on the page. Here are portals I created that are having these problems:
In Portal:Herbs and spices it seems to be caused by Module:Excerpt not excluding {{nutritionalvalue}} from Caraway, which then mucks up the syntax for the gallery, and then the HTML parser tidies up the invalid markup by shoving the rest of the portal inside the excerpt gallery, at the end of the entry for Caraway.
@The Transhumanist: Fixed. One of the pages had a <gallery>...</gallery> in the lead, which was mucking up the slideshow gallery – the module now strips galleries from the excerpts to avoid this problem. - Evad37[talk]17:08, 16 August 2018 (UTC)
There was the Lua time limit was being reached, breaking everything after that point – in which case setting the limit would fix it; or
One or more of the article excerpts included markup that broke the gallery syntax (e.g. a table, another gallery, templates containing multiple lines), in which case the limit parameter just makes it less likely for that article excerpt to show up and break everything, without actually fixing the problem.
It's probably markup-related. So, I'll need to do some more tracking. Oh boy. There are over 400 new portals that need to be checked for this type of error. That's a lot of purge resets. Looks like I'll have to send for reinforcements. :) — The Transhumanist03:44, 24 August 2018 (UTC)
@Evan37 and Certes: When the limit= is removed, the portal displays a couple of problems. Either it truncates right after the Selected general articles section, or it shoves the rest of the page into a jewelry navigation footer that is included in one or more of the transcluded articles. It may also display all the entries instead of just one.
Someone has complained prominently about the result of the limit (there only being 11 articles displayed), and has claimed that this renders the scope of the portal as too narrow, even though the selection changes with each page purge. So, it is pretty urgent to get this thing displaying all 74 items correctly again. — The Transhumanist09:40, 25 September 2018 (UTC)
Fixed. The problem was that Claw (piercing) (and possibly other short articles) were including enormous templates such as navboxes from their footers. Module:Excerpt now strips such templates. I've removed |limit=10 from Portal:Body piercing. A few excerpts are not displaying correctly, especially by showing thumb instead of the image, but I don't think that's a consequence of this change. Certes (talk) 10:25, 25 September 2018 (UTC)
I'm using two vertical columns of random slideshows with the "Flex columns" template, and running into issues.
While they initially load correctly, pressing the forward or back button on either column will cause the excerpt to be loaded incorrectly. Text will be formatted incorrectly and images will be cut off after pressing forward on the slideshows.
Less of a bug than the former, but still inconvenient, is that I don't seem to have the ability to override the images selected for individual articles. As a result, while every other country biography featured at the top of this portal has the flag and arms displayed, it does not display the flag of South Ossetia. In the featured content column on the right, the page for the featured article on the SSR Abkhazia erroneously displays the former flag of Georgia because it was on a flagicon at the bottom of the infobox, but not the flag of the article's subject.
Show
States with limited recognition Current state biographies
Image 1
South Ossetia in dark green, with Georgia in dark grey
Somaliland, officially the Republic of Somaliland, is an unrecognised country in the Horn of Africa. It is located in the southern coast of the Gulf of Aden and bordered by Djibouti to the northwest, Ethiopia to the south and west, and Somalia to the east. Its claimed territory has an area of 176,120 square kilometres (68,000 sq mi), with approximately 6.2 million people as of 2024. The capital and largest city is Hargeisa.
Various Somali Muslim kingdoms were established in the area during the early Islamic period, including in the 14th to 15th centuries the Zeila-based Adal Sultanate. In the early modern period, successor states to the Adal Sultanate emerged, including the Isaaq Sultanate which was established in the middle of the 18th century. In the late 19th century, the United Kingdom signed agreements with various clans in the area, establishing the Somaliland Protectorate, which was formally granted independence by the United Kingdom as the State of Somaliland on 26 June 1960. Five days later, the State of Somaliland voluntarily united with the Trust Territory of Somalia (the former Italian Somalia) to form the Somali Republic. The union of the two states proved problematic early on, and in response to the harsh policies enacted by Somalia's Barre regime against the main clan family in Somaliland, the Isaaq, shortly after the conclusion of the disastrous Ogaden War, a 10-year war of independence concluded with the declaration of Somaliland's independence in 1991. The Government of Somaliland regards itself as the successor state to British Somaliland. (Full article...)
Image 4
Transnistria, officially known as the Pridnestrovian Moldavian Republic and locally as Pridnestrovie, is a landlocked breakaway state internationally recognized as part of Moldova. It controls most of the narrow strip of land between the Dniester river and the Moldova–Ukraine border, as well as some land on the other side of the river's bank. Its capital and largest city is Tiraspol. Transnistria is officially designated by the Republic of Moldova as the Administrative-Territorial Units of the Left Bank of the Dniester (Romanian: Unitățile Administrativ-Teritoriale din stînga Nistrului) or as Stînga Nistrului ("Left (Bank) of the Dniester").
The predominantly Armenian-populated region of Nagorno-Karabakh was claimed by both the Azerbaijan Democratic Republic and the First Republic of Armenia when both countries became independent in 1918 after the fall of the Russian Empire. A brief war over the region broke out in 1920. The dispute was largely shelved after the Soviet Union established control over the area, and created the Nagorno-Karabakh Autonomous Oblast (NKAO) within the Azerbaijan SSR in 1923. Throughout the Soviet period, Armenians in the Nagorno-Karabakh Autonomous Oblast were heavily discriminated against. The Soviet Azerbaijani authorities worked to suppress Armenian culture and identity in Nagorno-Karabakh, pressured Armenians to leave the region and encouraged Azerbaijanis to settle within it, although Armenians remained the majority population. (Full article...)
The SADR was proclaimed by the Polisario Front on 27 February 1976, in Bir Lehlou, Western Sahara. The SADR government calls the territories under its control the Liberated Territories or the Free Zone. Morocco controls and administers the rest of the disputed territory, and calls these lands its Southern Provinces. The claimed capital city of the SADR is El Aaiún (the capital of the territory of Western Sahara). Since the SADR does not control El Aaiún, it has established a temporary capital in Tifariti, although most of the day-to-day administration happens in Rabuni, one of the Sahrawi refugee camps located in Tindouf, Algeria. (Full article...)
The earliest written record referring to Palestine as a geographical region is in the Histories of Herodotus in the 5th century BCE, which calls the area Palaistine, referring to the territory previously held by Philistia, a state that existed in that area from the 12th to the 7th century BCE. The Roman Empire conquered the region and in 6 CE established the province known as Judaea, but then in 132 CE in the period of the Bar Kokhba revolt the province was expanded and renamed Syria Palaestina. In 390, during the Byzantine period, the region was split into the provinces of Palaestina Prima, Palaestina Secunda, and Palaestina Tertia. Following the Muslim conquest of the Levant in the 630s, the military district of Jund Filastin was established. While Palestine's boundaries have changed throughout history, it has generally comprised the southern portion of regions such as Syria or the Levant. (Full article...)
Before the declaration of independence, Kosovo had come under the administration of the United Nations and used the UN flag for official purposes. The Serb and Albanian populations had used their own national flags since the 1945–1992 Socialist Yugoslavia period. Ethnic Serbs used a red, blue and white tricolor, which also forms the basis of the flag of Serbia. The ethnic Albanian population have used the flag of Albania since the 1960s as their ethnic flag. Both these flags can still be seen in use within Kosovo. (Full article...)
Gaza, also called Gaza City, is a city in the Gaza Strip, Palestine. As of 2022, it was the largest city in the State of Palestine, with 590,481 inhabitants in 2017. The city is spread across an area of 45 square kilometres (17 sq mi). Gaza is one of the principal coastal cities in the country, home to Palestine's only port. Located some 76.6 kilometres (47.6 mi) southwest of the country's proclaimed capital East Jerusalem, the city is located on the coast of the Mediterranean Sea. Prior to the 2023 Israel–Hamas war, it was the most populous city in the State of Palestine, when massive displacement happened during the war.
Inhabited since at least the 15th century BC, Gaza has been dominated by different peoples and empires throughout its history. The Philistines made it a part of their pentapolis after the ancient Egyptians had ruled it for nearly 350 years. Under the Roman Empire, Gaza experienced relative peace and its Mediterranean port flourished. In 635 AD, it became the first city in the Palestine region to be conquered by the Rashidun army and quickly developed into a centre of Islamic law. However, by the time the Crusader states were established in 1099, Gaza was in ruins. In later centuries, Gaza experienced several hardships—from Mongol raids to severe flooding and locust swarms, reducing it to a village by the 16th century, when it was incorporated into the Ottoman Empire. During the first half of Ottoman rule, the Ridwan dynasty controlled Gaza and the city went through an age of great commerce and peace. The municipality of Gaza was established in 1893. (Full article...)
During its existence, the SSR Abkhazia was led by Nestor Lakoba, who served officially as the Chairman of the Council of People's Commissars but controlled the republic to such an extent that it was jokingly referred to as "Lakobistan". Due to Lakoba's close relationship with Soviet leader Joseph Stalin, collectivisation was delayed until after Abkhazia was incorporated into Georgia. Abkhazia remained a major tobacco producer in this era, growing over half of the USSR's supply. It also produced other agricultural produce, including tea, wine, and citrus fruits, leading to Abkhazia being one of the wealthiest regions in the Soviet Union. Its sub-tropical climate also made it a prime holiday destination, with Stalin and other Soviet leaders owning dachas (holiday homes) in the region and spending considerable time there. (Full article...)
Taiwanese indigenous peoples, also known as Formosans, Native Taiwanese or Austronesian Taiwanese, and formerly as Taiwanese aborigines, Takasago people or Gaoshan people, are the indigenous peoples of Taiwan, with the nationally recognized subgroups numbering about 600,303 or 3% of the island's population. This total is increased to more than 800,000 if the indigenous peoples of the plains in Taiwan are included, pending future official recognition. When including those of mixed ancestry, such a number is possibly more than a million. Academic research suggests that their ancestors have been living on Taiwan for approximately 15,000 years. A wide body of evidence suggests that the Taiwanese indigenous peoples had maintained regular trade networks with numerous regional cultures of Southeast Asia before the Han Chinese colonists began settling on the island from the 17th century, at the behest of the Dutch colonial administration and later by successive governments towards the 20th century.
(from this page it seems that pressing "Show" results in the problem I've described becoming immediately visible, whereas they initially load correctly at Portal:Limited recognition)
#1 sounds like Module talk:Excerpt slideshow#Images not rendering properly. It's hard to tell what's going wrong since it is actually working on my system (Windows 7) with various browsers (Chrome, Firefox, IE). #2 is caused by the order of images in the article wikitext. Placing the parameters containing the filenames/captions of more relevant images before of the ones with less relevant images should fix the problem. It probably wouldn't be too hard to allow custom images to be specified in {{Transclude excerpts as random slideshow}}, but the parameter names would be a little awkward, like |image7= and |caption7= for the page in the seventh unnamed parameter. - Evad37[talk]09:07, 18 September 2018 (UTC)
#1 also renders ok for me (Firefox 62 on Ubuntu). What are you browsing with? For #2, it would be possible to parse out arguments beginning File: (…|South Ossetia|File:ossetianflag.jpg|Kosovo|Gaza|…) but that hack doesn't work with captions. Certes (talk) 09:29, 18 September 2018 (UTC)
Thank you both for your feedback. I use Opera as my primary browser, but it worked as intended on Microsoft Edge. As for #2, I will try your advice, thank you. Brendon the Wizard✉️✨16:29, 23 September 2018 (UTC)
Recently The Transhumanist converted the Selected Picture to a slideshow drawing from the Illinois and Culture of Illinois pages. I would like to also include the images that had previously been selected and stored at Portal:Illinois/Selected picture. Most of those pictures have achieved some kind of recognition either here or in Commons and I would like the portal to continue to showcase them. I tried to do that using the following markup, but it does not seem to be working:
{{/box-header|Selected images|noedit=yes}}
{{Transclude files as random slideshow
| {{PAGENAME}}
| Culture of {{PAGENAME}}
| Portal:{{PAGENAME}}/Selected picture
}}
{{Box-footer}}
Is there a better way to incorporate the images from that subpage? Thanks and please excuse the ignorance. I don't know the new system at all yet. Fishal (talk) 20:53, 5 October 2018 (UTC)
@Fishal: Most likely this is because the template isn't looking for images on the transcluded subpages, or the module could be stripping them. You may want to get a second opinion from one of our resident Lua gurus though. @Evad37 and Certes:, maybe one of you can answer why? There are two options I can see to get what you want. You could substitute all the selected pictures subpages onto the main selected pictures page, or you could list all the numbered subpages directly in the template. The first option allows you to reduce the number of unnecessary subpages, and makes for a simpler syntax on the main portal page. — AfroThundr (u · t · c)05:11, 6 October 2018 (UTC)
@Fishal and AfroThundr3007730: Yeah, transcluding images from a page only works if the images are directly on that page, because the module only sees the page's wikitext. Also, because of the way the subpages are currently set up, the module would miss the captions and credits (it only looks inside [[File:...]] markups and galleries). So you can go with either of AfroThundr3007730's suggestions, and then move each caption inside the Image:/File: markup, or alternatively you can specify each files/captions/credits directly in the {{Transclude files as random slideshow}} template. - Evad37[talk]08:30, 6 October 2018 (UTC)
Fixed I've extended the |caption= parsing in Module:Excerpt to accept a template which flows over multiple lines. Such templates are later stripped out by parsecaption() so they don't actually display, but it's removed the rubbish and we could enhance parsecaption() later to display it. Certes (talk) 12:02, 9 October 2018 (UTC)
@Evad37: The "Selected area article" ends with "{{#tag:gallery|File:Blank.png|". None of the articles linked from Outline of Cairo#Areas of Cairo or its subsections have wikitext like that, so I think it's coming from Module:Excerpt slideshow (makeGalleryArgs). "File:Blank.png|" appears a lot in later panels too. Could this be the cause of the problem? A simple sandbox containing {{Transclude list item excerpts as random slideshow|1=Outline of Cairo|section= Areas of Cairo|paragraphs=1-2|files=1|fileargs=|more=|errors=}} looks perfect with no stray text.
@The Transhumanist and Certes:{{#tag:gallery|File:Blank.png|...article excerpt...}} is how the module makes the slideshow. If any of those bits are showing up, it means something from one of the article excerpts is breaking the syntax, such as loose pipes, linebreaks, or opening or closing braces. In this case, the problem seems to have been Cairo Opera House, which had a manually formatted hatnote that wasn't being removed by Module:Excerpt (prior to my edit [1]). The portal seems fine now that the article is using {{about}} for the hatnote (as far as I can see after several purges). - Evad37[talk]01:17, 9 October 2018 (UTC)
Thank you! A non-standard hatnote starting with a colon would fool Module:Excerpt into thinking it was paragraph 1 of the article, and that subsequent infoboxes etc. were within rather than before the lead. I'll see if I can improve that tomorrow. Certes (talk) 01:24, 9 October 2018 (UTC)
One idea is to find DYKs which link to articles in a category tree. So Portal:Birds could look for DYKs which link to Eagle, etc. However, that's quite a large tree, and checking it every time the portal is purged may be too strenuous for the server. Certes (talk) 00:02, 26 October 2018 (UTC)
I think it might have something to do with the ogg link in the lead of Marionberry, because nothing before the {{Audio}} template's second parameter is displayed for that entry in the portal. Then, when I removed Marionberry from the portal, the portal worked fine.
What is shown in the portal is the excerpt of the lead of Uttarakhand, rather than the Government and politics section of that article. So, you have the exact same excerpt that is in the intro also being displayed in the Selected general articles section. Aside from being very odd looking, the duplication is awkward (because it wasn't the intended selection), especially when the duplicate is the slideshow item showing when the portal is initially displayed.
In some portals, because of this quirk, the same lead that is in the intro may appear several times in the Selected general articles slideshow.
I'm not seeing that item but perhaps it's just randomly not selected today. I've changed Module:Excerpt to transclude the relevant section when going via a redirect to a section, which may solve the problem. An unrelated change concerning capturing imagemaps remains pending in the sandbox. Certes (talk) 11:34, 5 November 2018 (UTC)
This seems to have fixed it. If so, you just solved a major problem throughout the whole portal system. Well done. I'll keep you posted. — The Transhumanist09:03, 11 November 2018 (UTC)
A recent module change should prevent some portals from "splurging", by removing incomplete templates and wikilinks such as {{stack| from excerpts of pages such as Gare de Lille Europe. Some splurges are due to other causes and remain unfixed. Please report any problems. Certes (talk) 12:53, 13 November 2018 (UTC)
Fixed in Patna. Its infobox has a labyrinth of footnotes and references which contained unmatched {{. These paired with the }} which mark the end of the infobox, leaving the infobox incomplete. Certes (talk) 11:37, 14 November 2018 (UTC)
The intro has a huge series box in it, which disrupts the layout of the portal. Can the module be fixed to prevent this type of problem? — The Transhumanist23:49, 27 November 2018 (UTC)
P.S.: AmericanAir88 and Gazamp included for learning purposes. -TT
You're right; it's gone. Perhaps my viewing the page caused a purge and either picked up the new version of a module, fixing the problem permanently, or randomly selected different articles, fixing the problem temporarily; and the category took a few minutes to catch up. Thanks for checking; I'll keep an eye on it. Certes (talk) 11:55, 8 January 2019 (UTC)
While the random slideshows are highly useful and applicable to most situations, for some portals or portal sections, it would be nice to be able to control the order of display for topics in a slideshow.
Provided that the order is set manually while building the portal, a non-random slideshow will be extremely easy to implement. As long as load time is not a factor, a Lua module which arranges its input alphabetically is achievable. However, it is beyond the capabilities of a computer to "automagically" arrange list items in abstract orders . — fr+14:26, 27 October 2018 (UTC)
Section support, to specify a section of a navbox (rather than just the whole template), would be very helpful in creating portals with multiple "Selected" excerpt slideshows.
For examples of portals with multiple excerpt slideshows, see:
The main method of building portals these days is to populate the Selected general articles section from the corresponding navbox footer template.
The problem is, that not all subjects have such footers.
So, being able to build navbox footers with a user script would enable us to build portals for additional subjects. This would also serve to fill in the gaps in WP's system of navigation footers.
The tool could also be designed to easily edit existing navigation footers.
I was creating Portal:Spider-Man, and came across the List of Spider-Man enemies. I thought "what a good excerpt slideshow this could populate". But, when I looked at the list, I found that all the enemy names are locked up inside tables where our current lua modules can't get at them.
With current technology, there's no way for a template or module to find the members of a category (short of reading in 5 million pages and searching them for Category:Foo). The most promising approach may be a bot which runs regularly to maintain a category listing on a portal subpage. The portal can then either transclude the subpage directly or have a template reformat it using a Lua module. Certes (talk) 23:55, 25 October 2018 (UTC)
The User Script Barnstar
is hereby awarded to DannyS712 for writing Cat links 2.js, a script for harvesting links from categories, paving the way for this core technique to be applied in Wikipedia's navigation departments. Keep up the excellent work! Kudos._
The core technique used in the above program could be applied for inserting parameters into the template calls made on portal pages. Specifically, to inject the list of pages to be included in {{Transclude excerpts as random slideshow}}.
That's true. And, if you look at the code, you can see precisely where the asterisk is, which could easily be replaced by a pipe, along with stripping the link delimeters (not sure exactly how this would be done). Which means this technique could hypothetically be used to directly dump the list as parameters onto a portal basepage, rather than have a program 1) create a new subpage, 2) store the list on the subpage, and then 3) insert the subpage as a parameter onto the base page. That's a lot of extra program steps, and since we'll have to modify the basepage anyways, we might as well do it all on the basepage. It would be more efficient to remove the subpage steps entirely. The main question is, how will the script know when to fetch the members of a category and where to dump the list, just by looking at the page? It could look for empty Selected general articles sections using the {{Transclude excerpts as random slideshow}} template, and determine the category to fetch from from the section's title. But how? Any thoughts? — The Transhumanist00:55, 12 January 2019 (UTC)
Speaking of other pages, instead of dumping the links onto a subpage, they could be used to build a navbox footer template, which includes list items. Then the navbox could be used in turn to populate the portal's excerpt slideshow, which is the method used for the vast majority of portals these days. — The Transhumanist07:36, 12 January 2019 (UTC)
Considering how Lua-heavy portals tend to be these days, I'm not surprised. The server may take up to 10 seconds to generate the processed page from source (any longer and we'd have Lua timeout errors). The majority of the time people view one of these pages, it's a cached copy, so they don't need to wait for the server to generate a new version unless they purge the page. Have you tried taking a look at the template usage report embedded in the HTML to see how long those pages took to build? If it's close to 10 seconds, it may be a sign that the portal should be slimmed down a bit. — AfroThundr (u · t · c)01:08, 4 November 2018 (UTC)
The server time is being used up for running the various Lua modules. Keeping the current features, the only way we can cut down on the time is by using the limit parameter. The amount of time being used by a page to be loaded from scratch can be found in the collapsible 'parser profiling data' section beneath the editing area, while preveiwing a page — fr+17:31, 6 November 2018 (UTC)
@The Transhumanist: Yes it can, but we generally design our templates and modules to be economical with their execution time and resource usage, to minimize that problem. That said, there's only so much optimization that can be done to keep a growing amount of code within a certain resource budget. We're already nearing the limit of how much stuff we can cram into the standard portal without causing timeout errors, and have already reached that limit on some of the larger portals (which has been the source of many of the bug reports previously listed above). Going forward, we'll have to start carefully considering how we go about making significant changes to the automated portal format, so that we can balance new features with reader accessibility (as in client resource usage, especially on older machines). We can also keep refining and optimizing the existing design, as well; a process which will never be truly done, I imagine. — AfroThundr (u · t · c)23:02, 10 January 2019 (UTC)
@AfroThundr3007730: Then looking at how a particular feature works may provide insight on how to make it faster. So, my first question is, how does the Did you know section in portals work? (How does it look for and find entries to display?) — The Transhumanist23:09, 10 January 2019 (UTC)
While I could dig into the modules and provide you with a high-level answer (Lua is not one of the languages I'm proficient in), I'll defer to one of our resident Lua gurus. In any case, in-depth implementation discussions such as these are likely to be very long and involved, if they are to produce significant results. They may be better suited to individual module talk pages, once we find targets for improvement. Our situation is not so dire that we need to focus on that right now though, so we can take the time to review the situation at our leisure. — AfroThundr (u · t · c)23:19, 10 January 2019 (UTC)
I'm not so sure. How long do portals take to load for you? For me, they take about 10 seconds each; even more if I'm out of the house. — The Transhumanist07:48, 12 January 2019 (UTC)
The Transhumanist, the amount of time which each portal takes to generate on the server side varies with the amount of content to show and the usage of templates. For example Portal:Asia takes 9.820 seconds from start to finish to generate on the server, whereas Portal:Northumberland takes 2.487 seconds start to finish on the server. However, most of the time, the user is shown a cached version and when the cache is deemed invalid, one user has to wait a bit longer for the page to regenerate. This does not also factor in how long it takes for you and the server to communicate, but this is not something that is practical to fix on our side.
Reducing the amount of "stuff" on the portal will help. Quick ways to reduce time usage include: decreasing |months= on the DYK section and |days= on the news section. Also providing a |limit= to the slideshows will help reduce time on the slideshow templates. Dreamy Jazz 🎷 talk to me | my contributions09:09, 12 January 2019 (UTC)
@Certes, Northamerican1000, and AmericanAir88: Wow, these are great. These will be invaluable for tracking down and reporting bugs. The only other type of bug I've been running into are "truncation bugs", where the portal ends right after the Selected general articles section. Any idea on how find those? — The Transhumanist23:58, 3 November 2018 (UTC)
If you can provide a few examples of truncated portals then we can probably work out what feature they share and find a way to search for similar problems. Certes (talk) 00:07, 4 November 2018 (UTC)
Yes, we need to remove sidebars. The problem is that some other templates at the start of the lead need to be retained, and sidebars aren't easy to identify. The heuristic that anything on its own line is unwanted seems about 99% reliable but you're still seeing exceptions. I purged Portal:Communication and one of the excerpts from Template:Communication is now Portal:Philosophy. We certainly need to stop portals randomly transcluding other portals, and perhaps anything other than articles and images. Certes (talk) 01:34, 13 January 2019 (UTC)
Perhaps a bot could go around making sure sidebar templates are placed on their own line, rather than at the start or end of the lead paragraph. Identifying sidebar templates is possible but just way too expensive in Lua, whereas as a bot wouldn't have the same time restrictions. - Evad37[talk]03:20, 13 January 2019 (UTC)
Something weird has happened. Building portals with the new tools is so easy, that placing links to a new portal takes 3 times as long as creating the portal itself.
Therefore, it would be nice to have a...
Tool to automatically place the following standard links to a portal: a link on the corresponding category page, a link in the See also section of the corresponding root article, and a link at the bottom of the corresponding navigation footer template. — The Transhumanist05:07, 25 October 2018 (UTC)
Yes, best to get some backing from a wider forum before turning the bot on. In particular, my reverted attempts at linking attracted a few comments that navboxes should link only to mainspace and not to portals. Certes (talk) 12:44, 10 January 2019 (UTC)
@Dreamy Jazz: The link to a portal from the corresponding category is pretty standard, simple to do, and non-controversial. Perhaps you should make the bot for just that link type to start out with. — The Transhumanist21:15, 10 January 2019 (UTC)
@The Transhumanist: I would want to wait for the discussions on WP:Portal guidelines to close, as WP:BRFA would want the discussion closed and links from categories being "required" or "should" as well as a discussion on whether a bot should do this. Once the discussion there has wrapped up I will go for BRFA. In the mean time I will continue to write the bot, with a view to start with categories and root articles. Dreamy Jazz 🎷 talk to me | my contributions09:21, 11 January 2019 (UTC)
Automating the placing of links on the main article, main category and selected articles list
@The Transhumanist: I know you have been doing of placing {{Portal-inline}} et. al. on the main article, main category and articles in the selected articles list but what is your opinion on having a bot do this. We could automate this via petscan (new portals) and check to see if the articles are linked to the portal. If they are not the bot could add one of these templates to the see also section of the articles/categories concerned. What is your view on this. Note that the articles we link automatically is up for debate, as well as the idea for the bot. Dreamy Jazz 🎷 talk to me | my contributions22:58, 8 January 2019 (UTC)
I think a bot would be a great way to tackle that backlog, assuming it does so in a straightforward and uncontroversial manner. We want to reduce the risk of complaints of "portal spam" from other editors, but balance that with the need to improve the web of portal links. I think the suggested addition of linking requirements to the guidelines are solid and won't draw any ire if we went ahead with them. We should probably actually add them to the guidelines first though. — AfroThundr (u · t · c)23:54, 8 January 2019 (UTC)
Not exactly (the way you described my link placement). I've been placing * {{Portal-inline|size=tiny|{{subst:PAGENAME}}}} in the See also sections of the corresponding root articles. On category pages, I've been putting {{Portal|{{subst:PAGENAME}}}} at the very top of the page. And for selected articles, I insert * {{icon|Portal}} '''[[Portal:{{subst:PAGENAME}}|Portal]]''' in the <code><nowiki>below = section at the bottom of the corresponding navbox footer which in turn is usually already in place on the selected articles (and gets added to new ones as standard practice, and therefore takes care of future link placement on selecteds without further maintenance runs).
A bot would be helpful. Very helpful.
I'm working on a script to place these, but there is no reason not to have a bot as well. See User:The Transhumanist/P-link.js. The script is far from done, and so I've been using AWB to pick away at this chore, and while placing the category link is rather straight-forward, placing the other 2 links is not. A bot that could do all this would be most welcome.
Go for it!
These 3 link locations for portals have been the de facto standard for over a decade, and so there shouldn't be a problem with getting bot approval for those. — The Transhumanist00:34, 9 January 2019 (UTC)
I am not veryeven slightly expert on bots, so have a few queries:
Would the bot run be limited to a specified set of articles? (I am guessing the results of the Petscan query mentioned above)
Would the bot be able to check for existing links?
Would the bot only be run for new portals, or could it be run for all portals?
Would the bot, on finding an existing link, change it to a specified format and position, or bypass the page, assuming that the existing links are correct, necessary and sufficient?
How would the bot handle cases where editors claim that the portal links on that page should be different?
Yes. The articles to add links to would be generated by the required suggested links on WP:Portal guidelines (if implemented) for each portal. I would scan for new portals using PetScan and then periodically check portals in batches to ensure the links are still there.
Yes. Using Special:WhatLinksHere I can check if the portal is linked to by the article. Separately, I am probably going to not use this though and check directly in the wikicode, as navigation templates are fulfilling the links (I think {{Portal-inline}} or similar does). However, this is open to discussion I am going to only ignore navigational templates on the root article, as root articles nearly always have {{Portal-inline}} in the "See Also" section due to the direct relevance. For now I don't think I will place selected article links due to comments raised by Certes about how too many links would be spamming the link to the portal. Editors can add these links if they want, but I will automate adding the link to navigational templates used in the portal
Potentially all. Adding links to new portals is a definite, but I think that at least the selected article links should be checked for additions and add links added to these added articles. but also possibly having periodic checks on the 3 listed as "should" on the proposal, but the bot will respect {{nobots}} so, editors can deny the bot from editing pages when they don't want the link being placed there.
It would bypass the page, as it only is adding the link (not changing the template used etc.)
For the case of an editor reverting the bot or otherwise modifying its edits, the bot could maintain a log of every article it edited, and generate a report for any whose state has regressed, which would then be manually checked (since clearly someone didn't like the edit). The bot probably shouldn't touch an article more than once, to avoid the potential for accidental edit warring. — AfroThundr (u · t · c)23:12, 10 January 2019 (UTC)
I don't see a problem with that method, as long as everything is MOS compliant (which doesn't say much on the matter). — AfroThundr (u · t · c)13:20, 14 January 2019 (UTC)
Just to let you know that another batch of wikilinks to portals that I placed in templates such as {{Bread}} is currently being systematically reverted, in case you need to add them to a list of orphan portals. Certes (talk) 13:07, 15 January 2019 (UTC)
Certes the reason why your edits were reverted was because of WP:NAVBOX which states that external links should not be added to navboxes. If you want you could redo the run, adding back the portal links if your edit was reverted and remove the commons category if your edit was not reverted. Dreamy Jazz 🎷 talk to me | my contributions14:03, 15 January 2019 (UTC)
Thanks for checking. I know from previous discussions that some editors prefer navbox templates to link only to articles. If others think that it's a good idea to remove the link to portal whilst removing the link to commons, then I'm not going to edit war. I just wanted to mention these cases so that others can choose to reinstate the link to portal, to link the portal in some other way or leave it as an orphan. Certes (talk) 14:56, 15 January 2019 (UTC)
This project's biggest backlog right now
@Evad37, FR30799386, Dreamy Jazz, DannyS712, Dan Koehl, and Mr. Guye: In an interesting turn of fate, building new portals has become amazingly easy (for many subjects, it takes less than a minute), while placing the links to a portal is much harder (takes 5 minutes or more).
This has resulted in a huge number of orphan portals (thousands of them), creating a backlog of links that need to be placed to them (see above).
If you wish to boost the project, automating (or even semi-automating) this task will do it (such as with a user script). This is easily this project's main challenge / greatest need / highest priority. — The Transhumanist12:58, 10 January 2019 (UTC)
@The Transhumanist: I'm thinking of a bar at the bottom of the page (when viewing an article/category), like hotcat, but listing the existing links, if any, from {{portal}} (and similar templates), and with an input box to add a new portal (which you could type or paste text in, and/or look up existing portal). Like File:HotCat.png, but with portals instead of categories. If there is an existing {{portal}} template, then it would be edited; otherwise a new {{portal}} template would be added to the "See also" section, if present, or else the last section of the page (if it has sections), or else at the end of the page (but above navboxes, categories, etc). If you already know which portal you're adding to the page, the process for adding a portal becomes:
@Evad37:{{Portal|portal basepagename}} was the standard used for the old-style portals. For the new-style single-page portals, * {{Portal-inline|size=tiny|portal basepagename}} is the predominant link being used on root articles, typically as the top entry in the list in it's See also section (note the preceding bullet), and minding column formatting (that is, placing it right after the beginning column template call). Where there is no See also section, adding one is preferable (since the link is a list item entry, rather than a box off to the right). — The Transhumanist14:25, 10 January 2019 (UTC)
@Evad37: If you took this on, how long do you think it would take you to develop a HotCat-like program for placing links to portals?
I have started coding this. I'll probably need a couple more days to have a beta version ready for testing. - Evad37[talk]10:42, 28 January 2019 (UTC)
The application of "Did you know" entries in portals is a repurpose. Some entries include the note "(illustrated)", to indicate that the picture included with a particular batch was for that entry. For example...
... that Carl Edgar Myers invented an air-bicycle (illustrated) that navigated through the air like a bicycle?
Currently, those pictures are not included in portals, which renders the note erroneous.
At the moment, Module:Selected recent additions removes (pictured) when it occurs within a blurb. It would be easy to extend this to (illustrated). Including pictures would require a bit more effort, and some thought as to what to do when 2, or 3, or more items all have (pictured) or (illustrated) in the blurb, since they can come from different batches. - Evad37[talk]00:32, 4 February 2019 (UTC)
A script and/or bot to add to portals the same (subject, non-hidden) category tags that the like-named article has. Having both a bot and a script would be great.
We are way behind on the categorization of portals.
By using the article categories, we wouldn't even need to have a redundant category tree for the portal namespace. We would be able to find all the portals in the article categories, sorted by title, not namespace (they should not sorted by "P" for "Portal", but by the subject title).
The Transhumanist, what I mean by this is that I could place [[Category:(cat name)]] on the portal for each category detected on the portal (i.e. categories wrapped in <categorytree></categorytree>).
Separately my bot could add the categories from the root article onto the portal, but the point raised by Certes does put into question whether putting portals in article categories is allowed. I would be wary that, very quickly, a category could be flooded with portals (especially if it's already filled with articles which have associated portals). For example, Category:Asia could be filled up very quickly with several portals. This in a way is the desired effect, but editors may complain about categories being filled up (and so harder to navigate) and could argue that this is something that shouldn't be done. I think if we wanted to carry this out, an RfC (or similar) would be a good idea, as this isn't just affecting the portal namespace and would affect many categories. I am neutral about this and also neutral about whether a bot should carry out this task. Dreamy Jazz 🎷 talk to me | my contributions12:08, 11 February 2019 (UTC)
@Dreamy Jazz: What we are talking about here, is going to the like-named article page, copying the non-hidden category tags, and then adding them to the portal. Except the ones that are already there, of course. — The Transhumanist17:30, 10 February 2019 (UTC)
@The Transhumanist: Sorry, didn't see this until now. I'm going out of town for a week, but I should be able to do this. Just to confirm: ((Portal:name))'s main article is ((:name)), and we want to add ((:name))'s categories to ((Portal:name))? --DannyS712 (talk) 08:42, 14 February 2019 (UTC)
@The Transhumanist: Sorry, I meant the categories of the page ((:name)), that were defined as ((Category:XYZ)) rather than categories that the page is in because of templates, lua errors, etc --DannyS712 (talk) 09:29, 14 February 2019 (UTC)
This could be controversial, so I would agree with Certes's suggestion of discussing at WT:CAT, and making sure there is consensus before doing mass edits. Also, how are portals sorted in the cats? They probably should have a unique sort key, rather than being lumped in the middle of a bunch of articles. Especially if its a Portal:Foo in a Category:Foo situation. - Evad37[talk]09:19, 14 February 2019 (UTC)
Not sure if this is the right place for this discussion so feel free to move it to somewhere more appropriate. When we relaunched this project one of the ideas I had in the back of my mind was the ability to create a portal-like page dynamically from a Category, pretty much as a user preference. There is something pretty similar already over on the Commons - the Gallery Slideshow Gadget (see this example). This script essentially grabs the content of the pages within the category and displays it all as a slide show.
I think this gives a good starting point for a "virtual" portal. Obviously on Wikipedia we'd want the text to be given more prominence than the image, and there would be some other formatting bits and pieces to sort out, but most of the functionality we would want to use is there already in this gadget, which is enabled by default on the Commons.
What do others think? WaggersTALK12:12, 27 March 2019 (UTC)
tabs portals layout
How to convert a layout with "tabs" to a single page portal? P:SEX is the example case. The challenge, for a creative issue, is to convert it into a single page portal keeping the tabs. Any idea how to do it?Guilherme Burn (talk) 11:18, 6 February 2019 (UTC)
@Guilherme Burn: We don't necessarily have to reduce every portal to strictly a single page design. I think a tabbed layout looks pretty neat and works well for some portals. The method you're looking for to accomplish a tabbed layout on a single page (without additional page loading) would probably be to put each tab's content in a separate <div>...</div> and use CSS to show/hide each div as you click on the tabs. This would, however, require JavaScript to change the classes on each div (e.g. to add/remove a hidden class). The common.js on enwiki already has code to work with the mw-colllapsible and mw-collapsed classes used in tables, but I'm not sure if that could be leveraged to do what we want here. @The Transhumanist, Evad37, and Dreamy Jazz: You guys have any ideas on this one? — AfroThundr (u · t · c)01:43, 23 February 2019 (UTC)
It is possible to do it in a bit of a hacky way with templateStyles. Something like
Tab1
Tab2
Tab3
Tab1 content.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Tab2 content.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Tab3 content.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
@Guilherme Burn: What I do is simply get rid of the tabs, and include everything in sections on the one page. Though, I don't include WikiProject page content. Instead the standard section with a link to the corresponding WikiProject is fine. — The Transhumanist07:06, 23 February 2019 (UTC)
A recurring problem with the image slideshows is the display of images without captions, thus displaying pictures without context. These include icons, such as highway symbols, which shouldn't be showing up in the slideshow anyways.
Can you adjust the module to only display images that have captions?
This is an issue I’ve been noticing too. Portal restarters take note: getting the highway signs out of the selected picture section eliminates a reason for me to revert. (Also, list articles don’t belong as selected articles unless it’s a “selected list” section.) — pythoncoder (talk | contribs) 22:23, 19 March 2019 (UTC)
@Pythoncoder: Rather than revert a problem with a portal, if you brought it up on this page, it could be fixed. Then it would be fixed site-wide, not just on a single portal. Note how quickly this one was fixed. — The Transhumanist18:27, 20 March 2019 (UTC)
The problem currently afflicts 15 portals including Portal:Egypt. A module used by {{Transclude list item excerpts as random slideshow}} or similar fails to handle something in the lead of one of the articles, possibly a gallery tag. The problem will be intermittent because the article may or may not appear today depending on the random number generator. I'll see if I can narrow the problem down further. Certes (talk) 00:02, 29 November 2018 (UTC)
I think I fixed Egypt by undoing a change which broke the format of Climate of Egypt. Unfortunately, that's not a generic solution. The module packages a slideshow with dummy images and the excerpts as captions, making a gallery tag with content like
File:Blank.png|A cat is an animal.
File:Blank.png|A dog is another animal.
File:Blank.png|An elephant is a big animal.
but unfortunately several (all?) of the items end up as a single caption and get displayed together. My guess is that one of the excerpts contains an opening bracket, HTML tag or similar but not its closing partner, so the bracket/tag appears to enclose the following excerpts and their dummy image names. However, the first article displayed, List of doughnut shops, seems to have no such error. Certes (talk) 01:31, 29 November 2018 (UTC)
Thanks, I never noticed that. The problem is the image File:The Agony and the Ecstasy.JPG, which also contains DEFAULTSORT. We're not displaying it, because it's non-free, but we have to parse its text to discover that, and it has to go through the full template expansion circus because people hide the non-free status in nested templates. (I suspect that most of the CPU time for many portals is now spent checking copyright status.) This may also be the cause of the mysterious featured image stars. It looks as if we may have to cull selected templates from image descriptions, as well as from the article itself. Certes (talk) 18:50, 24 February 2019 (UTC)
@Dreamy Jazz: I've rewritten the relevant code in a way that works for Michelangelo because the image description for Agony And The Ecstasy is on the local wiki. Other descriptions are in Commons, and I don't see a way to extract them without parsing them which triggers processing of DEFAULTSORT etc. However, they don't seem to cause problems in practice. Certes (talk) 21:21, 24 February 2019 (UTC)
It's a standard splurge like we get in a few other portals. I'll see if I can work out which article's excerpt is breaking it. Certes (talk) 00:40, 25 February 2019 (UTC)
@The Transhumanist: That's an odd one. Module:Excerpt failed to handle bold text inside a piped wikilink inside an image caption. I've fixed this in the sandbox but I'd like Evad37 to confirm that the change won't break Module:Random slideshow before I release it. The incompatible bit is that moduleExcerpt.parse() will return (filetext, text) rather than (filetext..text, leadstart), which I think also helps Random slideshow by giving it less irrelevant text to discard. I'm happy with the effect on the templates that call Module:Excerpt directly and I've done a quick test on a few random-selection portals so, if Evad thinks the change looks good, I'll release it tomorrow. Certes (talk) 02:20, 25 February 2019 (UTC)
Thanks, Evad. I've released that change and it fixes the problem, which was with Typographic ligature.
That revealed another problem. Letter-spacing also broke the new version of the portal due to the wikitable within nested divs before the lead. (One div gets removed but its /div remained.) Editors who write about typography know clever ways of laying out pages that we didn't predict when writing the modules. I've fixed this too.
Portal:Michigan highways has broken links in some sections, like selected articles. Could a member of this project please fix these by reformatting the archive pages, then using your templates to randomly select from those? This is not an invitation to redesign the whole portal. I just want this small piece fixed.Please ping when replying — pythoncoder (talk | contribs) 01:21, 9 March 2019 (UTC)
@Pythoncoder: There are several ways to do random selection. Do you want it to still be on a monthly rotation (like how it is currently set up), or some other time-period, or to have all available selected content in numbered subpages, with one randomly selected each visit? - Evad37[talk]02:48, 9 March 2019 (UTC)
Or a better way, with fewer subpages, would be to just have a single subpage per section, which randomly (via Module:Random) selects from defined content, e.g. a particular {{transclude lead excerpt|...individualised params...}} template.
After a lot of varied and tedious fixes, and a few wrong turns, we're now down to two splurges which I can't solve.
Portal:Boston Red Sox: the "selected articles" section cuts off mid-flow and doesn't terminate its gallery tag. No individual article seems to misbehave in Module:Excerpt, but there may be rogue articles after the cut-off whose titles I can't see.
Portal:Egypt: intermittently, the "selected articles" section contains another nested "selected articles" section. List of universities in Egypt may be to blame but neither it nor any other article misbehaves on its own.
Maybe someone else can work out what is going on in those cases. The current splurge list, which may grow or shrink, is here. Certes (talk) 21:21, 10 January 2019 (UTC)
It's intermittent. I'm seeing Red Sox splurge again now but it does go away randomly. There are currently six articles with splurges. Perhaps we just have to accept that our software will screw up 0.1% of all portals and those cases need to work off a manual list of articles. Certes (talk) 01:39, 13 January 2019 (UTC)
I've fixed the Sox by making articles with an empty lead return an empty excerpt, which should cause the random selector to pick again. Egypt currently complains that "The time allocated for running scripts has expired.". I can try purging again at a quieter time. Certes (talk) 14:50, 10 February 2019 (UTC)
Thanks to Dreamy Jazz for the performance measuring tip. Egypt timed out due to three slow templates. (The second column is milliseconds.)
34.53% 3722.768 2 Template:Transclude_list_item_excerpts_as_random_slideshow — I added limit=25; now 2238 ms
31.97% 3446.366 1 Template:Transclude_files_as_random_slideshow — only one article; hard to see how to improve this
27.88% 3006.317 1 Template:Transclude_selected_recent_additions — I removed %s from the start of search terms; now 2250 ms
Thanks, those hints sound like the next things to try if we have further problems. I'll leave them for now though, so we can stay current with any image changes and keep a full events list (surprisingly little seems to happen in Egypt) Certes (talk) 13:36, 12 February 2019 (UTC)
Portals where the lead contains {{PH wikidata}} do not work. This technique is designed for use in infoboxes rather than in the body of the article. I suspect that it fails because the template uses the page title to retrieve information from Wikidata, and here it gets the title of the template rather than the title of the transcluded page. There are possible solutions, but they require changing wikidata templates rather than portals and the work might be wasted after the current deletion spree. For now, I suggest avoiding automatically generated portals about places in the Philippines. Certes (talk) 11:17, 21 March 2019 (UTC)
@Pppery: I was about to boldly subst those templates but there appear to be over 1000 articles with several instances each. (This search has false positives from the infobox, but not many.) It's doable but tedious with JWB; a bot request might be better. What would be a good place to gain consensus for this change? Certes (talk) 11:22, 22 March 2019 (UTC)
Thanks for your useful advice, Pppery. I've had a go at this but don't feel that it can be done safely without a bot. Using JWB to insert safesubst: seems to work but the hard part is doing this only outside the infobox: I don't see any regex that we can reliably check for. There is also the issue that someone has set up in good faith wikitext which (although deprecated) updates automatically. If we undo their hard work by hard-coding 2019 values instead then I wouldn't blame them for leaving the articles to rot. Finally, several editors are fighting enthusiastically to delete the affected pages which, whatever our views on portals, will make the problem go away. If someone else wants to pick this task up, possibly with a bot request, then I'll be happy to assist, but it's not clear to me that this exercise would improve Wikipedia sufficiently to be worth a great effort. It might also be polite to notify WP:Tambayan Philippines before proceeding. Certes (talk) 21:03, 22 March 2019 (UTC)
I've also had a few tries at dealing with the problem in Module:Excerpt, but that doesn't look easy and may not be possible. MediaWiki must be able to evaluate templates with FULLPAGENAME effectively set to a different value, as Special:ExpandTemplates does, but I don't think that functionality is exposed in frame:expandTemplate() or any other API function available to Lua. Certes (talk) 21:18, 22 March 2019 (UTC)
I am planning to extend my bot to automatically create portal talk pages using the wikiproject banners found on article pages, along with the portal project banner and {{Portal talk}}. I have opened a BRFA, but before it can be tested and potentially approved it needs more input from others.
Support, seems appropriate and helpful. It could perhaps have an opt-out/blacklist for Wikiprojects that don't want to assess portals (probably not too many, but individual projects do get to define their own scope per WP:PROJSCOPE). - Evad37[talk]12:59, 20 February 2019 (UTC)
Support - I Support, but this concept of portal maintainer... I do not like it, brings an idea of ownership and authority that does not seem very collaborative.Guilherme Burn (talk) 16:03, 22 February 2019 (UTC)
Guilherme Burn, in regards to portal maintainer, are you connecting this to the bot's functions or portal maintainers through {{Portal maintenance status}}. If you are relating this to the BRFA, I am not sure what you mean, but if you are thinking of the latter, then I'll explain what I think of them:
They act as the bridge from the project to the portal
The portal namespace is now a very rarely edited namespace, even more rarely when we only take into account non-portal project members.
Also existence of portal maintainers does not, IMO, hinder others from editing the portal, as they are only shown when CSS is added to show the template.
I do, however, understand your viewpoint. The name can suggest that one editor "owns" the portal. But, I think that this system is not pushed really at all and that the intended meaning of the word is to be a big part in the collaborative process of creating a portal. I think that it would be wrong for an editor to "claim" a portal and not let others improve the portal too. Thanks, Dreamy Jazz 🎷 talk to me | my contributions16:30, 22 February 2019 (UTC)
Support this as well. Takes a load off the usual editors, and helps de-orphan the portals (WikiProject-wise). — AfroThundr (u · t · c)01:20, 23 February 2019 (UTC)
Portals with script errors
Here are some pointers for fixing problems with specific portals.
No images found
search
The random slideshow chooses randomly from a list of zero images, and isn't very exciting.
No page specified
search
The list provided contains no usable pages. This error usually occurs in Selected general articles.
The time allocated for running scripts has expired
search
The portal needs to be less ambitious, perhaps by setting lower page count limits on its template calls.
Other errors
search – a longer list including the three specific types above and some miscellaneous errors.
Both lists currently contain several instances of "Lua error in Module:Excerpt at line 117: attempt to concatenate local 'rtitle'...". That problem has already been fixed and should disappear from search results soon.
Some errors which appear in portals occur in modules which are related to the topic area rather than to portals, and also appear in the quoted article.
No @Dreamy Jazz:. I'm suggesting a template like {{Transclude excerpts as random slideshow}}. a code like {{Transclude pupular articles slideshow | Wikipedia:WikiProject Alternative views/Popular pages | arg=views | pages=10 }} would result in a slideshow with the ten most popular articles of the project, {{Transclude pupular articles slideshow | Wikipedia:WikiProject Alternative views/Popular pages | arg=Importance | arg2=Top }} would result in a slideshow with the Top importance pages of the project.Guilherme Burn (talk) 19:11, 9 January 2019 (UTC)
Interesting idea. {{Transclude linked excerpt}} almost works out of the box here because the top articles are wikilinked from the table, but you would probably want a slideshow rather than just one random pick, and we'd need to exclude stray links to things other than the top 10. Enhancing the random pick templates to accept a "don't be random" flag would have other advantages, including making debugging easier. Certes (talk) 19:47, 9 January 2019 (UTC)
{{Transclude linked excerpts as random slideshow|Wikipedia:WikiProject Alternative views/Popular pages|section=List|random=no|limit=10}}
to produce
Image 1
Serge Monast (1945 – 5 or 6 December 1996) was a Quebecoisconspiracy theorist. He is mostly known for his promotion of the Project Blue Beam conspiracy theory, which posits a plot to facilitate a totalitarian world government by destroying Abrahamic religions and replacing them with a New Age belief system using futuristic NASA technology and involving a faked alien invasion or fake extraterrestrial encounter meant to deceive nations into uniting under a new world government. (Full article...)
Jordan Bernt Peterson (born 12 June 1962) is a Canadian psychologist, author, and media commentator. He began to receive widespread attention in the late 2010s for his views on cultural and political issues. Often characterized as conservative, Peterson has described himself as a classic British liberal and a traditionalist. (Full article...)
The dead Internet theory is an online conspiracy theory that asserts, due to a coordinated and intentional effort, the Internet since 2016 or 2017 has consisted mainly of bot activity and automatically generated content manipulated by algorithmic curation to control the population and minimize organic human activity. Proponents of the theory believe these social bots were created intentionally to help manipulate algorithms and boost search results in order to manipulate consumers. Some proponents of the theory accuse government agencies of using bots to manipulate public perception. The dead Internet theory has gained traction because many of the observed phenomena are quantifiable, such as increased bot traffic, but the literature on the subject does not support the full theory. (Full article...)
Friedrich Wilhelm Nietzsche (15 October 1844 – 25 August 1900) was a German classical scholar, philosopher, and critic of culture, who became one of the most influential of all modern thinkers. He began his career as a classical philologist before turning to philosophy. In 1869 at the age of 24, he became the youngest person to hold the Chair of Classical Philology at the University of Basel in Switzerland. In 1879 he resigned due to health problems that plagued him most of his life, after which he completed much of his core writing in the following decade. In 1889 at age 44, he suffered a collapse and afterward a complete loss of his mental faculties, with paralysis and probably vascular dementia. He lived his remaining years in the care of his mother until her death in 1897, and then with his sister Elisabeth Förster-Nietzsche. Nietzsche died in 1900, after experiencing pneumonia and multiple strokes. (Full article...)
Image 10
Roald Dahl (13 September 1916 – 23 November 1990) was a British author of popular children's literature and short stories, a poet, screenwriter and a wartime fighter ace. His books have sold more than 300 million copies worldwide. He has been called "one of the greatest storytellers for children of the 20th century". (Full article...)
The file on the lead excerpt is showing the wrong caption. It is selecting the caption from the |pushpin_map_caption= field rather than the |image_caption= field of {{Infobox settlement}} template. Keith D (talk) 01:24, 25 April 2019 (UTC)
It is now possible to display a named image, even if it does not appear in the article. Only a single image is supported, but it can vary between articles using page options, e.g. Article{{!}}files{{=}}Myimage.jpg. This feature has similar scope and documentation to page options. Certes (talk) 13:38, 12 September 2019 (UTC)
That sounds sensible. The only objection I can see is that it makes it harder to get attribution information for the image, but I think approximately 0% of readers are looking for that rather than the portal. Certes (talk) 21:47, 10 September 2019 (UTC)
@Phospheros: ...on the other hand, certain portals get away with images which link to portals by essentially hard-coding the output that these templates might have produced had they been enhanced as you suggest. The matter may be worth taking up with the attribution specialists. Certes (talk) 01:25, 13 September 2019 (UTC)
Display all selectable excerpts
It is now possible to display all excerpts from a selection simultaneously by passing a new |showall= parameter to the Transclude...excerpt templates. This feature is designed for use in subpages and produces a display more suited to editors than to readers. To display all excerpts on the subpage but only one on the main portal page, transclude the subpage as normal and add <noinclude>|showall=</noinclude> to the template. Thanks to Kusma for the idea, previously discussed here. Certes (talk) 15:40, 20 October 2019 (UTC)
Request for comment
A request for comment regarding the use of direct transclusion in portals and the newer portal transclusion templates is occurring at the Wikipedia:Village pump (policy) page, here.