Template talk:Infobox

Bug with Template:Plainlist
I've stumbled upon a buggy interaction of Template:Infobox ethnic group with Template:Plainlist in article Ainu people. There, the list after "Religion" has the list markers, despite being generated using template plainlist. In the generated HTML, somehow the tags  are missing. Only the outer wrapper and list items () are present in the HTML. This makes it so that CSS code  from Template:Plainlist/styles.css isn't triggered, because the CSS selector for the rule is.

I have reduced the reproducing sample to two test cases at Template:Infobox/testcases. Feel free to rename and/or move it as you see fit. This only happens when there is a list in label(n) and Template:Plainlist is in the next data(n+1) (or in data(n+2) if there is a header(n+1)). Compare label1 with a list vs label1 without a list. —⁠andrybak (talk) 21:49, 10 October 2023 (UTC)


 * On one hand, this might be a case of "don't do it if it hurts". On the other hand, such action at a distance between two lists is definitely some kind of bug, probably in Module:Infobox. —⁠andrybak (talk) 17:27, 11 October 2023 (UTC)
 * I'd start with "don't do it if it hurts". Putting an HTML list in a  misses the point of what a label is.
 * As a guess this probably has to do with  in some way. Either it's not covering some remixing, or it's not doing it in the right place, or it's not being called on such and sundry inputs. Izno (talk) 18:17, 11 October 2023 (UTC)
 * adding a newline between the templatestyles and the seems to fix it here? Frietjes (talk) 00:11, 12 October 2023 (UTC)

How can I use the English Wikipedia "infobox template" for another Wikipedia project (in the Incubator)?
I would like to use the infobox template to create a new particular infobox template (an ancient polis infobox template) and employ it in multiple articles for the Ancient Greek Wikipedia.

I've tried to do so; however, I encountered problems, because (apparently) the existent module could only be used in the English Wikipedia. Thus, I re-created (i.e., copy-pasted) the module in the Ancient Greek Wikipedia Incubator. Here is the copy-pasted module: https://incubator.wikimedia.org/wiki/Module:Wp/grc/Infobox

I also had to re-create many modules and templates, necessary to make the infobox template work, in particular this, since I got an error message: https://incubator.wikimedia.org/wiki/Module:Wp/grc/Infobox/styles.css

Here is the "ancient polis" infobox template, the new template I created based on the infobox module: https://incubator.wikimedia.org/wiki/Template:Wp/grc/Πινάκιον_Ἀρχαία_Πόλις

Here is an article in which I use the new template: https://incubator.wikimedia.org/wiki/Wp/grc/Ἀγύριον_(ἀρχαία_πόλις)

As you can see:

1) The style is not right (the infobox should look more or less like this: https://en.wikipedia.org/wiki/Megara );

2) Furthermore, I'm unable do add images;

3) Lastly, I'm unable to add an interactive map.

Could someone kindly help?

Thank you very much!

