![]() | This is an archive of past discussions. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Archive 15 | Archive 16 | Archive 17 | Archive 18 | Archive 19 |
Infobox/Archive 18 | |
---|---|
Location | |
Birmingham |
Nickname | Fred |
---|
As can be seen from the above examples ({{
Infobox school}}; {{
Infobox organization}}, respectvley), the expected "defaults to {{PAGENAME}}
, if not provided" behaviour for |name=
is not operating. I have been unable to determine the cause.
Andy Mabbett (Pigsonthewing);
Talk to Andy;
Andy's edits
15:22, 14 May 2021 (UTC)
|name=
might not have any content, the fact that it is called means that it triggers that part of
| title = {{{name|{{{organization_name|{{{Non-profit_name|{{PAGENAMEBASE}}}}}}}}}}}
|felülír=
(“override”) parameter, which solves this problem with a slightly even more concise solution than {{
if empty}}: instead of {{
if empty|{{{param|}}}|{{PAGENAMEBASE}}}}
, one can write {{
PAGENAMEBASE|override={{{param|}}}}}
. Feel free to adopt it if you think it’s useful on enwiki as well. —
Tacsipacsi (
talk)
21:07, 14 May 2021 (UTC)
This had not used to be an issue. Do we need a programme to apply the fix to all infoboxes (or at least, those based on {{ Infobox}})? Or can the generic fix be applied, upstream? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 09:56, 15 May 2021 (UTC)
{{#ifeq:{{{1|a}}}|{{{1|b}}}|<!-- parameter 1 is specified, empty or not empty -->|<!-- parameter 1 is not specified at all -->}}—breaking these would be unfortunate. — Tacsipacsi ( talk) 11:37, 15 May 2021 (UTC)
The MinervaNeue skin usually used display:block;
property for <table> and <caption> elements while you see them on smaller screens (i.e. screen narrower than 720 px), but this may cause problems in infobox, numerous infobox usually used a table (by wiki markup or HTML code) to add a sub table in there, but this property making sub table narrower and shift to left even if you set width:100%
property. To fix this problem, I suggest adding following rules for fix:
body.skin-minerva .infobox table {
display: table;
}
body.skin-minerva .infobox caption {
display: table-caption;
}
This could be either add in Template:Infobox/styles.css or report to Phabricator. -- Great Brightstar ( talk) 14:17, 18 May 2021 (UTC)
{{
not done}}
,
WP:OTHERPARENT applies as well as WP:MULTI. --
Redrose64 🌹 (
talk)
07:00, 19 May 2021 (UTC)I've made a handful of changes today locally in infoboxes to rectify a lack of font-size styling applied by default to the above/title on mobile Minerva (such as [1] and [2]). I chatted with User:Jonesey95 about this on my talk page ( see here), and they advised me that there may be an easier way of setting a default for this using TemplateStyles here, so I wanted to start a discussion. — Goszei ( talk) 05:47, 26 May 2021 (UTC)
In the past few weeks I have noticed a heavy editing volume by
GKFX replacing {{Infobox
calls with {{#invoke:infobox|infoboxTemplate
calls in the name of
WP:PEIS. I am not necessarily here to litigate their past changes, but it has got me to thinking: this template is pretty much only used directly by wrapper templates; would it be reasonable to deprecate {{
infobox}} and require users creating new {{
infobox X}} templates to directly call the module? This would save editors like GKFX the necessity of potentially having to change thousands of infobox templates as they get created and heavily used. On the downside, of course, we would lose the rather valuable /doc at this template, and we'd likely have to move it to somewhere prominent enough that it would still be useful (maybe even just turn
Template:Infobox into a redirect to a WP: help page?).
As I said, this is only a semi-serious question, but if I've learned anything from being an educator, if one person has a question there are at least two others who have the same one. Primefac ( talk) 14:00, 1 June 2021 (UTC)
insource:"invoke:infobox3cols"
quite easily.
User:GKFX
talk
18:14, 1 June 2021 (UTC)
insource:/infobox3cols\| *\|/
. While names are certainly important, I think saying "infobox3cols" once is sufficient; the word "main" contains no more useful information than the empty string.
User:GKFX
talk
12:59, 2 June 2021 (UTC)
_check
in the module instead of calling check
in the template.
Izno (
talk)
16:47, 2 June 2021 (UTC)
git stash <subcommand> args...
, but the subcommand is allowed to be omitted in the most common case. I am doing the same thing here, IMO.{{#invoke:infobox3cols||args...}}
is demonstrated to be working, I am sure that people will just copy-paste it and not worry what the extra vertical bar means. Contributors who want to contribute to the Lua space may be a little surprised to see the empty string used as a function name, but it is not incomprehensible to such people as they will presumably have at least skimmed the Lua documentation and know what should go in that slot of an #invoke call.
User:GKFX
talk
17:46, 2 June 2021 (UTC)Many infoboxes have bits that are automatically displayed in italics or in boldface, for example italics for titles of fictional works. For titles that are in non-Latin scripts, that is wrong per MOS:BADITALICS (it can also make the text very hard to read even if you know the script). I've been going around trying to fix some Chinese in incorrect MOS:NOBOLD or italics, which either has to be done using a language code parameter or in the more pedestrian way of using {{ noitalic}} or {{ nobold}}, but I don't have a good way of finding all these violations. GKFX suggested that this could be done using appropriate Lua coding.
Should/Could infoboxes either
Of course this issue affects other scripts, but for Chinese it is especially noticeable, and some manual work may be required to notice whether text is simplified or traditional Chinese or actually Japanese or even Korean. — Kusma ( talk) 12:58, 2 June 2021 (UTC)
{{
infobox book}}
does (a) – italics only – for the value in |title_orig=
as long as there is |orig_lang_code=
.|orig_lang_code=
is missing. "Automagically" would be "based on the unicode block used, do not use italics". —
Kusma (
talk)
14:39, 2 June 2021 (UTC)
<span lang="zh">...</span>
it is possible to constuct a CSS rule that uses the :lang
pseudo-class to detect that and force the b
element to use the declaration font-weight:normal;
and the i
element to use the declaration font-style:normal;
. --
Redrose64 🌹 (
talk)
12:08, 3 June 2021 (UTC)
{{
Infobox book}}
templates that have parameters with values that contain
CJK Unified Ideographs (U+4E00–U+9FFF). For each likely template in the category, redo the search for each template.{{Infobox book}}
. But, it times out ...|title_orig=
but no |orig_lang_code=
" wouldn't be enough to fix this. An alternative might be a massive bot run to look through the HTML of all articles and make a list of all those that have any bold or italics on anything in the Chinese unicode blocks, but I don't know how to do that either, and so I would appreciate any help by more qualified people in getting this fixed. —
Kusma (
talk)
10:24, 3 June 2021 (UTC)I'm doing some other-wiki work and got to a point where I'm considering the correct way to produce an infobox rather than the HTML table it is today. I put together User:Izno/Sandbox/Infobox to document some of the basics of what an infobox should look like because I don't know the exact way I think it should go. Izno ( talk) 23:56, 2 July 2021 (UTC)
I've ran into an issue I'm not sure how to fix. I have an infobox with a nested subbox which has 1 data row. That row can be empty, which is valid. However, if that row is empty the page is added to
Category:Articles which use infobox templates with no data rows. The docs say to fix that, I should add |decat=yes
. That indeed fixes that, however, if the parent template is empty, it now never gets added to that tracking category.
I've created 3 test infobox to show that it fails:
This can only be tested on mainspace entries so I have no tests setup. Easiest way to check, create a page with random letters (don't publish, just edit it) and add the following:
{{User:Gonnym/sandbox/infobox subbox decat |image = Placeholder.pdf }}
Any ideas on how to fix this? Gonnym ( talk) 11:29, 6 July 2021 (UTC)
<table>
</table>
when there are no rows, which is not "nothing" from the view of the parent infobox. one solution would be to tweak the code so it never returns table tags with nothing inside. the most efficient solution could be to have some flag that keeps track if any content is added and then not return the table if there is nothing inside.
Frietjes (
talk)
14:57, 7 July 2021 (UTC)#(getArgNums('data'))
), but in your code you also check headers and titles. As I'm not the one who created this tracking category, I have no idea what is more correct, but just pointing this out.
Gonnym (
talk)
16:29, 12 July 2021 (UTC)
<table>...</table>
without a lot of extra string processing, so empty wouldn't apply if there is anything else in there. the tracking for no data rows was added a long time ago, see
this thread. I believe the concern was the use of an "infobox" where it was just a wrapper for an image. How useful this tracking category is today, I don't know. but, the empty <table>...</table>
can cause issues as you have identified above.
Frietjes (
talk)
21:54, 12 July 2021 (UTC)
{{infobox|subbox=yes}}
with no other non-blank inputs from generating a blank table tag, which then caused {{infobox|data1={{Infobox|subbox=yes}}}}
to generate an infobox with a blank row (and possibly trigger ghost headers). I didn't do anything to the "no data rows" tracking category, which may or may not be a useful tracking category. but, I suppose there may be more now in that category since the subbox won't generate a blank table tag in the parent's infobox.
Frietjes (
talk)
14:26, 13 July 2021 (UTC)
This is a non-standard use of infoboxes, and looks like ass. Yet the documentation page says: image(n) images to display at the top of the template. Use full image syntax, for example [[File:example.png|200px|alt=Example alt text]]. Image is centered by default. See WP:ALT for more on alt text.
What's up with that? jp× g 20:11, 2 September 2021 (UTC)
{{
infobox islands}}
; the documentation for that template says image = locator/satellite/other map image (without the prefix "File:" or "Image:")MB 20:31, 2 September 2021 (UTC)
|thumb
parameter. This should never be used for infobox images; if that is omitted, the image is much more presentable.
WP:INFOBOXIMAGE is explicit: When adding an image to an infobox, thumbnails should NOT be used.See also Help:Infobox picture#My image is displayed, but is inside an extra frame. -- Redrose64 🌹 ( talk) 23:00, 2 September 2021 (UTC)
Your feedback is requested at Template talk:Infobox settlement#TemplateStyles. Izno ( talk) 18:05, 8 September 2021 (UTC)
I made a couple changes in the module sandbox which addresses a couple problems. (1) generate templatestyles in both the child and non-child cases, (2) move tracking categories and templatestyles between table rows to inside the table rows. as far as I can tell, this fixes the blank cells that are being generated when the module "fixes" child boxes. for example, see case 16 mentioned in the thread above. please let me know if you see a problem with the changes. if there are no objections, I plan to roll this out into the main module. thank you. Frietjes ( talk) 19:45, 27 September 2021 (UTC)
You are invited to join a discussion at
Template talk:Infobox writer § Proposed short description.
The following is another user's helpful summary of the long discussion:
Qwerfjkl talk 10:32, 27 October 2021 (UTC)
![]() | This
edit request to
Template:Infobox/styles.css has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Template:Infobox/styles.css has been listed at Templates for discussion ( nomination), but it was protected, so it could not be tagged. Please add:
/* {{subst:template for discussion|help=off}} */
to the top of the page to complete the nomination. Thank you. Q28 hope you pay attention to TFD 01:55, 27 November 2021 (UTC)
Are there instructions somewhere for creating an embedded infobox with Lua? I've been working on {{
Infobox road}}
for a while and the examples that are there already aren't necessarily the direction I want to go. –
Fredddie
™
22:28, 30 November 2021 (UTC)
Hello!
Kind of a newbie question: Can someone help me by explaining what the "class" parameter serves for used in most infoboxes, beside "label" and "data"? I've imported some of EnWiki's infoboxes to my homewiki (SqWiki) and I was taking care with the needed localization but I wasn't sure if I should be translating the class values or not.
Also, staying on the same topic, if someone can help me understand how the "Parent(s)" parameter works in the {{ Infobox person}}, I'd be grateful. I got confused by its multinested structure.
Thanks in advance! :) - Klein Muçi ( talk) 22:33, 4 December 2021 (UTC)
I just tried to find out what the parameter 'name' exactly does. The description say's that the Navbar will link to the given page name, but when I give it a name it will link to a Template page called like that. Am I doing something wrong or is it like the Documentation of Template:Navbar say's that is used to link directly to the template to edit it's content? If that's the case the documentation here would need some optimization. -- DesignerThan ( talk) 23:29, 12 January 2022 (UTC)
|name=
parameter is to add three links (v-t-e) at the bottom-right corner. These are for giving access to the underlying infobox code and its talk page, and when used the |name=
parameter must be set to the name of the infobox. Thus, if
Template:Infobox person had theis parameter (it doesn't), it would be set as |name=Infobox person
. The feature is rarely necessary and indeed the "e" link can be harmful, and so is hardly ever used. --
Redrose64 🌹 (
talk)
17:05, 13 January 2022 (UTC)
§ Hiding headers when all its data fields are empty
Documentation says |autoheaders=y
= don't show header when its section is empty. All fine.
But the same effect is reached when one enters |autoheaders=no
??? This is caused by code
if not args.autoheaders then return end
Of course, this is bad coding practice and non-intuitive. I propose to adjust the logic. First suggestion would be to apply Module:Yesno here. - DePiep ( talk) 12:09, 21 January 2022 (UTC)
If this is set to any non-blank value..., as well as an entire section describing it. Also, the default is always to have headers, so having an
|autoheaders=no
is like saying "don't avoid the car in front of you" - it makes no sense. In other words, it's not a binary "headers yes/no" type of check, more of an "#ifexists" check.
Primefac (
talk)
12:51, 21 January 2022 (UTC)
|autoheaders=no
to mark explicitly to fellow-coders that that y-option should not be used (for good reason).|nopage=yes
??; {{
collapse top}} has |expand=no
|autoheaders=yes
and |autoheaders=no
have the same effect (namely "true
")? I cannot see any reason but sloppyness in coding (eg not minding users like template editors). Unless there is a higher level explanation I do not see yet, I propose to change it. -
DePiep (
talk)
05:56, 22 January 2022 (UTC)
if not args.autoheaders then return end
, which in wiki-template language is basically {{#if:{{{autoheaders|}}}...}}
We use this sort of coding all over the place (i.e. not every #if: is an #ifeq:).
Primefac (
talk)
14:53, 22 January 2022 (UTC)Is there a template for idioms?
Is there a template for spy operations, such as MKUltra? Quiet2 ( talk) 04:20, 30 January 2022 (UTC)
Shouldn't this include a |credit=
(or |credit#=
for each image), to add a line beneath the caption to indicate image credit, as is required by some imagery? --
65.92.246.142 (
talk)
21:30, 31 January 2022 (UTC)
|caption=
suffices.
Izno (
talk)
22:07, 31 January 2022 (UTC)
|caption=
like {{
credit line}} which creates a div to insert into the |caption=
after the caption text? {{infobox (or derivation xyz)
|image=imagexyz
|caption=caption text {{credit line|required sourcing credit}}
|other params
}}
{{
credit line}}
being: <div style="text-align:{{{alignment|right}}};"><small>{{{credits}}}</small></div>
<small>...</small>
is forbidden inside infoboxes. Apart from that,
MOS:CREDITS applies - if you want to know the name of the photographer, click the image. --
Redrose64 🌹 (
talk)
16:00, 1 February 2022 (UTC)
What am I doing wrong?
In
my sandbox (permalink) are comparisons of a new version of ship infobox that uses
Module:Infobox in place of a wikitable. Individual sections of the infobox are implemented as |section<n>={{#invoke:Infobox ship|<section function>|...}}
where |section<n>=
is an alias of (and internally translated to) |data<n>=
. This mechanism is taken from the examples at
Template:Infobox § Embedding.
Note the space between the infobox top border and the top of the image in the side-by-side comparisons. The gap is larger in the right (new) infobox. Hover your mouse over the image in the right infobox and right-click → inspect. Between the <tbody>
tag and the image's <tr>...</tr>
tag is another <tr>...</tr>
tag which holds something that looks more-or-less like this:
<tr><td colspan="2" class="infobox-full-data"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1066479718"></td></tr>
Should that be there? If not, what am I doing wrong?
— Trappist the monk ( talk) 15:38, 21 May 2022 (UTC)
mw-data:TemplateStyles:r1066479718
indicates the page revision of the TemplateStyles page injected). Since the row exists, it's getting the associated padding from the CSS being applied to infobox-full-data
which is why there is more.Let's take the infobox on the president of your country, the USA, European Commission, whatever. They contain more or less the same kind of quick overview data, but there are slight differences for example in some the start of the term is mentioned but not the end of the term of their presidency. Imagine you want to discuss to add that or anything else in an infobox. Isn't it worth adding a section with good practices on how to proceed? To me it is not clear what consequences adding that end of term for example. It reads that templates contain "repetitive material that may need to show up on multiple articles or pages, often with customizable input. Most templates are scripts using MediaWiki parser functions, nicknamed "magic words", a simple scripting language." So the start of the term date, is that extracted from a dedicated article; idem the ending date of the president's term? And are those then taken along into other articles using magic words? Thy, SvenAERTS ( talk) 12:12, 12 June 2022 (UTC)
So the start of the term date, is that extracted from a dedicated article- no, it is a parameter in the template, something like
|start_date=YYYY
, which is generally located at the top of the article.And are those then taken along into other articles using magic words- no, the Magic words in question are things like #if, {{PAGENAME}}, and other "equation-like" things that make the information appear with the same formatting on every page. Primefac ( talk) 16:01, 12 June 2022 (UTC)
Apologies if this has been raised elsewhere before, but last month a user raised a concern that interpuncts, the separations between list items, do not display at all on mobile in Template:Infobox album. However, it looks like this is a mobile issue in all infoboxes and perhaps Wikipedia at large. Is this just something that can't be helped, like (some) mobile devices cannot display interpuncts correctly, or is there a kind of formatting workaround that could be implemented to make them display on mobile devices when not using flatlists in an infobox? I'm raising this here in the hopes of users not needing to keep implementing local workarounds like restoring/adding flatlists back to infoboxes to make list items display. Ss 112 10:26, 8 July 2022 (UTC)
I have been trying to add a new line in | label but it won't work. I decided to make some more labels to make it go underneath but it doesn't look natural. It is kind of alligned to the center in the parameters of the infobox label space. So, I am here to ask if there is any solution possible or whatsoever regarding to this concern of mine. Thanks in advance. FusionStyleFX ( talk) 17:34, 10 August 2022 (UTC)
Would someone add a "host state" to Template:Infobox games, as the 2026 Commonwealth Games have chosen a host state, rather then a host city. GoodDay ( talk) 03:21, 15 August 2022 (UTC)
This produces no output:
{{infobox | label95 = [[Water turbine|Turbines]] | data95 = 6x 45.0 MW }}
I thought there was no maximum number of rows that were recognised? — Martin ( MSGJ · talk) 13:37, 14 October 2022 (UTC)
{{Infobox|data50=|data100=|data150=|...|data80900=|data80950=data80950!}}
With data81000 it gives "Lua error: not enough memory." I'm not going to mention that as a number limit.
PrimeHunter (
talk)
14:36, 14 October 2022 (UTC)
What would be a good option to present |datan=
in box-wide column instead of regular columnwide (righthand side)? Could be some css form, could be a child-infobox. Preferably, left-align should be possible too.
DePiep (
talk)
14:44, 28 November 2022 (UTC)
|data1=
without also using |label1=
, it occupies the full width. --
Redrose64 🌹 (
talk)
18:43, 28 November 2022 (UTC)I've made a change in the sandbox which allows for automatic detection of plainlist class (today) to insert the relevant styles as TemplateStyles. This is essentially as described at Template talk:Navbox#TemplateStyles for plainlist part 1. If you have questions, please feel free to inquire over there.
I also noticed that the module was calling {{ italic title}} rather than its module interface, and so there is a change queued for that as well. I noticed a discussion in the archives about accessing the full function of that module, but I leave others to work on that in the arbitrary future. Izno ( talk) 00:17, 17 December 2022 (UTC)
![]() | This is an archive of past discussions. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Archive 15 | Archive 16 | Archive 17 | Archive 18 | Archive 19 |
Infobox/Archive 18 | |
---|---|
Location | |
Birmingham |
Nickname | Fred |
---|
As can be seen from the above examples ({{
Infobox school}}; {{
Infobox organization}}, respectvley), the expected "defaults to {{PAGENAME}}
, if not provided" behaviour for |name=
is not operating. I have been unable to determine the cause.
Andy Mabbett (Pigsonthewing);
Talk to Andy;
Andy's edits
15:22, 14 May 2021 (UTC)
|name=
might not have any content, the fact that it is called means that it triggers that part of
| title = {{{name|{{{organization_name|{{{Non-profit_name|{{PAGENAMEBASE}}}}}}}}}}}
|felülír=
(“override”) parameter, which solves this problem with a slightly even more concise solution than {{
if empty}}: instead of {{
if empty|{{{param|}}}|{{PAGENAMEBASE}}}}
, one can write {{
PAGENAMEBASE|override={{{param|}}}}}
. Feel free to adopt it if you think it’s useful on enwiki as well. —
Tacsipacsi (
talk)
21:07, 14 May 2021 (UTC)
This had not used to be an issue. Do we need a programme to apply the fix to all infoboxes (or at least, those based on {{ Infobox}})? Or can the generic fix be applied, upstream? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 09:56, 15 May 2021 (UTC)
{{#ifeq:{{{1|a}}}|{{{1|b}}}|<!-- parameter 1 is specified, empty or not empty -->|<!-- parameter 1 is not specified at all -->}}—breaking these would be unfortunate. — Tacsipacsi ( talk) 11:37, 15 May 2021 (UTC)
The MinervaNeue skin usually used display:block;
property for <table> and <caption> elements while you see them on smaller screens (i.e. screen narrower than 720 px), but this may cause problems in infobox, numerous infobox usually used a table (by wiki markup or HTML code) to add a sub table in there, but this property making sub table narrower and shift to left even if you set width:100%
property. To fix this problem, I suggest adding following rules for fix:
body.skin-minerva .infobox table {
display: table;
}
body.skin-minerva .infobox caption {
display: table-caption;
}
This could be either add in Template:Infobox/styles.css or report to Phabricator. -- Great Brightstar ( talk) 14:17, 18 May 2021 (UTC)
{{
not done}}
,
WP:OTHERPARENT applies as well as WP:MULTI. --
Redrose64 🌹 (
talk)
07:00, 19 May 2021 (UTC)I've made a handful of changes today locally in infoboxes to rectify a lack of font-size styling applied by default to the above/title on mobile Minerva (such as [1] and [2]). I chatted with User:Jonesey95 about this on my talk page ( see here), and they advised me that there may be an easier way of setting a default for this using TemplateStyles here, so I wanted to start a discussion. — Goszei ( talk) 05:47, 26 May 2021 (UTC)
In the past few weeks I have noticed a heavy editing volume by
GKFX replacing {{Infobox
calls with {{#invoke:infobox|infoboxTemplate
calls in the name of
WP:PEIS. I am not necessarily here to litigate their past changes, but it has got me to thinking: this template is pretty much only used directly by wrapper templates; would it be reasonable to deprecate {{
infobox}} and require users creating new {{
infobox X}} templates to directly call the module? This would save editors like GKFX the necessity of potentially having to change thousands of infobox templates as they get created and heavily used. On the downside, of course, we would lose the rather valuable /doc at this template, and we'd likely have to move it to somewhere prominent enough that it would still be useful (maybe even just turn
Template:Infobox into a redirect to a WP: help page?).
As I said, this is only a semi-serious question, but if I've learned anything from being an educator, if one person has a question there are at least two others who have the same one. Primefac ( talk) 14:00, 1 June 2021 (UTC)
insource:"invoke:infobox3cols"
quite easily.
User:GKFX
talk
18:14, 1 June 2021 (UTC)
insource:/infobox3cols\| *\|/
. While names are certainly important, I think saying "infobox3cols" once is sufficient; the word "main" contains no more useful information than the empty string.
User:GKFX
talk
12:59, 2 June 2021 (UTC)
_check
in the module instead of calling check
in the template.
Izno (
talk)
16:47, 2 June 2021 (UTC)
git stash <subcommand> args...
, but the subcommand is allowed to be omitted in the most common case. I am doing the same thing here, IMO.{{#invoke:infobox3cols||args...}}
is demonstrated to be working, I am sure that people will just copy-paste it and not worry what the extra vertical bar means. Contributors who want to contribute to the Lua space may be a little surprised to see the empty string used as a function name, but it is not incomprehensible to such people as they will presumably have at least skimmed the Lua documentation and know what should go in that slot of an #invoke call.
User:GKFX
talk
17:46, 2 June 2021 (UTC)Many infoboxes have bits that are automatically displayed in italics or in boldface, for example italics for titles of fictional works. For titles that are in non-Latin scripts, that is wrong per MOS:BADITALICS (it can also make the text very hard to read even if you know the script). I've been going around trying to fix some Chinese in incorrect MOS:NOBOLD or italics, which either has to be done using a language code parameter or in the more pedestrian way of using {{ noitalic}} or {{ nobold}}, but I don't have a good way of finding all these violations. GKFX suggested that this could be done using appropriate Lua coding.
Should/Could infoboxes either
Of course this issue affects other scripts, but for Chinese it is especially noticeable, and some manual work may be required to notice whether text is simplified or traditional Chinese or actually Japanese or even Korean. — Kusma ( talk) 12:58, 2 June 2021 (UTC)
{{
infobox book}}
does (a) – italics only – for the value in |title_orig=
as long as there is |orig_lang_code=
.|orig_lang_code=
is missing. "Automagically" would be "based on the unicode block used, do not use italics". —
Kusma (
talk)
14:39, 2 June 2021 (UTC)
<span lang="zh">...</span>
it is possible to constuct a CSS rule that uses the :lang
pseudo-class to detect that and force the b
element to use the declaration font-weight:normal;
and the i
element to use the declaration font-style:normal;
. --
Redrose64 🌹 (
talk)
12:08, 3 June 2021 (UTC)
{{
Infobox book}}
templates that have parameters with values that contain
CJK Unified Ideographs (U+4E00–U+9FFF). For each likely template in the category, redo the search for each template.{{Infobox book}}
. But, it times out ...|title_orig=
but no |orig_lang_code=
" wouldn't be enough to fix this. An alternative might be a massive bot run to look through the HTML of all articles and make a list of all those that have any bold or italics on anything in the Chinese unicode blocks, but I don't know how to do that either, and so I would appreciate any help by more qualified people in getting this fixed. —
Kusma (
talk)
10:24, 3 June 2021 (UTC)I'm doing some other-wiki work and got to a point where I'm considering the correct way to produce an infobox rather than the HTML table it is today. I put together User:Izno/Sandbox/Infobox to document some of the basics of what an infobox should look like because I don't know the exact way I think it should go. Izno ( talk) 23:56, 2 July 2021 (UTC)
I've ran into an issue I'm not sure how to fix. I have an infobox with a nested subbox which has 1 data row. That row can be empty, which is valid. However, if that row is empty the page is added to
Category:Articles which use infobox templates with no data rows. The docs say to fix that, I should add |decat=yes
. That indeed fixes that, however, if the parent template is empty, it now never gets added to that tracking category.
I've created 3 test infobox to show that it fails:
This can only be tested on mainspace entries so I have no tests setup. Easiest way to check, create a page with random letters (don't publish, just edit it) and add the following:
{{User:Gonnym/sandbox/infobox subbox decat |image = Placeholder.pdf }}
Any ideas on how to fix this? Gonnym ( talk) 11:29, 6 July 2021 (UTC)
<table>
</table>
when there are no rows, which is not "nothing" from the view of the parent infobox. one solution would be to tweak the code so it never returns table tags with nothing inside. the most efficient solution could be to have some flag that keeps track if any content is added and then not return the table if there is nothing inside.
Frietjes (
talk)
14:57, 7 July 2021 (UTC)#(getArgNums('data'))
), but in your code you also check headers and titles. As I'm not the one who created this tracking category, I have no idea what is more correct, but just pointing this out.
Gonnym (
talk)
16:29, 12 July 2021 (UTC)
<table>...</table>
without a lot of extra string processing, so empty wouldn't apply if there is anything else in there. the tracking for no data rows was added a long time ago, see
this thread. I believe the concern was the use of an "infobox" where it was just a wrapper for an image. How useful this tracking category is today, I don't know. but, the empty <table>...</table>
can cause issues as you have identified above.
Frietjes (
talk)
21:54, 12 July 2021 (UTC)
{{infobox|subbox=yes}}
with no other non-blank inputs from generating a blank table tag, which then caused {{infobox|data1={{Infobox|subbox=yes}}}}
to generate an infobox with a blank row (and possibly trigger ghost headers). I didn't do anything to the "no data rows" tracking category, which may or may not be a useful tracking category. but, I suppose there may be more now in that category since the subbox won't generate a blank table tag in the parent's infobox.
Frietjes (
talk)
14:26, 13 July 2021 (UTC)
This is a non-standard use of infoboxes, and looks like ass. Yet the documentation page says: image(n) images to display at the top of the template. Use full image syntax, for example [[File:example.png|200px|alt=Example alt text]]. Image is centered by default. See WP:ALT for more on alt text.
What's up with that? jp× g 20:11, 2 September 2021 (UTC)
{{
infobox islands}}
; the documentation for that template says image = locator/satellite/other map image (without the prefix "File:" or "Image:")MB 20:31, 2 September 2021 (UTC)
|thumb
parameter. This should never be used for infobox images; if that is omitted, the image is much more presentable.
WP:INFOBOXIMAGE is explicit: When adding an image to an infobox, thumbnails should NOT be used.See also Help:Infobox picture#My image is displayed, but is inside an extra frame. -- Redrose64 🌹 ( talk) 23:00, 2 September 2021 (UTC)
Your feedback is requested at Template talk:Infobox settlement#TemplateStyles. Izno ( talk) 18:05, 8 September 2021 (UTC)
I made a couple changes in the module sandbox which addresses a couple problems. (1) generate templatestyles in both the child and non-child cases, (2) move tracking categories and templatestyles between table rows to inside the table rows. as far as I can tell, this fixes the blank cells that are being generated when the module "fixes" child boxes. for example, see case 16 mentioned in the thread above. please let me know if you see a problem with the changes. if there are no objections, I plan to roll this out into the main module. thank you. Frietjes ( talk) 19:45, 27 September 2021 (UTC)
You are invited to join a discussion at
Template talk:Infobox writer § Proposed short description.
The following is another user's helpful summary of the long discussion:
Qwerfjkl talk 10:32, 27 October 2021 (UTC)
![]() | This
edit request to
Template:Infobox/styles.css has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Template:Infobox/styles.css has been listed at Templates for discussion ( nomination), but it was protected, so it could not be tagged. Please add:
/* {{subst:template for discussion|help=off}} */
to the top of the page to complete the nomination. Thank you. Q28 hope you pay attention to TFD 01:55, 27 November 2021 (UTC)
Are there instructions somewhere for creating an embedded infobox with Lua? I've been working on {{
Infobox road}}
for a while and the examples that are there already aren't necessarily the direction I want to go. –
Fredddie
™
22:28, 30 November 2021 (UTC)
Hello!
Kind of a newbie question: Can someone help me by explaining what the "class" parameter serves for used in most infoboxes, beside "label" and "data"? I've imported some of EnWiki's infoboxes to my homewiki (SqWiki) and I was taking care with the needed localization but I wasn't sure if I should be translating the class values or not.
Also, staying on the same topic, if someone can help me understand how the "Parent(s)" parameter works in the {{ Infobox person}}, I'd be grateful. I got confused by its multinested structure.
Thanks in advance! :) - Klein Muçi ( talk) 22:33, 4 December 2021 (UTC)
I just tried to find out what the parameter 'name' exactly does. The description say's that the Navbar will link to the given page name, but when I give it a name it will link to a Template page called like that. Am I doing something wrong or is it like the Documentation of Template:Navbar say's that is used to link directly to the template to edit it's content? If that's the case the documentation here would need some optimization. -- DesignerThan ( talk) 23:29, 12 January 2022 (UTC)
|name=
parameter is to add three links (v-t-e) at the bottom-right corner. These are for giving access to the underlying infobox code and its talk page, and when used the |name=
parameter must be set to the name of the infobox. Thus, if
Template:Infobox person had theis parameter (it doesn't), it would be set as |name=Infobox person
. The feature is rarely necessary and indeed the "e" link can be harmful, and so is hardly ever used. --
Redrose64 🌹 (
talk)
17:05, 13 January 2022 (UTC)
§ Hiding headers when all its data fields are empty
Documentation says |autoheaders=y
= don't show header when its section is empty. All fine.
But the same effect is reached when one enters |autoheaders=no
??? This is caused by code
if not args.autoheaders then return end
Of course, this is bad coding practice and non-intuitive. I propose to adjust the logic. First suggestion would be to apply Module:Yesno here. - DePiep ( talk) 12:09, 21 January 2022 (UTC)
If this is set to any non-blank value..., as well as an entire section describing it. Also, the default is always to have headers, so having an
|autoheaders=no
is like saying "don't avoid the car in front of you" - it makes no sense. In other words, it's not a binary "headers yes/no" type of check, more of an "#ifexists" check.
Primefac (
talk)
12:51, 21 January 2022 (UTC)
|autoheaders=no
to mark explicitly to fellow-coders that that y-option should not be used (for good reason).|nopage=yes
??; {{
collapse top}} has |expand=no
|autoheaders=yes
and |autoheaders=no
have the same effect (namely "true
")? I cannot see any reason but sloppyness in coding (eg not minding users like template editors). Unless there is a higher level explanation I do not see yet, I propose to change it. -
DePiep (
talk)
05:56, 22 January 2022 (UTC)
if not args.autoheaders then return end
, which in wiki-template language is basically {{#if:{{{autoheaders|}}}...}}
We use this sort of coding all over the place (i.e. not every #if: is an #ifeq:).
Primefac (
talk)
14:53, 22 January 2022 (UTC)Is there a template for idioms?
Is there a template for spy operations, such as MKUltra? Quiet2 ( talk) 04:20, 30 January 2022 (UTC)
Shouldn't this include a |credit=
(or |credit#=
for each image), to add a line beneath the caption to indicate image credit, as is required by some imagery? --
65.92.246.142 (
talk)
21:30, 31 January 2022 (UTC)
|caption=
suffices.
Izno (
talk)
22:07, 31 January 2022 (UTC)
|caption=
like {{
credit line}} which creates a div to insert into the |caption=
after the caption text? {{infobox (or derivation xyz)
|image=imagexyz
|caption=caption text {{credit line|required sourcing credit}}
|other params
}}
{{
credit line}}
being: <div style="text-align:{{{alignment|right}}};"><small>{{{credits}}}</small></div>
<small>...</small>
is forbidden inside infoboxes. Apart from that,
MOS:CREDITS applies - if you want to know the name of the photographer, click the image. --
Redrose64 🌹 (
talk)
16:00, 1 February 2022 (UTC)
What am I doing wrong?
In
my sandbox (permalink) are comparisons of a new version of ship infobox that uses
Module:Infobox in place of a wikitable. Individual sections of the infobox are implemented as |section<n>={{#invoke:Infobox ship|<section function>|...}}
where |section<n>=
is an alias of (and internally translated to) |data<n>=
. This mechanism is taken from the examples at
Template:Infobox § Embedding.
Note the space between the infobox top border and the top of the image in the side-by-side comparisons. The gap is larger in the right (new) infobox. Hover your mouse over the image in the right infobox and right-click → inspect. Between the <tbody>
tag and the image's <tr>...</tr>
tag is another <tr>...</tr>
tag which holds something that looks more-or-less like this:
<tr><td colspan="2" class="infobox-full-data"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1066479718"></td></tr>
Should that be there? If not, what am I doing wrong?
— Trappist the monk ( talk) 15:38, 21 May 2022 (UTC)
mw-data:TemplateStyles:r1066479718
indicates the page revision of the TemplateStyles page injected). Since the row exists, it's getting the associated padding from the CSS being applied to infobox-full-data
which is why there is more.Let's take the infobox on the president of your country, the USA, European Commission, whatever. They contain more or less the same kind of quick overview data, but there are slight differences for example in some the start of the term is mentioned but not the end of the term of their presidency. Imagine you want to discuss to add that or anything else in an infobox. Isn't it worth adding a section with good practices on how to proceed? To me it is not clear what consequences adding that end of term for example. It reads that templates contain "repetitive material that may need to show up on multiple articles or pages, often with customizable input. Most templates are scripts using MediaWiki parser functions, nicknamed "magic words", a simple scripting language." So the start of the term date, is that extracted from a dedicated article; idem the ending date of the president's term? And are those then taken along into other articles using magic words? Thy, SvenAERTS ( talk) 12:12, 12 June 2022 (UTC)
So the start of the term date, is that extracted from a dedicated article- no, it is a parameter in the template, something like
|start_date=YYYY
, which is generally located at the top of the article.And are those then taken along into other articles using magic words- no, the Magic words in question are things like #if, {{PAGENAME}}, and other "equation-like" things that make the information appear with the same formatting on every page. Primefac ( talk) 16:01, 12 June 2022 (UTC)
Apologies if this has been raised elsewhere before, but last month a user raised a concern that interpuncts, the separations between list items, do not display at all on mobile in Template:Infobox album. However, it looks like this is a mobile issue in all infoboxes and perhaps Wikipedia at large. Is this just something that can't be helped, like (some) mobile devices cannot display interpuncts correctly, or is there a kind of formatting workaround that could be implemented to make them display on mobile devices when not using flatlists in an infobox? I'm raising this here in the hopes of users not needing to keep implementing local workarounds like restoring/adding flatlists back to infoboxes to make list items display. Ss 112 10:26, 8 July 2022 (UTC)
I have been trying to add a new line in | label but it won't work. I decided to make some more labels to make it go underneath but it doesn't look natural. It is kind of alligned to the center in the parameters of the infobox label space. So, I am here to ask if there is any solution possible or whatsoever regarding to this concern of mine. Thanks in advance. FusionStyleFX ( talk) 17:34, 10 August 2022 (UTC)
Would someone add a "host state" to Template:Infobox games, as the 2026 Commonwealth Games have chosen a host state, rather then a host city. GoodDay ( talk) 03:21, 15 August 2022 (UTC)
This produces no output:
{{infobox | label95 = [[Water turbine|Turbines]] | data95 = 6x 45.0 MW }}
I thought there was no maximum number of rows that were recognised? — Martin ( MSGJ · talk) 13:37, 14 October 2022 (UTC)
{{Infobox|data50=|data100=|data150=|...|data80900=|data80950=data80950!}}
With data81000 it gives "Lua error: not enough memory." I'm not going to mention that as a number limit.
PrimeHunter (
talk)
14:36, 14 October 2022 (UTC)
What would be a good option to present |datan=
in box-wide column instead of regular columnwide (righthand side)? Could be some css form, could be a child-infobox. Preferably, left-align should be possible too.
DePiep (
talk)
14:44, 28 November 2022 (UTC)
|data1=
without also using |label1=
, it occupies the full width. --
Redrose64 🌹 (
talk)
18:43, 28 November 2022 (UTC)I've made a change in the sandbox which allows for automatic detection of plainlist class (today) to insert the relevant styles as TemplateStyles. This is essentially as described at Template talk:Navbox#TemplateStyles for plainlist part 1. If you have questions, please feel free to inquire over there.
I also noticed that the module was calling {{ italic title}} rather than its module interface, and so there is a change queued for that as well. I noticed a discussion in the archives about accessing the full function of that module, but I leave others to work on that in the arbitrary future. Izno ( talk) 00:17, 17 December 2022 (UTC)