Jump to content

Template talk:Infobox: Difference between revisions

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Content deleted Content added
→‎Deploy auto-categorization: Learn something new every day
→‎Deploy auto-categorization: how would it be used?
Line 144: Line 144:
* '''Note to editor''' who considers making this edit: per [[Wikipedia:Edit_requests#General_considerations|WP:EDITREQ]] I note that this '''proposal now is Controversial''' (and possibly failing on other points too), so should not be performed. - [[User:DePiep|DePiep]] ([[User talk:DePiep|talk]]) 20:46, 14 February 2018 (UTC)
* '''Note to editor''' who considers making this edit: per [[Wikipedia:Edit_requests#General_considerations|WP:EDITREQ]] I note that this '''proposal now is Controversial''' (and possibly failing on other points too), so should not be performed. - [[User:DePiep|DePiep]] ([[User talk:DePiep|talk]]) 20:46, 14 February 2018 (UTC)
:This is not controversial, only you object, for reasons that don't check out. The code works, has been tested, and you can't / straight up refused to come up with any examples of where the code doesn't work. <span style="font-variant:small-caps; whitespace:nowrap;">[[User:Headbomb|Headbomb]] {[[User talk:Headbomb|t]] · [[Special:Contributions/Headbomb|c]] · [[WP:PHYS|p]] · [[WP:WBOOKS|b]]}</span> 20:49, 14 February 2018 (UTC)
:This is not controversial, only you object, for reasons that don't check out. The code works, has been tested, and you can't / straight up refused to come up with any examples of where the code doesn't work. <span style="font-variant:small-caps; whitespace:nowrap;">[[User:Headbomb|Headbomb]] {[[User talk:Headbomb|t]] · [[Special:Contributions/Headbomb|c]] · [[WP:PHYS|p]] · [[WP:WBOOKS|b]]}</span> 20:49, 14 February 2018 (UTC)
::In a quick look at this discussion, I don't see an explanation of how auto-categorization would be used. I see something about "missing templates"—what is that about? There are over 2560 templates which directly call {{tl|infobox}}. Is the idea to have them all listed in [[:Category:Infobox templates]] with a sort key based on the template's name? Am I correct in thinking the proposal would auto-categorize [[Template:Infobox open cluster]] but would ignore [[Template:Punctuation marks]] despite the latter using {{tl|infobox}}? [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 01:05, 15 February 2018 (UTC)

Revision as of 01:05, 15 February 2018

WikiProject iconInfoboxes
WikiProject iconThis template is within the scope of WikiProject Infoboxes, a collaborative effort to improve the coverage of Infoboxes on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.

True infobox can be in a section?

Today, the 120 chemical element articles have a fine infobox that includes an "isotopes" table (e.g. uranium). Over at WikiProject talk:Elements I propose to break that table out into a new, separate infobox. That new infobox will be added into a section of the article. And also: the new infobox will be freshly added to the article isotopes of uranium.

Example: uranium. Today: Uranium, {{Infobox uranium}}, Isotopes of uranium.
New: adding {{Infobox uranium isotopes}} to section Uranium#Isotopes and to Isotopes of uranium

Main question: Is it OK to use a straight infobox in an article section? What information, semantics, MOS, guidelines to keep in mind? (note: ideas are welcome, consensus forum is WT:ELEM). -DePiep (talk)

template help

Hello, Iam new and working on Wp/sat(incubator). I have read the template tutorials from wikipedia but when am using that template code, it doesn't shows like template. It displaying only the template title (e.g. Template:xxxx). So please help me how make infobox template like others page.

Thanks, Ramjit User:Ramjit Tudu 14:46, 4 September 2017‎

Subbox classes

I have removed the infobox class when |subbox=yes to help with the rendering on mobile. as far as I can tell, the class isn't needed when the box is a subbox since the class is set by the outer box. but, please let me know if this causes a problem. Frietjes (talk) 22:41, 24 January 2018 (UTC)[reply]

Automatically populate Category:Infobox templates

Could someone code something (I would, but don't know the first thing about LUA) that would make infoboxes automatically populate Category:Infobox templates?

In wikicode, that would be something like

{{#ifeq:{{str left|{{#titleparts:{{NAMESPACE}}:{{SUBPAGENAME}}|1}}|16}}|Template:Infobox|[[Category:Infobox templates]]}}

{{NAMESPACE}} would guarantee we're in the correct namespace, while {{SUBPAGENAME}} would guarantee we're not on a sandbox/doc page.

Headbomb {t · c · p · b} 01:54, 10 February 2018 (UTC)[reply]

No need to do in lua, could just be added after the {{#invoke}}. -- WOSlinker (talk) 09:50, 10 February 2018 (UTC)[reply]
I suppose that's true. Seems a bit inelegant though and very enwiki specific, but I guess that could be done while someone who knows LUA develop a proper module update.
I'll sandbox things to set up an edit protect request. Headbomb {t · c · p · b} 11:34, 10 February 2018 (UTC)[reply]
Todo: check when pagename is very short, like Template:ibox ₤. -DePiep (talk) 13:34, 10 February 2018 (UTC)[reply]
The solution would likely be to move the infobox to Template:Infobox ₤ and so it categorized correctly. But if the non-standard name was preferred, manual categorization could always be done (e.g. Template:Music of sidebar and sub-templates). Headbomb {t · c · p · b} 13:39, 10 February 2018 (UTC)[reply]
??? the error would be caused by the change, so must be solved by the change. - DePiep (talk) 15:30, 10 February 2018 (UTC)[reply]
What error? Headbomb {t · c · p · b} 18:23, 10 February 2018 (UTC)[reply]
The error situation is: the way {{str left}} handles too-short strings. - DePiep (talk) 21:11, 10 February 2018 (UTC)[reply]
AFAIC, there's no issue with that. {{str left|{{#titleparts:Template:Ibox ₤|1}}|16}} returns Template:Ibox ₤T, which would 'fail' the test, as expected. Headbomb {t · c · p · b} 23:41, 10 February 2018 (UTC)[reply]
{{#invoke:String|sub|s= target_string |i= start_index |j= end_index |ignore_errors=1 |no_category=1}}
{{#ifeq:{{#invoke:String|sub|s={{#titleparts:{{NAMESPACE}}:{{SUBPAGENAME}}|1}}|i=1|j=16<!-- the two error settings go here -->}}|Template:Infobox|[[Category:Infobox templates|{{remove first word|{{SUBPAGENAME}}}}]]}}
(error handling |ignore_errors=1 |no_category=1 to be added, for now this does test = shjo0w workings).
For category sorting, see source code for {{Remove first word}}:
[[Category:Infobox templates|{{{{#invoke:String|replace|source={{SUBPAGENAME}}|pattern=^[^%s]*|replace=|plain=false}}|{{SUBPAGENAME}}}}]]

-DePiep (talk) 13:56, 10 February 2018 (UTC)[reply]

I've edited Template:Infobox element to make use of the /sandbox, and it works flawlessly. See Category:Infobox templates. And as a bonus, things sort nicely, and we get rid of the lot of the /sandbox /doc crap that clutters the category. Many hard-coded instances could be removed from the documentation pages. Headbomb {t · c · p · b} 14:05, 10 February 2018 (UTC)[reply]

Does not read like consensus here. - DePiep (talk) 15:30, 10 February 2018 (UTC)[reply]

I'm confused here. We're still on the building ideas/testing phase. No one's raised any objections yet, so I'm not sure where you claim there's "no consensus". As for {{template other}}, that would not filter out /doc and /sandbox subpages. I'm also not sure what you mean by "Diffusion in the category is broken." AFAICT with my limited testing, it works exactly as intended. The infobox gets categorized, nothing else does. Lastly, PETSCAN would be useless, as the vast majority of infoboxes aren't categorized. Headbomb {t · c · p · b} 18:21, 10 February 2018 (UTC)[reply]

I admit: I misunderstood your I've edited [[Template:Infobox element]] note above (looked like going all live to me - sad face here). I'm sorry.
After this, this technical topic: templates (esp. infoboxes) are supposed to go: 1-source -> 10k, 100k, 1M articles. So if one wants to check "Template:...", better check ns first (=the outside if-check), and only then check for pagename.
More generally, I'd say to @WOSlinker and Headbomb: when the target is getting Category:Infobox templates complete --good--, go WP:PETSCAN or WLH or bots or monthly reports. - DePiep (talk) 21:28, 10 February 2018 (UTC)[reply]
Using {{template other}} would either decrease the efficiency of the code, or do nothing different, since after checking for, you'd still have to check for the {{SUBPAGE}} anyway. The above code does it in one step, so is likely more efficient. I'm also unsure of what exactly would be the point of doing 'PETSCANs'/'WLH'/'Bots'/'Monthly reports'. PETSCANS of what? For what purpose? Bots of what? For what purpose? Monthly reports of what? For what purpose? Etc... Headbomb {t · c · p · b} 23:22, 10 February 2018 (UTC)[reply]
what I meant to say: 1 ibox template is to be used in 100,000 articles. So if we do a cheap ns check first, those 100k article pages do not have to do any 2nd subpage name check at all. Wikiwide: more efficient. -DePiep (talk) 23:30, 10 February 2018 (UTC)[reply]
Ah I see. Still, there's no major increase in cost between 1 {{NAMESPACE}} check, and 1 {{NAMESPACE}} + 1 {{SUPPAGE}} checks. KISS might be better here. Headbomb {t · c · p · b} 23:37, 10 February 2018 (UTC)[reply]
There might be advantages to doing a namespace check before doing a string check however. That would cut down on the 'costly' checks quite a bit. Headbomb {t · c · p · b} 23:39, 10 February 2018 (UTC)[reply]
In general: whatever the OP wants to achieve ("list of infobox templates" we assume), this is not a smart way (nor by server/enwikiwide efficiency, nor by programming efficiency, nor by category result). As I tried to describe.
If you do not get the point of better using, for example, WP:PETSCAN for such an aim, I am not here to argue. For sure, I disadvise making some change this way anyway anyhow. - DePiep (talk) 23:52, 10 February 2018 (UTC)[reply]
The point is to have a category containing all infoboxes. WP:PETSCAN cannot achieve that. Headbomb {t · c · p · b} 23:53, 10 February 2018 (UTC)[reply]
Why does it Have to be a Live category? What is wrong with making a missing-list? -DePiep (talk) 00:37, 11 February 2018 (UTC)[reply]
Because lots of things require live categories? Special:RecentChanges, WP:AALERTS, etc... Headbomb {t · c · p · b} 01:07, 11 February 2018 (UTC)[reply]

Deploy auto-categorization

Given the lack of any solid reason against this, I say it's time to deploy. The edit protected request is simply to copy the sandbox version into the live version. The changes have been tested, and work.

Possible improvements to efficiency may possibly be done through LUA, but this is not something that would noticeably slow down pages as is. Headbomb {t · c · p · b} 21:18, 13 February 2018 (UTC)[reply]

I object to deploying this. In the section #above, I have started thinking along but ended up finding serious objections. I'll relist them here. - DePiep (talk) 10:21, 14 February 2018 (UTC)[reply]
re Template-technically, the sandbox has these flaws: 1. The test is run for each and every transclusion (3M). That is, an infobox having 1k or 10k transclusions: all of these are evaluated to reach that one hit. That is very inefficient. 2. At least, the first (outer) test should be for namespace only. Only when this test fires (i.e., template source page), any pagename processing should be & could be done, to improve efficiency over all those transclusions. 3. It occurs to me that parsed templates could be replaced by module calling (Lua). 4. It has no override option. Best thing that can be said its that "it is working something".
re Design: Still unclear why this functionality should be added this way. Sure it would be convenient to have an all-infoboxes list. However, 1. filling Category:Infobox templates indiscriminately misses out on its --already existing-- category diffusion (even erroneously doubling templates already in there). 2. Also unclear is why this should be done through live categorisation (categorise live template source pages). 3. This is what the {{Documentation}} subpage exists for. That subpage can do all Wikipedia administration categorisation (i.e. all support & maintenance categories), including handling diffusion and incidental stand-alone subtemplates. 4. And, apart from categorising, it is possible to list all templates that are not categorised in Category:Infobox templates. That is: list the missing templates (what this edit tries to solve), then edit these templates. Likely a WP:BOTREQUEST can list these, or WP:PETSCAN. As a maintenance task, there is no problem doing this back-office style.
- DePiep (talk) 10:48, 14 February 2018 (UTC)[reply]
1a/2a) The 'test' is nested, and checks for namespace first ('cheap') before performing the str manipulation ('costly'), so I'm not sure what your objection is there. WP:PERF applies.
3a) Yes this could be done with LUA. Feel free to implement via LUA, but the code works as is.
4a) No override is needed. There is no template located at Template:Infobox Foobar that should not be in Category:Infobox templates.
1b) The purpose of the category changes to be an all-included category, rather than "diffused" one. Sub-categorization can still be done to facilitate browsing by topics, but there will now be a category containing all of them [or rather most of them, some manual categorization will still be needed, but that's fine]. Having both a master category and subcategories aren't at odds with each other, both have different purposes. The WP:DIFFUSE scheme fails when it comes to infoboxes, because most of them are not categorized, and it would take a ridiculous amount of effort to subcategorize each of them correctly.
2b) Because this is the most efficient way of getting the most infoboxes categorized with the least amount of effort. It will miss some (see 4b below), but it will catch the vast majority of them.
3b) {{documentation}} isn't used on all infoboxes, so will miss those without documentations. In particular, Special:RecentChangesLinked/Category:Infobox templates would not pick newly created infoboxes missing documentation. The further away you put the code from the live template, the more you miss. The WP:PERF tradeoff isn't worth it.
4b) "Missing templates" list are effectively useless and can't be used for WP:AALERTS and Special:RecentChanges, and need to be regularly maintained. The point is to have an existing templates category that gets updated automatically. The only point behind a 'missing templates' list would be to find corner cases where you have an infobox located at a different title than Template:Infobox Foobar, that is not picked up by automatic categorization, so it can be manually categorized. And for the 3rd or 4th time now, WP:PETSCAN is completely useless because it depends on infoboxes being categorised, which they aren't at the moment. This is what we're trying to fix. WP:PETSCAN would become useful after infoboxes are categorized.
Headbomb {t · c · p · b} 12:31, 14 February 2018 (UTC)[reply]
1a/b: I replied to your earlier objections, apparenmtly you did edit. OK. The efficiency is in the number of negatives.
3a.
4a. "no override is needed" - Does not sound like an analysed check. And above, you require a rename for exceptions known.
1b: the way you describe the new "DIFFUSE" is not correct DIFFUSE, nor is it conforming parent/sub categorisation (only once ever). Altogether you are puttign aside diffused categories without long term plan (remove or complete?).
2b:
3b: "{{Documentation}} missing" -- then add it.
4b: First of all, no need to talk down on me, whether you miss my point or not (in this case you do). Your statement re PETSCAN is wrong.
Yes those "corner cases" should be added as you say. How do you provide to do that? As I suggested, PETSCAN or a bot can do that (don't forget to tell the bot: non-Lua infoboxes that do have class=infobox qualify too).
"This is what we're trying to fix" -- in a crude, incomplete way and overcomplete (redundant) way. What is missing is an overthinking of the OP request. Would help preventing the categorisation mess that is coming, for starters.
This is the missing gap: analysis of which templates to include/exclude; already jumped into some how to do it & then put exceptions out of sight. -DePiep (talk) 14:17, 14 February 2018 (UTC)[reply]
4a) I don't care how it "sounds", this remains a fact. As for renames, that's one option. The other is to add the category manually. 3b) How do you know you need to add it when you don't even know it's missing? And don't say PETSCAN because, again, PETSCAN relies on categories. Here's an easy way to put this matter to rest. Give us an example of where an override would be needed, and give us a PETSCAN listing all infoboxes. Headbomb {t · c · p · b} 17:50, 14 February 2018 (UTC)[reply]
"Does not sound like" - your off the cuff remark shows that this part has not been thought through. It's just a reply you made yuo after I pointed to the issue. You have not resoned why there should be no exception. - DePiep (talk) 20:24, 14 February 2018 (UTC)[reply]
Because the code works, and there are no scenario in which exceptions would occur. You may not have thought things through, but it doesn't mean things haven't been thought through. Headbomb {t · c · p · b} 20:27, 14 February 2018 (UTC)[reply]
  • Support Headbomb's reasoning and WP:DWAP (doesn't mean we can be careless, but that isn't the case here). Given the large transclusion size, though, I'd be interested to know if Lua is cheaper and by how much. Unless it's significant, just go with the working, tested sandbox.   ~ Tom.Reding (talkdgaf)  13:01, 14 February 2018 (UTC)[reply]
LUA would be cheaper, but we're talking a few milliseconds difference at best. Wikipedia:Lua speed say #ifeq runs at 1250 calls/seconds (so most pages, we're talking about a ~0.8 ms difference), and if the second test is invokes, we add a second ifeq call of 0.8 ms + a str manipulation template at ~625/2 seconds = 3.2 ms, for a total of ~4.8 ms. Headbomb {t · c · p · b} 18:05, 14 February 2018 (UTC)[reply]
Tom.Reding could you reflect on the design issues? Coming from the OP, the sandbox talkes a lot of design 'choices' (better: effects), that are not well derived from that OP. As Bombshell already described here, the category structure must change (not noted before; is a signal. Good I asked), while still breaking WP:DIFFUSE. - DePiep (talk) 13:47, 14 February 2018 (UTC)[reply]
My only suggestion would be for this to populate a different category, say Category:All infobox templates?, with {{Non-diffusing subcategory}} at the top, pointing to Category:Infobox templates as the parent diffusing cat.   ~ Tom.Reding (talkdgaf)  14:47, 14 February 2018 (UTC)[reply]
I'm not really sure I see why there's a need for a separate category here. Why is the existing one problematic? Headbomb {t · c · p · b} 18:18, 14 February 2018 (UTC)[reply]
I suppose that if Category:Infobox templates was ideally diffused then it wouldn't matter, yeah. Is the cat going to be removed from all the ~156 templates it's currently on (and replaced with its proper subcat, ideally)?   ~ Tom.Reding (talkdgaf)  19:04, 14 February 2018 (UTC)[reply]
@Tom.Reding: The hard-coded category (Category:Infobox templates) would be removed from templates following {{Infobox Foobar}} naming convention, and instead be added dynamically by the {{Infobox}}. Right now all {{Infobox element}} call {{Infobox/sandbox}}, which makes the categorization cascade down to all element infoboxes [you can tell because they are sorted correctly].
Deploying the code would let this cascade to all infoboxes that follow the {{Infobox Foobar}} naming convention. Hard-coding the category on individual templates will only be necessary for those that don't follow that naming convention (e.g. {{Obama cabinet infobox}}, although that could also be handled by moving the infobox to the standard location ({{Infobox Obama cabinet}}).
"instead" is not exactly right: it will be done anyway & independently of hardcoded category being present or not.
There are more situations where hardcoding the category is required.
This abandoning of subcategories is not part of the proposal, not even implicit. And clearly the point "drop diffused categories" is not discussed. Also, at the moment the category is a topic category, so those topical templates listed should find a new house.
Requiring infobox renamings to make this function has no consensus or any other base. BTW, as things stand this is a manual job (you'd need a list...). - DePiep (talk) 20:36, 14 February 2018 (UTC)[reply]
If you are confused about what the proposal is, you should reread what the proposal is, because you don't seem to understand anything about it. All your objections have either been addressed, or are either invalid or unsubstantiated. Headbomb {t · c · p · b} 20:48, 14 February 2018 (UTC)[reply]
How subcategories are handled doesn't change, since that can't be automated. Headbomb {t · c · p · b} 20:13, 14 February 2018 (UTC)[reply]
Yes, that is what I want to point to. You are mixing up two category setups that do not go together (per WP:CAT).
WP:CAT says nothing about this whatsoever. See WP:DUPCAT in particular. Headbomb {t · c · p · b} 20:43, 14 February 2018 (UTC)[reply]
I believe DePiep is concerned about the fact that Category:Infobox templates will (may) simultaneously be both a diffusing category (anyone can, and should, continue to sort infoboxes into those subcats, and do so manually) and a non-diffusing category (i.e. pages should only be placed directly into the cat by the as-yet-undeployed template code). I'm fine with either scheme, as long as it's clear in the description. However, finding the appropriate templates to put at the top of the cat will be hard since they'll contradict each other, and it will be non-intuitive for many people since I don't think such an example exists at such a prominent level (not that I've noticed anyway). Making a separate non-diffusing cat resolves that. Making a new header template resolves that too. So, as long as one of those 2 things happen, I don't see a further problem.   ~ Tom.Reding (talkdgaf)  21:09, 14 February 2018 (UTC)[reply]
@Tom.Reding: It's not hard at all. Put {{All included}} on Category:Infobox templates and that's pretty much all you need to do. Headbomb {t · c · p · b} 21:24, 14 February 2018 (UTC)[reply]
Ah, great! Learn something new every day. I wrote this both for my and DePiep's benefit. It definitely helps to devil's-advocate solve the problem than to knee-jerk object.   ~ Tom.Reding (talkdgaf)  21:53, 14 February 2018 (UTC)[reply]
Does not solve the other flaws. This is just uttering ideas while the original question has not been analysed, let alone implemented. Already I've mentioned half a dozen exceptions on the fly that are not correctly covered, and still no break mode is entered. You really think the development can continue while the format request is still open? Also, I myself am not going into someone's development track (edting a sandbox) without clear understanding of what is aimed. You seriously want to have edits going on (edit warring it could be), while any editor can come by and push an unstabilised version live in 3M pages? I'd expect some more serious template development.
The first question is: which templates should be listed? - DePiep (talk) 17:18, 14 February 2018 (UTC)[reply]
"which templates should be listed?" All infoboxes. Next question? Headbomb {t · c · p · b} 17:45, 14 February 2018 (UTC)[reply]
Once again, please cut down on your arrogance. And once again, you are wrong in your unhelpful statement, interestingly also contradicting your own /sandbox proposal functioning. DePiep - 20:18, 14 February 2018 (UTC)
And once again you are welcomed to offer an example of an infobox template named Infobox Foobar that isn't an infobox template that should be categorized in the category for infobox templates. So again, do you have such an example? I would wager not, because no such infobox exists.Headbomb {t · c · p · b} 20:30, 14 February 2018 (UTC)[reply]
That would no help you out. You are dismissing, arrogantly, each and every serious contribution. My point is, that you are strongly invited to think of tyhose examples yourself. (Enough hints already presents btw). -DePiep (talk) 20:48, 14 February 2018 (UTC)[reply]
Exactly, you offer no example of where any of this fails. So stop holding things up for no reason. Headbomb {t · c · p · b} 20:51, 14 February 2018 (UTC)[reply]
This is not controversial, only you object, for reasons that don't check out. The code works, has been tested, and you can't / straight up refused to come up with any examples of where the code doesn't work. Headbomb {t · c · p · b} 20:49, 14 February 2018 (UTC)[reply]
In a quick look at this discussion, I don't see an explanation of how auto-categorization would be used. I see something about "missing templates"—what is that about? There are over 2560 templates which directly call {{infobox}}. Is the idea to have them all listed in Category:Infobox templates with a sort key based on the template's name? Am I correct in thinking the proposal would auto-categorize Template:Infobox open cluster but would ignore Template:Punctuation marks despite the latter using {{infobox}}? Johnuniq (talk) 01:05, 15 February 2018 (UTC)[reply]