- Anaxicrates (talk) 14:55, 11 November 2023 (UTC)


 * @Anaxicrates 1) Since your wiki is 'new', you should copy Module:Sandbox/Izno/infobox-styles.css into incubator:Module:Wp/grc/Infobox/styles.css. 2+3) No idea what issues these are. Izno (talk) 16:50, 11 November 2023 (UTC)
 * I am very grateful to you, Izno!
 * As you can see (https://incubator.wikimedia.org/wiki/Wp/grc/Ἀγύριον_(ἀρχαία_πόλις) ), I've managed to improve the style a lot (thanks to you!) and also to include images and a location map (in this case, I just had to understand the code and re-create the location map template). However, the location map is shown inside a frame for some reason... probably because I entered it as an image. There should be a better way, but I have yet to figure it out.
 * I've some other questions: could you be so kind to give them a look?
 * 1) How could I improve my template so as to include cell background colours and grid-lines (see this example: https://it.wikipedia.org/wiki/Abacano )?
 * 2) Currently, the "location map" template recognises coordinates in this format "coordinates = 37.65624055°N 14.5259926°E". Is there a way I could make it recognise this format instead: "coordinates = 37.65624055, 14.5259926"? (I have 1000 data in this format, so that would be useful!)
 * 3) In Greek (both modern and ancient), the question mark symbol is ";". If I enter this symbol alone in an infobox cell, however, for some reason it's not properly interpreted as plain text, and the cell is shown as blank (perhaps because ; has some meaning in coding?). I had the same problem with the "-" symbol, but in that case it sufficed to use another Unicode character with identical appearance. How can I make sure that the Wikipedia editor recognises ";" (or any other character) as text and not as code?
 * Thanks again! Anaxicrates (talk) 18:14, 12 November 2023 (UTC)
 * 1) can be answered by reading the documentation here. 2) I do not know. 3) If that is the semicolon, that is indeed wikitext when used to start a line. I would suggest you ask the question on the primary Greek wiki to see what they do as it is not an issue we have. Regarding  (the hyphen), that is only wikitext when it is preceded by   and both appear at the beginning of the line. A similar comment about asking there. Izno (talk) 18:36, 12 November 2023 (UTC)
 * Thank you very much! I've solved most of the problems. Regarding question number 1, however, I've only managed to change the background colour: on the other hand, I could not make the grid lines visible as in the example I provided, nor find a guide in order to do that. This style choice seems standard for all Infoboxes in the Italian Wikipedia, while it's non-Standard in the English one. However, I cannot find where the coding is different. Do you have any clue? Anaxicrates (talk) 23:30, 13 November 2023 (UTC)

Curious about infobox colours (and other in article template colors)
While researching dark mode (and alternatives to the current invert approach), I becamecurious about the background (pardon the pun) of the background colors used on infoboxes and was only able to find the historic artifact Infobox_colours (not sure if there is a modern alternative?).

For example on Paris the infobox-subheader has a background color of #cddeff, COVID-19 has an .infobox-above with a background of #ccc. In COVID-19_pandemic_in_Hubei it is red... I am not sure what these colors mean... Generally I see infoboxes have a #f8f9fa background (e.g. Drew Barrymore)

Has anyone ever discussed replacing/reinforcing them with patterns/icons or removing those colors altogether? If they're not recommended is their a style guide with agreed recommendations on wiki?

