Template talk:Infobox/Archive 19

Infobox accessibility for screen readers
Recently, I've been looking into how well our articles are accessible by screen-reader software such as Voiceover on a mac (command-F5), and for infoboxes it's a little wonky. If you've never used screen-reader software, the idea is that since users can't visually scan to jump to a type of content, the software will list out the elements of a given type that are present, such as tables or links. The Infobox, being a table, is the first one of that type to be listed - but the listing is generally useless and unhelpful.

The docs for Infobox say that "title" and "above" are roughly equivalent, though it notes that "the most recommended alternative" is title. And so, for articles with infobox types that do that, like Lego (Infobox toy), the screen reader software tells you that the first table in the page is named... "Lego". No context for what that means. Many infobox types, however, don't use title- so for those, like Final Fantasy X (Infobox video game), you get... nothing. You just get told that the first table has "2 columns, 16 rows", with absolutely zero context whatsoever.

So, we could of course find the variants that don't use title and fix that, but honestly a table named "Lego" on an article named "Lego" tells me nothing about what's in it, so if I didn't know that it was an infobox with details about the subject I wouldn't be able to tell. So neither is great. The solution, it seems to me, is to add caption text in both cases that specifies what it is- so "Lego summary details" if there is a title, and just "Summary details" if there isn't. Obviously we wouldn't want to display that added text to non-screen-readers, but we have that solved already with e.g. Screen reader-only - the  css class from Screen reader-only/styles.css lets text be read by screen-reader software without adding visual clutter to visual browsers.

