Jump to content

Template talk:Infobox: Difference between revisions

Add topic
From YouTube Wiki
Latest comment: Wednesday at 12:24 by Anomie in topic Blank rows on child infoboxes....
ytwiki>Anomie
 
m 1 revision imported
 
(No difference)

Latest revision as of 16:25, 14 June 2026

Template:Permanently protected Template:Talkheader Template:WikiProject banner shell User:MiszaBot/config

Patch: make |decat=yes prevent categorization from Module:Infobox under Category:Pages using infobox templates with ignored data cells too

[edit source]

Template:Edit template-protected

If you change line #167 in Module:Infobox from <syntaxhighlight lang="wikitext"> if rowArgs.data then </syntaxhighlight>

to

<syntaxhighlight lang="wikitext"> if rowArgs.data and (args.decat ~= 'yes') then </syntaxhighlight>

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

Template:Done * Pppery * it has begun... 23:40, 12 December 2025 (UTC)Reply

image flip

[edit source]

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

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

Mystery image appearing at top of InfoBox

[edit source]

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

Template:Replyto 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 <syntaxhighlight lang=wikitext>Script error: No such module "WikidataIB".</syntaxhighlight> which for Nile emits Script error: No such module "WikidataIB".. This may be overridden by filling in the article's infobox with a valid non-blank value for |image=, or suppressed entirely using |suppressfields=image. --Redrose64 🦌 (talk) 11:00, 5 January 2026 (UTC)Reply
Thanks; excellent information. Noleander (talk) 15:30, 5 January 2026 (UTC)Reply
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)Reply

Autoheaders but off for one element

[edit source]

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?

<syntaxhighlight lang=wikitext>

| header1 =

| label2 = Broadcast area | class2 = label | data2 =

| label3 = Frequenc | data3 =

| label4 = RDS | data4 =

| label5 = Branding | data5 = </syntaxhighlight> Sammi Brie (she/her · t · c) 04:58, 17 February 2026 (UTC)Reply

Template:Replyto Have you considered setting |area=Internet in the articles concerned? --Redrose64 🌹 (talk) 14:42, 17 February 2026 (UTC)Reply
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)Reply
Why not put those two in new dataTemplate:Var 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)Reply
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)Reply
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)Reply
Another option would be to set them as the |subheader=. Primefac (talk) 08:51, 27 March 2026 (UTC)Reply

Auto implement Template:longitem

[edit source]

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:

  1. Is there any objection to adding such a feature?
  2. How technically feasible is it to achieve?

Pinging users who have done major work on this module: Template:Ping Zackmann (Talk to me/What I been doing) 17:50, 9 May 2026 (UTC)Reply

I don't see a need for something needed so irregularly in a generic template. Izno (talk) 18:47, 9 May 2026 (UTC)Reply
Template:Ping can you say more? Template:Tq? 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)Reply
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)Reply
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)Reply
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)Reply
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)Reply
@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)Reply
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)Reply
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)Reply
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)Reply
Template:Ping 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 Template:Tq. 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)Reply
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)Reply

Dark Mode

[edit source]

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

Blank rows on child infoboxes....

[edit source]

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 Template:U said in the initial post which arose because of an issue with {{Infobox social media personality}}

Template:Tqb

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

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)Reply
Template:Ping 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)Reply
Template:Ping 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)Reply
Special:Diff/1327161879/1357499550, maybe? Anomie 00:25, 3 June 2026 (UTC)Reply
And the gold star goes to Anomie!!! That definitely seems to solve the issue I was seeing. Template:Ping can you confirm? Zackmann (Talk to me/What I been doing) 00:28, 3 June 2026 (UTC)Reply
I just tried some local tests and it worked on all of the nesting combinations I could think of. Amazing work, Template:Ping thanks! This has been bugging me for so long. Prefall 01:34, 3 June 2026 (UTC)Reply
Having scrolled through the Infobox/testcases, I am not seeing any issues that this has caused. Template:Ping are you comfortable merging? Zackmann (Talk to me/What I been doing) 05:04, 3 June 2026 (UTC)Reply
This should be merged as a templatestyles adjustment with a class. Izno (talk) 06:49, 3 June 2026 (UTC)Reply
It seems Izno has ideas for doing it differently, so I'll hold off pending that proposal. Anomie 11:29, 3 June 2026 (UTC)Reply
Template:Ping can you clarify what the issue is with the way Template:U 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)Reply
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_templatestyles in 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)Reply
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)Reply
Template:Ping 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)Reply
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)Reply
I wasn't sure where the sandbox went in that title. Thank you. Template:Ping 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)Reply
You can go for it if you want. I'm a bit busy at the moment. Anomie 17:25, 7 June 2026 (UTC)Reply
After testing, this solution appears to be working. Template:Ping 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)Reply
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)Reply
Template:Done Good reminder! Thank you. Zackmann (Talk to me/What I been doing) 01:00, 8 June 2026 (UTC)Reply
Template:Ping 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)Reply
Rather than !important, it might make more sense to add a selector for body.skin--responsive.skin-minerva .infobox > tbody > tr.infobox-hiddenrow to override the problematic rule from the Minerva skin. Anomie 21:40, 9 June 2026 (UTC)Reply
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)Reply
Yeah, sorted. I am annoyed by the upstream specificity. Izno (talk) 21:51, 9 June 2026 (UTC)Reply

Template:Infobox historic site Template:Ping 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)Reply

Looks like {{Infobox NRHP}} doesn't have anything to do with it; instead, it's a use of {{Infobox designation list}} internal to {{Infobox historic site}} where no designations are provided so it produces a stylesheet but zero rows; the fix above assumed there would always be at least one row. The fix I'd recommend here is different: there are already checks in various places like <syntaxhighlight lang=lua inline>if rowArgs.data and rowArgs.data:gsub(category_in_empty_row_pattern, ):match('^%S') then</syntaxhighlight> that are detecting when the data is empty except for categories; those checks should probably be extended to also exclude TemplateStyles stylesheets. Anomie 12:24, 10 June 2026 (UTC)Reply