Module talk:Exist not redirect
Fix for Commons links
{{edit template-protected|answered=yes}}
Per the great idea of Nardog at {{format linkr|Wikipedia:Village_pump_(technical)##ifexist_and_Commons}}, this template can be made to work with File: links!
I've gone ahead and done so in the sandbox, via these four commits:
class="wikitable" style="margin: auto;"
!colspan="3"|[https://en.wikipedia.org/w/index.php?title=Special:ComparePages&page1=Module%3AExistNotRedirect&page2=Module%3AExistNotRedirect%2Fsandbox&diffmode=source Megadiff] |
Revision
! Diff ! Description |
---|
PermaLink/967117490
| [https://en.wikipedia.org/w/index.php?title=Module%3AExistNotRedirect%2Fsandbox&type=revision&diff=967117490&oldid=967095419] | If page to check is in File: namespace, check Media: so Commons links work |
PermaLink/967117978
| [https://en.wikipedia.org/w/index.php?title=Module:ExistNotRedirect/sandbox&diff=next&oldid=967117490] | Make it so Commons links can optionally not be counted via {{para|forcefile}} |
PermaLink/967119638
| [https://en.wikipedia.org/w/index.php?title=Module:ExistNotRedirect/sandbox&diff=next&oldid=967117978] | Make it so people always get back what they asked for. Essential for those doing e.g.: |
PermaLink/967124319
| [https://en.wikipedia.org/w/index.php?title=Module:ExistNotRedirect/sandbox&diff=prev&oldid=967124319] | Improve error message, which was confusing before when link unparseable. |
Please merge therefore Module:ExistNotRedirect/sandbox to Module:ExistNotRedirect, and Template:ExistNotRedirect/sandbox to Template:ExistNotRedirect, being careful, of course, to first remove the {{code|/sandbox}} in the {{code|#invoke}} on line 1. Psiĥedelisto (talk • contribs) please always ping! 11:30, 11 July 2020 (UTC)
Oh, I should probably ping both {{u|BrownHairedGirl}}, who did the awesome work of writing this module in the first place, and {{u|Nardog}}. Psiĥedelisto (talk • contribs) please always ping! 11:31, 11 July 2020 (UTC)
:I feel like this should be achieved by changing
:Sample code. Feel free to revert to your version. Nardog (talk) 11:54, 11 July 2020 (UTC)
::{{re|Nardog}} The test cases are still outputting the same, so I see no reason to. Thanks for helping out! {{=3|8}} Psiĥedelisto (talk • contribs) please always ping! 11:56, 11 July 2020 (UTC)
:Thanks for the ping, @Psiĥedelisto.
:This issue of using "Media:" to check for Commons files is one that I first encountered only a few days ago, when I was trying to figure out how to add maps to bilateral relations categories. I got it working at Template:Foo–Bar relations category/mapname, and am pleased with the result: {{PAGESINCATEGORY:Template Foo–Bar relations category with a locator map}} Foo–Bar relations categories now have a locator map.
:It seems like a great idea to add it to this module, and the code looks fine to me. However, it would be best to see some testcases before going live. Please can you make some testcases?
:Also, note that if this goes live, Template:ExistNotRedirect/doc will need to be updated. --BrownHairedGirl (talk) • (contribs) 11:49, 11 July 2020 (UTC)
::{{re|BrownHairedGirl}} Regarding the test cases, way ahead of you! Template:ExistNotRedirect/testcases Would you like me to update the doc now? Usually I wait for the changes to be live so no one gets confused. Psiĥedelisto (talk • contribs) please always ping! 11:52, 11 July 2020 (UTC)
:::Thanks, @Psiĥedelisto. That looks great.
:::So I say it's ready to go live. And yes I agree that it's best to wait for the changes to be live before updating the /doc. --BrownHairedGirl (talk) • (contribs) 11:57, 11 July 2020 (UTC)
:File:Yes check.svg Done Mdaniels5757 (talk) 18:37, 14 July 2020 (UTC)