Module talk:InfoboxImage
User:MiszaBot/config Template:Archives
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)
Bug when sizedefault is just a number
I added the same "px adding" logic for sizedefault so |sizedefault=250 is the same as |sizedefault=250px. please revert and let me know if this causes a problem, but all the examples look fine. Frietjes (talk) 14:52, 12 March 2017 (UTC)
How to suppress "100px" when image is specified but does not exist
In the last example in the documentation, a nonexistent file shows "100px" in red if a file is specified but does not exist. Is there a way to track this problem, display an error message, suppress any display entirely, or some combination of those? I encountered this problem here and was unable to fix it by changing the infobox. It is probably better to solve the problem here rather than in every template that calls this module. – Jonesey95 (talk) 22:52, 24 August 2017 (UTC)