Module talk:InfoboxImage
User:MiszaBot/config Template:Archives
"title=" parameter: relevance?
How relevant is it to support the |title= parameter, especially next to the |alt= parameter? (i.e., the css-tiles a.k.a. mousehover-text; |alt=-value is used when missing).
I get the 'css-title' angle, but not in WP:EIS and not in WP:FILE we have an option for that. So when adding a plain file to an article (outside of infobox), the option 'css-title' is not available. My question starts from {{Chembox}}, which has 400+ parameters. I'd like to simplify this list, eg by removing this title parameter (pushing the alt parameter). -DePiep (talk) 19:58, 25 May 2016 (UTC)
- There is an archived posting at Module talk:InfoboxImage/Archive 1#Alt text versus title text which discusses the differences. Also, the text assigned to the
|title=parameter is placed into the normal image syntax (referred to as Caption at WP:EIS), so: {{#invoke:InfoboxImage|InfoboxImage|image=Example.png|alt=Alt text|title=Title text}}- will output the following (which could be placed into an article, inside or outside an infobox):
[[File:Example.png|frameless|alt=Alt text|Title text]].- An example of using both fields (with "thumb" instead of "frameless") can be found at WP:FILE#Using files. -- Zyxw (talk) 04:03, 14 July 2016 (UTC)
- Template:U thanks, my question solved. So in my case, parameter title is redundant to parameter caption. (btw, mistake in my OP: 'title' in InfoboxImage is not the same as css-title in a tag like
<span title="css-title example">. Glad it did not distract you). -DePiep (talk) 05:32, 14 July 2016 (UTC)
- Template:U thanks, my question solved. So in my case, parameter title is redundant to parameter caption. (btw, mistake in my OP: 'title' in InfoboxImage is not the same as css-title in a tag like
- Glad that helped. I assume that "Caption" was used in WP:EIS because it is displayed as a caption when using "thumb". However, "title" more accurately describes it when using "frameless", because if you look at the generated HTML it is used as a title attribute in the anchor tag that surrounds the image tag:
<a href="/wiki/File:Example.png" class="image" title="Title text"><img alt="Alt text" src= ...-- Zyxw (talk) 06:28, 14 July 2016 (UTC)
- Glad that helped. I assume that "Caption" was used in WP:EIS because it is displayed as a caption when using "thumb". However, "title" more accurately describes it when using "frameless", because if you look at the generated HTML it is used as a title attribute in the anchor tag that surrounds the image tag:
- Sorry, this is getting into a headache.
- First of all, WP:EIS shows the horror of interacting parameters, thereby changing their semantics. Like this: "If the type is 'frameless', the caption value moves & changes into title (mousehover) text" (I conclude after studying the doc). No end editor should be loaded with this illogic. No software encoder should allow such change of meaning & usage.
- Next, this Module:InfoboxImage adds to these parameter mixups by suggesting
|title=replaces [[File:|...|Caption text]] (see this /doc section, first paragraph saying[[File:..|{{{TitleText}}}]]-- the position where WP:EIS says Caption text is expected). There is no gain in confusing those two concepts in this module either. - To support my point, I quote from your 2014 link by Template:U: "To give a specific example, MediaViewer displays title text as the image caption; ..." (ie, another mixup variant, this time by MediaViewer). Also, you (Zyxw) wrote above: "Also, the text assigned to the |title= parameter is placed into the normal image syntax (referred to as Caption at WP:EIS)". This 'title' is named 'Caption' in WP:EIS?
- Now there is no use in explaining the 'logic' behind this once more. I'd prever we don't change parameter semantics. And this module should not deviate from [[File:...]] documentation (itself to be improved).
- As for understanding this module, I can say: Module:InfoboxImage does not have the concept or option of a Caption (meaning: text below an image). Such text is to be entered in the {{Infobox}} template using separate
|caption=Caption text, next to (not inside)|image={{#invoke:InfoboxImage|...}}. - On the other hand, if one enters
|image=directly by [[File:..]], the caption option is available in the File:-settings. - -DePiep (talk) 09:32, 14 July 2016 (UTC)
Category:Pages using infoboxes with thumbnail images
Hoping to get some help. I am trying to clean out Category:Pages using infoboxes with thumbnail images. Obviously this is a very tedious project but it is made all the more frustrating by the fact that new pages keep getting added to the category. I'm wondering, is there some way to add something to this module that will display an error in preview mode when people try to add new thumbnails? Any thoughts? --Zackmann08 (Talk to me/What I been doing) 03:15, 16 July 2016 (UTC)
- Template:Ping Any thoughts? --Zackmann08 (Talk to me/What I been doing) 00:13, 17 July 2016 (UTC)
- Probably using the REVISIONID feature similar to Module:Check_for_unknown_parameters it can be done. I'll have to see what I can do. -- WOSlinker (talk) 08:04, 17 July 2016 (UTC)
- Template:Ping fantastic! I've not done any work with modules before, and don't have the necessary permissions to edit this page, but if I can be useful in anyway, please let me know. I do have a background in computer programming and would be happy to pair with you on making this happen. Thanks for taking some time to look into this! As a side note, as I continue to willow down this category, it would be great for it to ultimately throw an error on the actual page. Right now that doesn't make sense as there are over 3,000 pages in the category... But thought for the future. --Zackmann08 (Talk to me/What I been doing) 22:15, 17 July 2016 (UTC)
- Template:Ping I'd like to amend my request. The category is now just over 1,500. My goal is to have the category at 0 by the end of the week. What would be great is to just disallow the use of thumbs in infoboxes entirely. Either have it throw an {{error}} or just remove 'thumb' and force the image to appear inline. Template:Ping you've been active on this project as well. Thoughts? --Zackmann08 (Talk to me/What I been doing) 19:19, 19 July 2016 (UTC)
- Would probably be better to replace thumb and thumbnail with frameless rather than just removing it. I've updated the code in Module:InfoboxImage/sandbox. -- WOSlinker (talk) 20:26, 19 July 2016 (UTC)
- Template:Re I'm not convinced by the sandbox change. If the
[[File:...|thumb|...]]includes a caption, changing from "thumb" to "frameless" makes the caption disappear, which would be confusing. It would still need a tracking category so that someone can move the caption into the proper "caption" parameter. -- John of Reading (talk) 21:21, 19 July 2016 (UTC)- How about with the cat added back but still changing thumb to frameless ? -- WOSlinker (talk) 22:00, 19 July 2016 (UTC)
- That would be better than the current sandbox code. However, I'd still prefer the current live code, adding the category but leaving the file specification untouched. Another confusing scenario: the caption is visible in a draft article or user subpage, but it disappears when the page is moved to mainspace. -- John of Reading (talk) 04:59, 20 July 2016 (UTC)
- How about with the cat added back but still changing thumb to frameless ? -- WOSlinker (talk) 22:00, 19 July 2016 (UTC)
- Template:Re I'm not convinced by the sandbox change. If the
- Would probably be better to replace thumb and thumbnail with frameless rather than just removing it. I've updated the code in Module:InfoboxImage/sandbox. -- WOSlinker (talk) 20:26, 19 July 2016 (UTC)
- Probably using the REVISIONID feature similar to Module:Check_for_unknown_parameters it can be done. I'll have to see what I can do. -- WOSlinker (talk) 08:04, 17 July 2016 (UTC)
Template:Deindent What about just throwing an error? Force the user to fix it themselves? --Zackmann08 (Talk to me/What I been doing) 05:30, 20 July 2016 (UTC)
- New users won't necessarily be able to fix it themselves, even if they manage to find the template documentation. -- John of Reading (talk) 07:15, 20 July 2016 (UTC)
- Template:Ping You make a valid point, I'm just curious at what point do we stop holding new users hands and force them to learn? Playing devils advocate here. Is there a middle ground? The error can also link to WP:INFOBOXIMAGE which can be expanded to explain how to resolve the issue if you feel it needs to be. I've been continuing to monitor the category and I would say an average of 50 new pages fall into it each day. --Zackmann08 (Talk to me/What I been doing) 23:53, 25 July 2016 (UTC)
Pages using deprecated image syntax
Hello all. I'm not too experienced with editing Modules but I wanted to see if there was a way to get Category:Pages using deprecated image syntax added to this. Essentially a check for:
|image = [[File:FooBar.jpg|200px]]
which according to the new syntax should be:
|image = FooBar.jpg
In one template (Template:Infobox book series) I saw this handled thusly:
|{{#ifeq:{{str left|{{{image|}}}|1}}|[ |{{main other|[[Category:Pages using deprecated image syntax]]}} }
Thoughts? --Zackmann08 (Talk to me/What I been doing) 16:15, 31 October 2016 (UTC)
- Template:Ping you were both helpful to me during a previous discussion regarding this Module. Any thoughts on this? --Zackmann08 (Talk to me/What I been doing) 18:57, 31 October 2016 (UTC)
- Are you wanting it as an option within this module or do you want it on all the time? -- WOSlinker (talk) 22:50, 31 October 2016 (UTC)
- Template:Ping my thought was to have it on all the time much like Category:Pages using infoboxes with thumbnail images. Please bare in mind that I have never written a Module so I'm not 100% certain of the syntax, but I would imagine that taking lines 162-168 and making them the following would work?
- Are you wanting it as an option within this module or do you want it on all the time? -- WOSlinker (talk) 22:50, 31 October 2016 (UTC)
if mw.ustring.sub(image,1,2) == "[[" then
-- search for thumbnail images and add to tracking cat if found
if mw.title.getCurrentTitle().namespace == 0 and (mw.ustring.find(image, "|%s*thumb%s*[|%]]") or mw.ustring.find(image, "|%s*thumbnail%s*[|%]]")) then
return image .. "[[Category:Pages using infoboxes with thumbnail images]]";
else
return image .. "[[Category:Pages using deprecated image syntax]]";
end
elseif....
- I BELIEVE that what that will do is add any page where the image param starts with
[[to Category:Pages using deprecated image syntax. --Zackmann08 (Talk to me/What I been doing) 23:54, 31 October 2016 (UTC)- Nearly ok, but only want to add that category to mainspace articles, so need this:
- I BELIEVE that what that will do is add any page where the image param starts with
if mw.ustring.sub(image,1,2) == "[[" then
-- search for thumbnail images and add to tracking cat if found
if mw.title.getCurrentTitle().namespace == 0 and (mw.ustring.find(image, "|%s*thumb%s*[|%]]") or mw.ustring.find(image, "|%s*thumbnail%s*[|%]]")) then
return image .. "[[Category:Pages using infoboxes with thumbnail images]]";
elseif mw.title.getCurrentTitle().namespace == 0 then
return image .. "[[Category:Pages using deprecated image syntax]]";
else
return image;
end
elseif....
- Will add it in a day or two if no objections made. -- WOSlinker (talk) 08:56, 1 November 2016 (UTC)
- Template:Ping I was so closeee!!! Thanks for the assistance. :-) --Zackmann08 (Talk to me/What I been doing) 16:44, 1 November 2016 (UTC)
- Template:Ping I've now updated the module. -- WOSlinker (talk) 13:53, 4 November 2016 (UTC)
- Template:Ping I was so closeee!!! Thanks for the assistance. :-) --Zackmann08 (Talk to me/What I been doing) 16:44, 1 November 2016 (UTC)
- Will add it in a day or two if no objections made. -- WOSlinker (talk) 08:56, 1 November 2016 (UTC)
Adding drafts to tracking category
Hello all. I wanted to see if we could revise this to add pages in the draft namespace to Category:Pages using infoboxes with thumbnail images. It would help catch these before they get pushed to the main space. Doesn't make a huge difference but would be nice. :-) --Zackmann08 (Talk to me/What I been doing) 17:21, 15 December 2016 (UTC)
- Template:Done Did it a couple of hours ago, but then forgot to reply. -- WOSlinker (talk) 20:43, 15 December 2016 (UTC)