Template talk:Infobox
![]() | Template:Infobox is permanently protected from editing because it is a heavily used or highly visible template. Substantial changes should first be proposed and discussed here on this page. If the proposal is uncontroversial or has been discussed and is supported by consensus, editors may use {{edit template-protected}} to notify an administrator or template editor to make the requested edit. Usually, any contributor may edit the template's documentation to add usage notes or categories.
Any contributor may edit the template's sandbox. Functionality of the template can be checked using test cases. |
This is the talk page for discussing improvements to the Infobox template. |
|
Archives: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19Auto-archiving period: 90 days ![]() |
![]() | This template does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | |||||||
|
![]() | Text has been copied to or from this page; see the list below. The source pages now serve to provide attribution for the content in the destination pages and must not be deleted as long as the copies exist. For attribution and to access older versions of the copied text, please see the history links below.
|
Related pages |
---|
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)
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)
- 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)
- 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)
- 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)
- @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)
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
[edit]![]() | This edit request to Module:Infobox has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
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)
- 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
<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)
- 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
[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)
- 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. -- GreenC 19:48, 19 July 2024 (UTC)
- WOSlinker: Started a thread Module_talk:InfoboxImage#Tracking_category_for_URLs_in_image_field. -- GreenC 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)
Template-protected edit request on 22 July 2024
[edit]![]() | This edit request to Module:Infobox has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
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)
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)
Logos and dark mode
[edit]Is it possible to set a white (or an offwhite) background colour fill by default for logos in dark mode? Logo images with transparent background may not work well with dark mode, i.e. Taiwan Power Company. – robertsky (talk) 18:36, 25 August 2024 (UTC)
- Maybe it's just my computer, but I see the image in question inside of a white box (though when I go directly to the file page itself, it shows a transparent background). Primefac (talk) 20:24, 25 August 2024 (UTC)
- That's what I see too. I agree the black background does not make it easy to see the logo — Martin (MSGJ · talk) 20:36, 25 August 2024 (UTC)
- Which do you see? A black background in the infobox, or a white background in the infobox? Just noting that both options have been indicated above. Primefac (talk) 20:48, 25 August 2024 (UTC)
- I see the white background in the infobox and the transparent background on the file itself, which I interpreted to be the same as you — Martin (MSGJ · talk) 20:50, 25 August 2024 (UTC)
- Which do you see? A black background in the infobox, or a white background in the infobox? Just noting that both options have been indicated above. Primefac (talk) 20:48, 25 August 2024 (UTC)
- That's what I see too. I agree the black background does not make it easy to see the logo — Martin (MSGJ · talk) 20:36, 25 August 2024 (UTC)
- It cannot be done from the core styles today. (That might be possible later, I haven't decided. Feedback somewhere between fine and welcome.)
- You will need to provide an appropriate class to the image row to indicate it holds an icon, and then you will need to add TemplateStyles to the infobox to make the image background always the light background. In order:
- Add a class to the row. In infobox company's case, there is already a
logo
class, but I do not know from what this stems, so I will add toib-company-logo
- Add
|templatestyles=Infobox company/styles.css
- Create Template:Infobox company/styles.css with the CSS
.ib-company-logo img { background-color: #f8f9fa; }
- Save all the pages + protection for the TemplateStyles page.
- Add a class to the row. In infobox company's case, there is already a
- IDK about MSGJ and Primefac. The relevant dark mode here is the WMF standard dark mode, which only now post-my-edit displays the image with a light background. Izno (talk) 20:58, 25 August 2024 (UTC)
- @Izno thanks! yeah... I should have had specified that it is the WMF standard dark mode. Thanks to @MSGJ and @Primefac for responding as well. – robertsky (talk) 02:35, 26 August 2024 (UTC)
- While Infobox company is updated, the other Infoboxes will have to be updated as well, i.e. {{Infobox Indian political party}}. See Dravida Munnetra Kazhagam for example. I guess I will hunker down and see what other Infoboxes have to be updated or adjusted. (i.e {{Infobox baseball league division series}} may have to be updated to have the logo parameter to account for the use of logos in the image parameter, i.e. 2003 American League Division Series or 2002 National League Division Series. – robertsky (talk) 06:31, 26 August 2024 (UTC)