Template talk:Infobox

(Redirected from Template talk:Infobox/doc)

WikiProject iconInfoboxes
WikiProject iconThis template is within the scope of WikiProject Infoboxes, a collaborative effort to improve the coverage of Infoboxes on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.

Curious about infobox colours (and other in article template colors)

edit

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 Wikipedia: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)

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

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)Reply
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)Reply
Thank you !! This is all very helpful! Jdlrobson (talk) 17:06, 18 November 2023 (UTC)Reply

Move mobile styles into Module:Infobox/styles.css ?

edit

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)Reply

This is blocked by our fixing infoboxes, the previous discussion of which is at MediaWiki talk:Common.css#Infobox and TemplateStyles. 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)Reply

Accessibility and semantics for bulleted subheaders

edit

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 <tbody> 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, <dl> element is best suited (generated by ;: markup), so one could come up with a structure like this:

; East of 169°30'
: UTC−09:00
:; Summer (DST)
:: UTC−18:00

that would translate into this HTML:

<dl>
<dt>East of 169°30'</dt>
<dd>
UTC−09:00
<dl>
<dt>Summer (DST)</dt>
<dd>UTC−18:00</dd>
</dl>
</dd>
</dl>

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)Reply

Collapsibility?

edit

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#Needs to be collapsible for an example of what I mean. Cheers! –Kittycataclysm (talk) 23:40, 28 April 2024 (UTC)Reply

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)Reply
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)Reply
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)Reply
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)Reply
@Kittycataclysm: 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. --Redrose64 🌹 (talk) 08:16, 30 April 2024 (UTC)Reply

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)Reply

Template-protected edit request on 17 July 2024

edit

There was a previous discussion with a similar request on the 28th of April in 2014 by Sardanaphalus. I'm also making a similar request as well.

Can someone please make the following edits to this template:

1. Can this template and {{#invoke:Infobox|function}} (be set to) use basestyle "à la" {{Navbox}} family..?

2. Also like the {{Navbox}} family, can class and style as alternative names for bodyclass and bodystyle be included, as well as |width= as an alternative to |bodystyle=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)Reply

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)Reply
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)Reply
I am not seeing any previous discussion, so request has been disabled pending a consensus for change — Preceding unsigned comment added by MSGJ (talkcontribs) 07:38, 17 July 2024 (UTC)Reply
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 <tbody> rather than the entire <table>. 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)Reply
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)Reply
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)Reply

URLs in image field

edit

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. -- GreenC 17:48, 19 July 2024 (UTC)Reply

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)Reply
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. -- GreenC 19:48, 19 July 2024 (UTC)Reply
WOSlinker: Started a thread Module_talk:InfoboxImage#Tracking_category_for_URLs_in_image_field. -- GreenC 20:49, 19 July 2024 (UTC)Reply
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)Reply

Template-protected edit request on 22 July 2024

edit

Hi there I hope you are doing well! I would like to add an additional image from The [1]PBC Coat of Arms under the main image using the actual template. Precisely, I would like to edit as I want this page without prior demand or requirements. If you could include my tag-name in the allowed list, I would greatly appreciate it. Best regards, Sir Watson SirlupinwatsonIII (talk) 05:03, 22 July 2024 (UTC)Reply

  Not done: this is the talk page for discussing improvements to the template {{Infobox}}. Please make your request at the talk page for the article concerned. Primefac (talk) 12:24, 22 July 2024 (UTC)Reply