Template talk:Infobox
| Template:Infobox is indefinitely protected from editing as 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, 19, 20Auto-archiving period: 3 months |
| This template does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||
| ||||||||
| Related pages |
|---|
Patch: make |decat=yes prevent categorization from Module:Infobox under Category:Pages using infobox templates with ignored data cells too
[edit]This edit request has been answered. Set the |answered= parameter to no to reactivate your request. |
If you change line #167 in Module:Infobox from
if rowArgs.data then
to
if rowArgs.data and (args.decat ~= 'yes') then
then |decat=yes will also prevent categorizing because of ignored data cells.
I'd also suggest changing the module to use Module:Yesno since |decat=Yes doesn't work as intended, for example, as I discovered before adding the right parameter to the first example under Template:Infobox/doc#Examples in my local copy of the doc. Tactica (talk) 19:50, 14 October 2025 (UTC)
image flip
[edit]Is there a way to flip images in an infobox? The image flip template does not seem to work with it. ← Metallurgist (talk) 00:49, 2 December 2025 (UTC)
- I'm pretty sure that there was a discussion on this some years ago, the overwhelming consensus being that image flipping (left to right) was not to be encouraged, because it could be seen as misleading; but I can't find it now. That said, our image policies and guidelines are spread about over many pages, and it's often difficult to find even simple things - like the policy on recommended sizes is not on the same page as the policy on captions. --Redrose64 🌹 (talk) 16:48, 2 December 2025 (UTC)
Mystery image appearing at top of InfoBox
[edit]The article Nile in English Wikipedia has an infobox, and it displays the image commons:File:Cairo_skyline,_Panoramic_view,_Egypt.jpg at the top. But that image is not mentioend anywhere in the page's markup. Where is the image coming from? And how would one remove it from that InfoBox? Noleander (talk) 02:51, 5 January 2026 (UTC)
- @Noleander: By default, Template:Infobox river pulls an image from Commons based upon the information at the appropriate Wikidata page, which for Nile is d:Q3392, specifically the property d:Q3392#P18. The actual infobox code is which for Nile emits Cairo skyline, Panoramic view, Egypt.jpg. This may be overridden by filling in the article's infobox with a valid non-blank value for
{{#invoke:WikidataIB |getValue|rank=best|P18 |name=image |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|ALL}}} |onlysourced=no |noicon=yes |maxvals=1 |{{{image|}}}}}
|image=, or suppressed entirely using|suppressfields=image. --Redrose64 🦌 (talk) 11:00, 5 January 2026 (UTC)- Thanks; excellent information. Noleander (talk) 15:30, 5 January 2026 (UTC)
- Also replied at Template talk:Infobox river#How hide wikidata photo at top of the InfoBox?. Please avoid cross-posting — Martin (MSGJ · talk) 12:34, 5 January 2026 (UTC)
Autoheaders but off for one element
[edit]With {{Infobox radio station}} I am running into an increasing amount of articles (e.g. Chapman Radio) where I want to have city and country show all the time, even if none of the parameters beneath has been specified (e.g. for internet radio stations). The infobox has autoheaders turned on. How do I keep it for the other headers but make the first header always display?
| header1 = {{ubl|{{{city|}}}|{{Country name|{{{country|}}}|notfound={{{country|}}} }} }}
| label2 = Broadcast area
| class2 = label
| data2 = {{{area|}}}
| label3 = [[Frequency|Frequenc{{pluralize from text|{{if empty|{{{frequency|}}}|{{{frequencies|}}}}}|plural=ies|singular=y}}]]
| data3 = {{if empty|{{{frequency|}}}|{{{frequencies|}}}}}
| label4 = [[Radio Data System|RDS]]
| data4 = {{{rds|}}}
| label5 = Branding
| data5 = {{{branding|}}}
Sammi Brie (she/her · t · c) 04:58, 17 February 2026 (UTC)
- @Sammi Brie: Have you considered setting
|area=Internetin the articles concerned? --Redrose64 🌹 (talk) 14:42, 17 February 2026 (UTC)- That's not a one-size-fits-all solution @Redrose64. The internet really isn't an area. There are also stations on DAB I have to deal with, or that have 20 FM frequencies that don't belong in an infobox. Sammi Brie (she/her · t · c) 21:19, 17 February 2026 (UTC)
- Why not put those two in new dataN parameters and modify the header. The header doesn't really describe all things in that section. That seems like the simplest and most correct fix. Gonnym (talk) 13:06, 18 February 2026 (UTC)
- I agree with Gonnym. You can move the city/country into data1, perhaps with "Location" as label1. Then in header2 you can give a header for Broadcast area, Frequency and RDS. Have a look what I've done in Template:Infobox radio station/sandbox — Martin (MSGJ · talk) 15:02, 18 February 2026 (UTC)
- Hmmmmm... That's not a bad idea. I'm thinking about ways that this could be done without changing the formatting. There's no good header for the stuff right under there because it's often fundamentally basic information (that can't be buried in one of the header bins below). Linking your revision because I think I want to do some of my own trial-and-error. Sammi Brie (she/her · t · c) 05:12, 21 February 2026 (UTC)
- Another option would be to set them as the
|subheader=. Primefac (talk) 08:51, 27 March 2026 (UTC)
- Another option would be to set them as the
- Hmmmmm... That's not a bad idea. I'm thinking about ways that this could be done without changing the formatting. There's no good header for the stuff right under there because it's often fundamentally basic information (that can't be buried in one of the header bins below). Linking your revision because I think I want to do some of my own trial-and-error. Sammi Brie (she/her · t · c) 05:12, 21 February 2026 (UTC)
- That's not a one-size-fits-all solution @Redrose64. The internet really isn't an area. There are also stations on DAB I have to deal with, or that have 20 FM frequencies that don't belong in an infobox. Sammi Brie (she/her · t · c) 21:19, 17 February 2026 (UTC)
Auto implement Template:longitem
[edit]I have recently been adding {{longitem}} to numerous Infoboxes (example) to better wrap long items in labels. It has occurred to me, shouldn't this be automatic? Is there any situation where you would not want better wrap labels that take up 2 lines? It would seem to me that it would be a much better solution to automatically do this at the level of {{Infobox}}/Module:Infobox rather then having to individually wrap any infobox label that has the potential to wrap to a second line.
If there is an objection to automatically implementing this on every infobox, could we implement it but hide it behind a flag like |auto_longitem= (to mimic the way |autoheaders= is used)?
Boils down to 2 questions:
- Is there any objection to adding such a feature?
- How technically feasible is it to achieve?
Pinging users who have done major work on this module: @Izno, Fayenatic london, Pppery, Plastikspork, Frietjes, Gonnym, and Primefac: Zackmann (Talk to me/What I been doing) 17:50, 9 May 2026 (UTC)
- I don't see a need for something needed so irregularly in a generic template. Izno (talk) 18:47, 9 May 2026 (UTC)
- @Izno: can you say more?
Needed so irregularly
? It seems to be used quite a lot so not sure I understand your meaning? Zackmann (Talk to me/What I been doing) 18:58, 9 May 2026 (UTC)- You've added it to a dozen templates in the past month and a half but only to a handful of parameters each. It doesn't need to be supported at that level of use. Izno (talk) 19:03, 9 May 2026 (UTC)
- I guess my point is rather than having to add it one by one, wouldn't it be easier to just have it automatically implemented? I'm genuinely asking as I don't have enough of an understanding of the Module to know, is there a downside to automatically wrapping long labels with less padding that would make this a bad idea to do? I agree I've only added it to a few templates recently, but wouldn't it be better to not have to search for these cases and manually add it and instead have it automatically done. What am I missing? Zackmann (Talk to me/What I been doing) 21:06, 9 May 2026 (UTC)
- So I was able to pretty quickly and easily achieve this with this edit to Module:Infobox/styles.css. Please someone let me know (or simply revert it) if there is any issue with this that I am overlooking. Zackmann (Talk to me/What I been doing) 23:06, 9 May 2026 (UTC)
- Ugh so it caused an issue with Template:Infobox soap character. Open to ideas... Zackmann (Talk to me/What I been doing) 02:25, 10 May 2026 (UTC)
- @Zackmann08 Never ever make test edits to a module so widely transcluded. Please don't do that again. Izno (talk) 15:53, 10 May 2026 (UTC)
- To be fair, I tested the edits repeatedly... My edit summary doesn't accurately portray that and I will be sure to better summarize in the future. This was quite extensively tested. An unforeseen very minor issue cropped up and I immediately reverted my edit, but this was a minor style issue. It is not like I blanked data or broke templates. Your warning is noted, but I feel overly dramatic. Zackmann (Talk to me/What I been doing) 15:56, 10 May 2026 (UTC)
- I could have told you, if that was what you intended to implement, that it would cause issues. It is not a minor issue. I could have told you that your change would break how the template works if you had proposed the actual change on the talk page using a sandbox (and would probably also affect mobile poorly, based on the specific change). Do better.
- An immediate revert is insufficient; you're still dropping 3 million pages into the job queue. Izno (talk) 16:00, 10 May 2026 (UTC)
- Making that change is also incompatible with where the template will eventually go (see User:Izno/Sandbox/Infobox).
- If you want to handle long items, you will need to continue implementing them ad hoc. Izno (talk) 16:01, 10 May 2026 (UTC)
- @Izno: that is duly noted. I felt I tried to solicit your input and you were pretty dismissive of the idea as a whole. In the future I will be more careful and I do apologize. I admit I completely neglected to realize that I was
dropping 3 million pages into the job queue
. Clearly I still have lots to learn. Rest assured I hear you loud and clear and I will do better moving forward. I had planned to continue with this idea at Module:Infobox/styles.css/sandbox and to request a review and leave it to someone else to actually implement in the live version of the code. Based on the wholly negative reaction I guess it is best to just walk away and focus on other projects. Zackmann (Talk to me/What I been doing) 16:06, 10 May 2026 (UTC)
- @Izno: that is duly noted. I felt I tried to solicit your input and you were pretty dismissive of the idea as a whole. In the future I will be more careful and I do apologize. I admit I completely neglected to realize that I was
- To be fair, I tested the edits repeatedly... My edit summary doesn't accurately portray that and I will be sure to better summarize in the future. This was quite extensively tested. An unforeseen very minor issue cropped up and I immediately reverted my edit, but this was a minor style issue. It is not like I blanked data or broke templates. Your warning is noted, but I feel overly dramatic. Zackmann (Talk to me/What I been doing) 15:56, 10 May 2026 (UTC)
- So I was able to pretty quickly and easily achieve this with this edit to Module:Infobox/styles.css. Please someone let me know (or simply revert it) if there is any issue with this that I am overlooking. Zackmann (Talk to me/What I been doing) 23:06, 9 May 2026 (UTC)
- I guess my point is rather than having to add it one by one, wouldn't it be easier to just have it automatically implemented? I'm genuinely asking as I don't have enough of an understanding of the Module to know, is there a downside to automatically wrapping long labels with less padding that would make this a bad idea to do? I agree I've only added it to a few templates recently, but wouldn't it be better to not have to search for these cases and manually add it and instead have it automatically done. What am I missing? Zackmann (Talk to me/What I been doing) 21:06, 9 May 2026 (UTC)
- You've added it to a dozen templates in the past month and a half but only to a handful of parameters each. It doesn't need to be supported at that level of use. Izno (talk) 19:03, 9 May 2026 (UTC)
- @Izno: can you say more?
- Thanks for the ping, but this is beyond my skill set. I merely updated some category names. – Fayenatic London 14:34, 10 May 2026 (UTC)
Dark Mode
[edit]I'm confused. Why exactly is Infobox styling completely hidden in dark mode while other CSS isn't? --DollarStoreBa'alConverse 22:44, 9 May 2026 (UTC)
Blank rows on child infoboxes....
[edit]There was previously a discussion here about blank rows on child infoboxes. Looks like the thread went stale and was never addressed. To recap and restate what Prefall said in the initial post which arose because of an issue with {{Infobox social media personality}}
the blank rows are related to embedding using
|child=yes. Almost all of the testcases have a blank line or two, on both desktop and mobile, with this markup:<tr><td colspan="2" class="infobox-full-data"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1316064257"></td></tr>One blank line is always created at the beginning of this wrapper template (in-between {{Infobox person}}'s rows and the custom rows for this infobox), and a second is created when embedding this template into another. Both are direct results of
|child=yes, which creates a blank row where|title=would be listed. It simply does not suppress this row if the title is left blank. The blank row does NOT occur if you embed using|subbox=yesinstead. This issue is actually already mentioned at Template:Infobox#Embedding. A workaround/solution is listed but it would have to be applied everywhere that|child=yesis used. This is something that should be fixed directly at Module:Infobox instead.
I am seeing this in many, many places and wondering if someone with more experience that I can help trace this down. --Zackmann (Talk to me/What I been doing) 23:23, 1 June 2026 (UTC)
- I have added a very simplistic testcase here to show the issue. Zackmann (Talk to me/What I been doing) 23:38, 1 June 2026 (UTC)
- @Izno: is this something you can provide any guidance on? I'm certainly not going to push any changes live without a review but after my experience above I'm a bit wary here... Zackmann (Talk to me/What I been doing) 03:55, 2 June 2026 (UTC)
- @Frietjes: any ideas here? Even a nudge in the right direction would be appreciated... Spent some time playing with it but got nowhere. Zackmann (Talk to me/What I been doing) 23:31, 2 June 2026 (UTC)
- Special:Diff/1327161879/1357499550, maybe? Anomie⚔ 00:25, 3 June 2026 (UTC)
- And the gold star goes to Anomie!!! That definitely seems to solve the issue I was seeing. @Prefall: can you confirm? Zackmann (Talk to me/What I been doing) 00:28, 3 June 2026 (UTC)
- I just tried some local tests and it worked on all of the nesting combinations I could think of. Amazing work, @Anomie: thanks! This has been bugging me for so long. Prefall 01:34, 3 June 2026 (UTC)
- Having scrolled through the Infobox/testcases, I am not seeing any issues that this has caused. @Anomie: are you comfortable merging? Zackmann (Talk to me/What I been doing) 05:04, 3 June 2026 (UTC)
- This should be merged as a templatestyles adjustment with a class. Izno (talk) 06:49, 3 June 2026 (UTC)
- It seems Izno has ideas for doing it differently, so I'll hold off pending that proposal. Anomie⚔ 11:29, 3 June 2026 (UTC)
- @Izno: can you clarify what the issue is with the way Anomie has solved this long standing issue or implement your proposed solution? Zackmann (Talk to me/What I been doing) 17:54, 3 June 2026 (UTC)
- It's just a minor change [1], with the appropriate add in the styles sheet.
- Beginning to wonder whether the right approach should be to move TemplateStyles totally outside the infobox instead of the shiftery that goes on at Module:Infobox#L-61. See e.g.
hiding_templatestylesin Module:Navbox for something similar. - As I said earlier this should be a non-issue at some point in the future, right now it's all happening because we're hacking around the infobox being a table. Izno (talk) 20:46, 3 June 2026 (UTC)
- Awesome thanks for making this happen. Hopefully this does become a non-issue in the future! Zackmann (Talk to me/What I been doing) 20:59, 3 June 2026 (UTC)
- @Izno: is it safe to add the appropriate code to Module:Infobox/styles.css or should I create Module:Infobox/styles.css/sandbox to properly test this? Zackmann (Talk to me/What I been doing) 05:27, 7 June 2026 (UTC)
- Module:Infobox/sandbox/styles.css is where it would exist if you wanted to check it for yourself. I just assumed that Anomie would revisit. :^) Izno (talk) 05:42, 7 June 2026 (UTC)
- I wasn't sure where the sandbox went in that title. Thank you. @Anomie: do you want to implement this new solution or shall I? Zackmann (Talk to me/What I been doing) 16:15, 7 June 2026 (UTC)
- You can go for it if you want. I'm a bit busy at the moment. Anomie⚔ 17:25, 7 June 2026 (UTC)
- After testing, this solution appears to be working. @Izno: can you you please review Module:Infobox/sandbox/styles.css and Module:Infobox/sandbox and confirm you aren't seeing something I'm missing? Having checked all the test cases, I see nothing broken and the identified issue resolved. Zackmann (Talk to me/What I been doing) 18:15, 7 June 2026 (UTC)
- If you want to, go for it. Just make sure to target the right styles page from the main module when you copy it over. Izno (talk) 22:28, 7 June 2026 (UTC)
Done Good reminder! Thank you. Zackmann (Talk to me/What I been doing) 01:00, 8 June 2026 (UTC)
- If you want to, go for it. Just make sure to target the right styles page from the main module when you copy it over. Izno (talk) 22:28, 7 June 2026 (UTC)
- After testing, this solution appears to be working. @Izno: can you you please review Module:Infobox/sandbox/styles.css and Module:Infobox/sandbox and confirm you aren't seeing something I'm missing? Having checked all the test cases, I see nothing broken and the identified issue resolved. Zackmann (Talk to me/What I been doing) 18:15, 7 June 2026 (UTC)
- You can go for it if you want. I'm a bit busy at the moment. Anomie⚔ 17:25, 7 June 2026 (UTC)
- I wasn't sure where the sandbox went in that title. Thank you. @Anomie: do you want to implement this new solution or shall I? Zackmann (Talk to me/What I been doing) 16:15, 7 June 2026 (UTC)
- Module:Infobox/sandbox/styles.css is where it would exist if you wanted to check it for yourself. I just assumed that Anomie would revisit. :^) Izno (talk) 05:42, 7 June 2026 (UTC)
- @Izno: is it safe to add the appropriate code to Module:Infobox/styles.css or should I create Module:Infobox/styles.css/sandbox to properly test this? Zackmann (Talk to me/What I been doing) 05:27, 7 June 2026 (UTC)
- Awesome thanks for making this happen. Hopefully this does become a non-issue in the future! Zackmann (Talk to me/What I been doing) 20:59, 3 June 2026 (UTC)
- @Zackmann08: I noticed this fix has now been deployed across infoboxes, and it's working on desktop view, but not on mobile view. I specifically tested mobile view when I left my previous comment, and it was working then. The class with "display: none" seems to be getting overwritten on mobile by another CSS rule with "display: flex". Not sure if this is the best way to solve this, but adding "!important" to the hidden class worked for me locally. Prefall 20:11, 9 June 2026 (UTC)
- Rather than
!important, it might make more sense to add a selector forbody.skin--responsive.skin-minerva .infobox > tbody > tr.infobox-hiddenrowto override the problematic rule from the Minerva skin. Anomie⚔ 21:40, 9 June 2026 (UTC)- Knowing very little about the different skins or the differences in views between mobile and desktop, I'm going to abstain here... Happy to help if I can but this is a bit over my head. Zackmann (Talk to me/What I been doing) 21:42, 9 June 2026 (UTC)
- Yeah, sorted. I am annoyed by the upstream specificity. Izno (talk) 21:51, 9 June 2026 (UTC)
- Rather than
- Having scrolled through the Infobox/testcases, I am not seeing any issues that this has caused. @Anomie: are you comfortable merging? Zackmann (Talk to me/What I been doing) 05:04, 3 June 2026 (UTC)
- I just tried some local tests and it worked on all of the nesting combinations I could think of. Amazing work, @Anomie: thanks! This has been bugging me for so long. Prefall 01:34, 3 June 2026 (UTC)
- And the gold star goes to Anomie!!! That definitely seems to solve the issue I was seeing. @Prefall: can you confirm? Zackmann (Talk to me/What I been doing) 00:28, 3 June 2026 (UTC)
- Special:Diff/1327161879/1357499550, maybe? Anomie⚔ 00:25, 3 June 2026 (UTC)
| Infobox historic site | |
|---|---|
| Site notes | |
Architectural style | architecture |
Infobox NRHP | |
@Anomie: and all, I'm also still seeing an issue here on desktop actually... Found on Jere Shine site by reproduced at right. Hust about the call to {{Infobox NRHP}} there is still an extra row being shown. --Zackmann (Talk to me/What I been doing) 00:49, 10 June 2026 (UTC)