The changes needed would be adding the css class and updating local function renderTitle (line 165) to a) always have a caption element) and b) append  inside of that caption. I wanted to get consensus for this, however, before I went mucking with the sandbox. Thoughts? -- Pres  N  15:51, 17 October 2022 (UTC)


 * The material difference between these two from an accessibility perspective will go away when infobox gets changed to  from   (because it's not really an HTML table). That's maybe a year or two away. It's currently blocked on getting infobox over to TemplateStyles.
 * When we get to that state, I have been thinking about how to make it obvious in accessibility agents what they've bumped into. I think we can do that with a simple  which I think we could just set to   (I'd prefer to ke. Well, at least as specced by the W3C; MDN looks a bit opinionated about the expectation that the element you're giving a label to should be interactive.
 * We could probably do that today on the full table element. User:Izno has a table with it and Firefox seems to pick up that that's the name of the table. I don't know what that sounds like in voice over. We could use text from title/above, but the problem is that those two places can contain other HTML, so then we're looking ripping out that other HTML while parsing (not fun).  could be used for that case but it would require the introduction of IDs to the infobox elements for title/above, and I can't guarantee unique IDs on a page today (i.e. pages can contain multiple infoboxes). T200517 would help with that. We could also take the ID from the name for infoboxes with a name (which also adds navbar) and a potential aria-label for infoboxes without, which would probably get us most of the way there. But all of those are probably optimmizations on the more general "name the box for screen readers" for which "info box" or some variant probably is Good Enough? Izno (talk) 18:16, 17 October 2022 (UTC)
 * Voiceover reads it as "info box" (though screen readers read fast so it's indistinguishable from "infobox"). That'd be better than the nothing we have today for non-titled infoboxes, so if that's what we get that's sufficient (though I'd personally prefer "summary details" as more clear, but whatever).


 * In any case, I guess I'm a little confused? Like, I get that the infobox is doing weird things internally, but as far as what's going on today rather than a year from now it's clearly coming up as a for   pretty badly, which is what is needed at the uber small res (and which is what mobile does today), and even displaying browsers cough and hack on the difference in display modes (random scrollbars, things extending outside the content width, etc. etc.). I've put some musings together at user:Izno/Sandbox/Infobox. As you can see there, there's a version of it which is based on definition lists (though IDK if that use is precisely kosher), but there could be a form of infobox which is a series of lists (first of headers and then a list for each header), but that form has issues with integration with CSS grid, which is probably the display technology of interest here (notably that we don't have subgrids widely available yet). It's not an any time soon thing though with TemplateStyles still to go, among the other TableAsPresentationThings we have that would probably make the world better to definitely fix at some point. I know of another wiki that pretty early on (like a decade and a half ago) realized that infoboxes are just unordered lists of info and has marked them up as such also; most others copy-paste us or use wikitext tables.
 * If I were to note, you probably don't notice (or maybe aren't served/delivered?) that the information contained in Google's infoboxes is  based rather than table based. Besides Google (and a few other search engines), there aren't really any other web properties doing infoboxes in a sense like ours (or at least the world of MediaWiki), where most other wikis just copy what we do. Izno (talk) 00:27, 17 December 2022 (UTC)

Ignored data cells
A few years ago, added tracking for ignored data cells (see this thread). I just fixed about a dozen of these today. Does anyone object to allowing both header1 and data1 with the header appearing over the data similar to sidebar. I think this would eliminate a lot of confusion. Thanks! Plastikspork ―Œ (talk) 13:38, 25 April 2023 (UTC)


 * Sounds like a good idea. Could you do a mock-up of what it would look like? &mdash; Martin (MSGJ · talk) 14:48, 25 April 2023 (UTC)
 * yes, now that we have allowed sufficient time for the tracking category to fill, and the tracking category is cleaned up, I think we can safely do this. I think [//en.wikipedia.org/w/index.php?title=Module%3AInfobox%2Fsandbox&diff=1151681043&oldid=1129532418 this change] should do it.  basically, just change the logic that excludes both from appearing, and remove the extra tracking.  you can see the difference in this test. Frietjes (talk) 15:18, 25 April 2023 (UTC)
 * Looks good! &mdash; Martin (MSGJ · talk) 17:15, 25 April 2023 (UTC)
 * Yes, that looks great! Plastikspork ―Œ (talk) 01:01, 26 April 2023 (UTC)
 * What would be the motivation for making infobox work like sidebar in this case, and is there an already existing alternative? I think there is always at least one alternative - just using the next number. Izno (talk) 18:39, 25 April 2023 (UTC)
 * The problem is that if you use the same header and data number it suppresses the data with no error or warnings, just a tracking category. I just fixed about a dozen of these where the data wasn't showing. I don't see any downside to allowing the header and data to have the same number. Plastikspork ―Œ (talk)  01:01, 26 April 2023 (UTC)
 * That wasn't really my question. I'm looking for a real-wiki use case that actually needs to add this support. If there isn't one, that's fine..... Izno (talk) 01:40, 26 April 2023 (UTC)
 * I think this fix is meant to allow for mistakes where someone accidentally dual-numbers the header and subsequent data value. In other words, rather than posting a warning or creating an entry in a tracking cat, we are just going to allow it as a reasonable exception. Primefac (talk) 08:04, 26 April 2023 (UTC)
 * there were dozens of examples in Category:Pages using infobox templates with ignored data cells but gnomes (like me) have fixed most of them. Frietjes (talk) 15:53, 26 April 2023 (UTC)
 * Right, so my question is, were those valid use cases where it was reasonable to allow a headerX and dataX to exist, and should we carve out an exception to actually make it work, or should we mandate good numbering protocols and give a warning if dataX and headerX are both used? Primefac (talk) 07:46, 27 April 2023 (UTC)
 * So, as I understand it, a datan will show, right below headern. Is this sound semantically? DePiep (talk) 07:40, 26 April 2023 (UTC)
 * Tests true added: . /sandbox: as expected ("no data -> no header") . Don't know what /sandbox2 is testing. -DePiep (talk) 07:55, 26 April 2023 (UTC)
 * thank you for adding that test. I have no idea what /sandbox2 is testing either (looks pretty old). Frietjes (talk) 15:50, 26 April 2023 (UTC)

Infobox from Wikidata?
Can someone provide an example of how to populate an infobox from Wikidata?

For example, the Wikipedia article on American Civil Liberties Union includes a segment of code that begins " {{Infobox organization ". My fantasy is that " {{Infobox Q21637}} " would be enough (because Q21637 is the Q ID for the American Civil Liberties Union). Then if a user wanted to include some information but not others, there would be fairly simple ways to specify information that a person wanted (a) in the article but not in Wikidata and (b) in Wikidata but not in the article.

Does documentation of how to do this exist somewhere? If yes, how can I find it? If no, can someone provide the needed documentation? Thanks, DavidMCEddy (talk) 19:39, 1 June 2023 (UTC)
 * Module:WikidataIB is used to pull values. There is (currently) strong community pushback against having an infobox that is entirely pulled from WD, so unless that opinion has changed, there is no point in creating an infobox that does it. Primefac (talk) 20:05, 1 June 2023 (UTC)
 * Thanks for the quick reply. Could you please add an example -- preferably a link to a Wikidata article that models proper use of Module:WikidataIB inside an infobox?
 * I believe it can be done, but I'm still not sure how. I've seen documentation of Module:WikidataIB, but I didn't see anything sufficient to get me started.  It may be there, and I missed it, but it didn't jump out at me as I was trying to parse that all.  Thanks again, DavidMCEddy (talk) 20:16, 1 June 2023 (UTC)
 * The main problem is one of verifiability. This is policy here on English Wikipedia, but whilst Wikidata has d:Wikidata:Verifiability, it's still a proposed policy or guideline; moreover, adding a source on Wikidata is much more involved than it is here - you can't simply pop the source info between {{tag|ref}} tags.
 * If infoboxes pull information from Wikidata, and that info gets changed, will the change be reliably sourced? Maybe. Will the change be noticed here? Not immediately, it can take days, weeks or months before somebody spots the error. But when an infobox contains the actual data in its parameters, and that info is changed, it will show up on somebody's watchlist and can be acted upon fairly quickly. -- Red rose64 &#x1f339; (talk) 21:10, 1 June 2023 (UTC)


 * I've experienced changes in pages I was "watching" that I could not see, perhaps because the change was to Wikidata and was not properly displayed with the change notification.
 * However, before I can use Module:WikidataIB to pull values, I have to know how to do it. Currently, I would be throwing darts blindfolded ;-)  Thanks, DavidMCEddy (talk) 23:23, 1 June 2023 (UTC)
 * Take your pick, any infobox that transcludes the module will be using it. Primefac (talk) 09:20, 2 June 2023 (UTC)

{{outdent}} Thanks. I was able to get something.

Now I have another problem: What can I do to get  total revenue (P2139) to sort in date sequence in {{Q|30288051}}? When I use it in Wikipedia, the last "Revenue" entered is displayed. I think the most recent should be displayed, but that's not what I'm getting. ?? Thanks again. DavidMCEddy (talk) 13:48, 2 June 2023 (UTC)
 * That is a question that should be asked at WikiData - the module can be set to grab only a single P value but as far as I am aware it cannot pull a specific P value. Primefac (talk) 13:56, 2 June 2023 (UTC)
 * From memory our basic WikidataIB functions support preferred rank natively. See d:Help:Ranks. That should resolve the issue. Izno (talk) 14:51, 2 June 2023 (UTC)


 * Thanks. I just posted it to Wikidata:Wikidata:Project chat.  DavidMCEddy (talk) 16:52, 2 June 2023 (UTC)


 * How can I get the url to display in the infobox?
 * I tried inserting " | official website=on" as an extra line in {{infobox organization/Wikidata ... }} . It complained, 'Preview warning: Page using Template:Infobox organization/Wikidata with unknown parameter "official website"'.
 * I got essentially the same error from other attempts until I tried, " | url=on". That displayed as "Website	[// ]".  That suggests that " | url=" is correct, but it needs to be followed by something different from "on".
 * This is with Pregnancy Justice. Suggestions?  Thanks DavidMCEddy (talk) 20:47, 2 June 2023 (UTC)
 * Please do not do sandbox testing on live articles. Gonnym (talk) 22:50, 2 June 2023 (UTC)
 * The best place to start with this specific question is Template talk:Infobox organization/Wikidata. – Jonesey95 (talk) 23:48, 2 June 2023 (UTC)


 * Thanks. Done.  DavidMCEddy (talk) 02:17, 3 June 2023 (UTC)

RfC
Your input is desired at a new Request for Comment at Template talk:Infobox company. ɱ (talk) 14:10, 19 July 2023 (UTC)

Partial collapse
Greetings. MOS:COLLAPSE says: "A few infoboxes also use pre-collapsed sections for infrequently accessed details." Could any one help me find those cases, please? fgnievinski (talk) 19:48, 8 August 2023 (UTC)


 * infobox software off the cuff. Izno (talk) 20:48, 8 August 2023 (UTC)
 * Also, , , , , , , . This list is not exhaustive. -- Red rose64 &#x1f339; (talk) 21:12, 8 August 2023 (UTC)
 * Thank you both, and . Would any of you be able to help me finish a semi-collapsed draft of, please? It'd be valuable for an ongoing discussion (Wikipedia talk:Notability (academic journals)). I've sandboxed it at Template:Infobox journal/sandbox2 but the tests at Template:Infobox_journal/testcases2 didn't seem to hide anything. It'd be used in Draft:List_of_American_Medical_Association_journals. Thanks! fgnievinski (talk) 04:43, 9 August 2023 (UTC)
 * The thing to do is to make your changes to Template:Infobox journal/sandbox, try them out at Template:Infobox journal/testcases (see WP:TESTCASES), then if all is OK, make a protected edit request at Template talk:Infobox journal (see Template:edit template-protected). -- Red rose64 &#x1f339; (talk) 18:02, 9 August 2023 (UTC)
 * That's equivalent to what I'm doing: making my changes to Template:Infobox journal/sandbox2 and trying them out at Template:Infobox journal/testcases2. The suffix "2" is because the original template is supposed to be left unchanged. If everything goes well, we'll have an alternative Template:Infobox journal2. The problem for the moment is I can't seem to make to make any difference. fgnievinski (talk) 23:31, 9 August 2023 (UTC)
 * Now I've managed to make it work by using instad of plain ! fgnievinski (talk) 23:31, 9 August 2023 (UTC)

Module localization
Hello colleagues! I tried to localize the Module:Infobox into the Kazakh Wikipedia. It seems like everything worked out, but some rows like headers are not aligned in the center, I can’t understand where the problem is, everything seems to be the same as in the English version. kk:Module:Ақпар қорабы for example u can see this template kk:Үлгі:Музыкалық топ, and article kk:Ұлытау тобы --Amangeldi Mukhamejan (talk) 13:14, 26 September 2023 (UTC)


 * Did you copy the style sheet too? &mdash; Martin (MSGJ · talk) 13:29, 26 September 2023 (UTC)
 * Yes, I did. kk:Module:Infobox/styles.css--Amangeldi Mukhamejan (talk) 13:46, 26 September 2023 (UTC)
 * I read in a comment in the code that some of the styles still come from MediaWiki:Common.css so maybe something in there? &mdash; Martin (MSGJ · talk) 13:49, 26 September 2023 (UTC)
 * Indeed, some of our styles are still in Common.css. If this is not a problem for you (I can take a look in a minute), you can use the stylesheet from Module:Sandbox/Izno/infobox-styles.css. Izno (talk) 18:09, 26 September 2023 (UTC)
 * Thanks a lot for this--Amangeldi Mukhamejan (talk) 13:10, 28 September 2023 (UTC)
 * And indeed, you have about 330 pages to clean to use the module. Izno (talk) 18:12, 26 September 2023 (UTC)
 * May I ask, why should I clean them? Cuz of name of Module? I'll change it to Module:Infobox, it's just test page actually --Amangeldi Mukhamejan (talk) 13:10, 28 September 2023 (UTC)
 * No, the problem is that if the styles are in the TemplateStyles page, which should be used only by the module or one of the wrapper templates, and not in the Common.css page, those 330 pages with the infobox class won't be styled appropriately. Izno (talk) 16:39, 28 September 2023 (UTC)

Small text
I'd like clarification if small text is discouraged in all cases. These two on my watchlist are now making use of small text:. Leave as they are or should I revert? Mac Dreamstate (talk) 19:12, 26 September 2023 (UTC)


 * Yes, it is almost everywhere inappropriate to use small text in an infobox. Izno (talk) 19:45, 26 September 2023 (UTC)
 * Any text that falls below 85% of the normal text size for the rendered page is too small. Since the default text size in infoboxes is 88%, that means that small tags and templates should almost never be used in infobox code, whether that is within template code or in parameter values on pages. The only place in most infoboxes where it can be valid is in title/above parameters that are enlarged. – Jonesey95 (talk) 20:36, 26 September 2023 (UTC)
 * Postscript: I have wondered for a couple of years now how difficult it would be to detect, at the module level, whether a parameter value in e.g. label12 or data9 contained small tags or templates, and whether it would be worth trying. – Jonesey95 (talk) 20:37, 26 September 2023 (UTC)
 * Maybe a bot task for checking if a param has or in it and removing it. SWinxy (talk) 20:40, 28 September 2023 (UTC)
 * It would be trivial to catch uses of the HTML tag, and even trivial to add CSS to make uses of the small tag not display as 85%. It is less trivial to find small but in the realm of possible. But in this case, I think it would be better to run a bot or perhaps ask the CHECKWIKI guys to dump a list of pages where this is an issue. Izno (talk) 21:45, 28 September 2023 (UTC)
 * – Now it's a case of WP:OTHERSTUFF. Mac Dreamstate (talk) 21:37, 10 October 2023 (UTC)
 * Yeah, that sort of "other stuff" revert has happened to me before. I took care of it by fixing the other articles that were listed in the helpful edit summary, and a few more. Some people are not willing to follow links to explanatory text like MOS:SMALLFONT and seem to think that consistency is more important than accessibility. A tracking category or database report would be a helpful way to find articles like this that exist in batches. – Jonesey95 (talk) 18:00, 11 October 2023 (UTC)

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)