Module talk:InfoboxImage
User:MiszaBot/config Template:Archives
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)
- Object per concept (for future). Either it is "Cat:Pages ..." including all, or it is "Cat:Articles ...". -DePiep (talk) 21:00, 15 December 2016 (UTC)
- Template:Ping I'm actually going to undo this change. After a few days of it being there I've realized that all it does is flood the category with Drafts that are likely never to become articles. Of the 75 or so pages I've fixed in the draft space, at least 50 of them were outright spam that would never pass WP:AFC. I think it is fine to just catch the few that slip through once they hit the main article space. --Zackmann08 (Talk to me/What I been doing) 19:18, 20 December 2016 (UTC)
- Object per concept (for future). Either it is "Cat:Pages ..." including all, or it is "Cat:Articles ...". -DePiep (talk) 21:00, 15 December 2016 (UTC)