Jump to content

Module talk:InfoboxImage: Difference between revisions

From Fifth Empire Wiki
m Archiving 1 discussion(s) to Module talk:InfoboxImage/Archive 1) (bot
Line 9: Line 9:
}}
}}
{{archives|search=yes}}
{{archives|search=yes}}
== 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:
<pre>
|image = [[File:FooBar.jpg|200px]]
</pre>
which according to the new syntax should be:
<pre>
|image = FooBar.jpg
</pre>
In one template ([[Template:Infobox book series]]) I saw this handled thusly:
<pre>
|{{#ifeq:{{str left|{{{image|}}}|1}}|[ |{{main other|[[Category:Pages using deprecated image syntax]]}} }
</pre>
Thoughts? --[[User:Zackmann08|<span style="color:DarkTurquoise;">Zackmann08</span>]] (<sup>[[User_talk:Zackmann08|Talk to me]]</sup>/<sub>[[Special:Contributions/Zackmann08|<span style="color:orange;">What I been doing</span>]]</sub>) 16:15, 31 October 2016 (UTC)
:{{ping|WOSlinker|John of Reading}} you were both helpful to me during a previous discussion regarding this Module. Any thoughts on this? --[[User:Zackmann08|<span style="color:DarkTurquoise;">Zackmann08</span>]] (<sup>[[User_talk:Zackmann08|Talk to me]]</sup>/<sub>[[Special:Contributions/Zackmann08|<span style="color:orange;">What I been doing</span>]]</sub>) 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? -- [[User:WOSlinker|WOSlinker]] ([[User talk:WOSlinker|talk]]) 22:50, 31 October 2016 (UTC)
:::{{ping|WOSlinker}} 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?
<pre>
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....
</pre>
:::I BELIEVE that what that will do is add any page where the image param starts with <code>[[</code> to [[:Category:Pages using deprecated image syntax]]. --[[User:Zackmann08|<span style="color:DarkTurquoise;">Zackmann08</span>]] (<sup>[[User_talk:Zackmann08|Talk to me]]</sup>/<sub>[[Special:Contributions/Zackmann08|<span style="color:orange;">What I been doing</span>]]</sub>) 23:54, 31 October 2016 (UTC)
::::Nearly ok, but only want to add that category to mainspace articles, so need this:
<pre>
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....
</pre>
::::Will add it in a day or two if no objections made. -- [[User:WOSlinker|WOSlinker]] ([[User talk:WOSlinker|talk]]) 08:56, 1 November 2016 (UTC)
:::::{{ping|WOSlinker}} I was so closeee!!! Thanks for the assistance. :-) --[[User:Zackmann08|<span style="color:DarkTurquoise;">Zackmann08</span>]] (<sup>[[User_talk:Zackmann08|Talk to me]]</sup>/<sub>[[Special:Contributions/Zackmann08|<span style="color:orange;">What I been doing</span>]]</sub>) 16:44, 1 November 2016 (UTC)
::::::{{ping|Zackmann08}} I've now updated the module. -- [[User:WOSlinker|WOSlinker]] ([[User talk:WOSlinker|talk]]) 13:53, 4 November 2016 (UTC)


== Adding drafts to tracking category ==
== Adding drafts to tracking category ==

Revision as of 05:31, 25 August 2017

User:MiszaBot/config Template:Archives

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)

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)