(Side note: The Trello feature and this blog post makes very interesting reading https://wearecolorblind.com/examples/trello-colorblind-friendly-mode/ and I was curious if any of it could be applied to in article content)

who likely can give me the history lesson I need here (please do ping others!)... Jdlrobson (talk) 02:29, 18 November 2023 (UTC)


 * Any customizations made to infoboxes are totally organic, no standardization or color guidance provided or similar anywhere besides the base style (.infobox for color) and our desire for WP:COLOR adherence (contrast requirement at the minimum). I know that several areas color their infoboxes similar to their topic (sports and their teams, transportation and their routes). There are one or two colors lying around that is the same as/similar to the navbox coloration (Paris), but that's only because it used to be one of the navbox classes before those got taken out of Common.css and not any other reason that I know of. WP:MILHIST standardized their navbox and infobox colors, as did WP:COMICS for their half dozen infoboxes. I have no idea where the grey that I've seen in several places comes from (infobox character, COVID-19).
 * TheDJ might have more history but I doubt it. This is one of those places where there was teeth pulling in ancient times just to get people to use infobox so it might have been at the time "get people using the central infobox and then we can worry about standardizing colors and then never did". It might not have been too.
 * I have added support a while ago for TemplateStyles for specific infobox templates like Template:Infobox TV episode now uses to adjust the coloration, and I'd say it's in my far-future plan to get colors moved over to using those. Izno (talk) 02:38, 18 November 2023 (UTC)
 * Like Izno said, there isn't a standardization, just what infobox designers think is appropriate. Take Infobox YouTuber, Infobox Twitch streamer, Infobox TikToker or Infobox Instagram personality: their title colors match the brand colors of the social media platform. SWinxy (talk) 05:35, 18 November 2023 (UTC)
 * Thank you !! This is all very helpful! Jdlrobson (talk) 17:06, 18 November 2023 (UTC)

Move mobile styles into Module:Infobox/styles.css ?
In mobile, infoboxes collapse to full screen at lower resolution. It's been annoying me that this behaviour is not present in Vector 2022 as I've been increasingly experimenting with using this skin on mobile.

The code in question is here and is pretty well battle-tested (over 10 years in production): https://github.com/wikimedia/mediawiki-skins-MinervaNeue/blob/master/resources/skins.minerva.base.styles/content/hacks.less#L37

Would it be controversial to move these infobox related styles intoModule:Infobox/styles.css or some other on-wiki stylesheet?

Thanks in advance for your thoughts! Jdlrobson (talk) 20:09, 27 December 2023 (UTC)


 * This is blocked by our fixing infoboxes, the previous discussion of which is at MediaWiki talk:Common.css. I agree that supporting mobile directly in Module:Infobox/styles.css is a worthy end goal. (See also musings about infobox structure at User:Izno/Sandbox/Infobox, which is inhibited by the styles not being in our control.)
 * I do think hacks.less should live in MobileFrontend rather than in Minerva, since hacks are indeed hacks and MF is essentially a hack-as-extension to support mobile. This particular case (and much of hacks.less) is in the set of things I think shouldn't be controlled by a skin. Not all of it - I do see a few selectors which are appropriately in the skin. Izno (talk) 21:19, 27 December 2023 (UTC)

Accessibility and semantics for bulleted subheaders
I suggest to think how could we improve the accessibility and semantics for bulleted subheaders like this (see Alaska) which are present in many infoboxes in some varieties (e.g. bold, not bold, with different spacing). Not only is there no semantic/accessible markup here, there is no markup here at all, these are just plain.

I find it difficult to say, though, how this should be structured best. Semantically, I think, "Language" and "Time zones" on the screenshot are sections/divisions of the table with a title, so "Official languages" and "Spoken language" are like the other table headers, just inside this section. But we can't use multiple elements in MediaWiki, so I'm not aware how such sections could be isolated.

There are other complexities as well. Sometimes you have a section header that is a key in a key–value pair itself (e.g. "Government" in Infobox country, see Antigua and Barbuda: "Government: Unitary parliamentary constitutional monarchy"). There can also be "subitems" like "Summer (DST)" on the screenshot.

For key–value pairs, element is best suited (generated by   markup), so one could come up with a structure like this: that would translate into this HTML:

But then you would have difficulties to style the elements in such a way that all headers are on the left, and all values are on the right – and to make the widths of the left and right precisely match their widths in the rest of the inbofox.

That said, using semantic tags is not the only way to make an accessible layout: ARIA roles and attributes may come in handy just as well. Jack who built the house (talk) 15:24, 6 January 2024 (UTC)

Collapsibility?
Is there any way to add a parameter for making an infobox collapsible? This would be extremely helpful for some very lengthy templates that take up useful page real estate. See Template talk:Infobox nutritional value for an example of what I mean. Cheers! –Kittycataclysm (talk) 23:40, 28 April 2024 (UTC)
 * Honestly, if there's serious discussion about making a specific infobox collapsible, then it sounds to me like an infobox is the wrong approach. Help:Infobox explicitly states that infoboxes shouldn't be excessively long. I know that doesn't exactly answer your question, but I think the question shouldn't be whether the infobox should be collapsible, but whether an infobox is even the proper option in the first place. DonIago (talk) 00:53, 29 April 2024 (UTC)
 * Would agree with Doniago, but there are templates that have this kind of functionality built in, eg the medals section in infobox sportsperson. Nikkimaria (talk) 05:27, 29 April 2024 (UTC)
 * Two different issues, I think. The OP is saying we should be able to collapse the entire infobox, while you're suggesting making sections collapsible. The latter is something that should, as has been suggested, be discussed at a specific template's talk page. Making the entire infobox collapsible is probably a non-starter. Primefac (talk) 11:34, 29 April 2024 (UTC)
 * It is possible to make a collapsible infobox today. You simply shouldn't for reasons in the MOS:COLLAPSE and vaguely WP:LAYOUT directions. Izno (talk) 16:18, 29 April 2024 (UTC)
 * If you feel that an infobox is so lengthy that collapsing is desirable, you should consider cutting down the amount of information that is included. -- Red rose64 &#x1f339; (talk) 08:16, 30 April 2024 (UTC)

Thanks all for the notes! In this case, based on the linked MOS, it seems like collapsing sections in Template:Infobox nutritional value is a reasonable and viable option—I'll propose this on the talk page. Additionally, based on the above comments, it seems like this feature is already built in as a parameter in infoboxes. I may sandbox to test and/or request technical assistance. Cheers —Kittycataclysm (talk) 12:29, 30 April 2024 (UTC)

Template-protected edit request on 17 July 2024
There was a previous discussion with a similar request on the 28th of April in 2014 by. I'm also making a similar request as well.

Can someone please make the following edits to this template:

1. Can this template and (be set to) use basestyle  "à la" Navbox family..?

2. Also like the family, can class and style as alternative names for bodyclass and bodystyle be included, as well as width as an alternative to width:...;..?

Can someone please make these edits on Module:Infobox/sandbox on my behalf because I don't know how to use Lua (its Wikipedia page)? PK2 (talk; contributions) 05:41, 17 July 2024 (UTC)


 * Oppose #2. There are various class and style parameters used. There is no need to introduce easily foreseeable errors. If a template creator can't take the time to write "bodyclass" then to be honest, they really have no reason to write one. Regarding #1, I don't understand the request. Gonnym (talk) 07:11, 17 July 2024 (UTC)
 * Agreed; we don't need to introduce new alternate parameters for something that has been standard for a long time. Primefac (talk) 13:03, 17 July 2024 (UTC)
 * I am not seeing any previous discussion, so request has been disabled pending a consensus for change — Preceding unsigned comment added by MSGJ (talk • contribs) 07:38, 17 July 2024 (UTC)
 * I think I can get behind the first part of #2, where "class" and "style" alias "bodyclass" and "bodystyle", respectively; the usage of "body" makes me think that it refers to the content in the  rather than the entire  . Widths should not be set in infoboxes. Rather, the width should be based on the content (usually the image size) on each page. Plus, infoboxes on mobile (afaik) are all fixed-width.
 * Could you clarify what #1 is supposed to mean? I'm with Gonnym, I don't understand either. Do you mean you want to add a parameter for "basestyle" like in Navbox? SWinxy (talk) 12:59, 17 July 2024 (UTC)
 * Regarding body association, note that this template probably won't be a table forever, see User:Izno/Sandbox/Infobox for commentary on the point. Izno (talk) 21:37, 17 July 2024 (UTC)
 * Regarding width, that will not be supported. If you would like to modify an infobox's width, you should do so with TemplateStyles via templatestyles in the appropriate media query so that these templates can be responsive at small resolutions. At some point it will be removed from navbox also.
 * I agree with Gonnym and Primefac about the other request in #2. We do not need to support additional aliases. Izno (talk) 21:35, 17 July 2024 (UTC)

URLs in image field
It's common to find URLs in the image field which of course does not work eg. Hemal Ranasinghe. These are trivial to detect (I think?) and could generate an error so they can be tracked and removed. The URLs are sometimes in square links. Other fields are image_skyline and logo and probably others. -- Green  C  17:48, 19 July 2024 (UTC)
 * Quite a few can be found with a search. Another option would be to modify Module:InfoboxImage. -- WOSlinker (talk) 18:10, 19 July 2024 (UTC)
 * This revised search returned about 700 but regex times out. I suspect it's a lot more. I stumbled on this while looking for goo.gl links and found about 200 image links with that domain alone. -- Green  C  19:48, 19 July 2024 (UTC)
 * WOSlinker: Started a thread Module_talk:InfoboxImage. -- Green  C  20:49, 19 July 2024 (UTC)
 * Good catch, @GreenC. There are a few hundred of those when you use this search for image, and some 60 for image_skyline and another 500+ for logo. Ponor (talk) 18:27, 19 July 2024 (UTC)