Template talk:Remove file prefix

Edit request May 2022
Replace code with

It's simpler and more efficient, and acts identically to this much more complicated code.

INPUT:

OUTPUT:

INPUT:

OUTPUT:

The only reason not to do this is if the Other:Foo.jpg is a desirable returnstate, which, again, can be done with standard template code. Adam Cuerden (talk)Has about 7.8% of all FPs 18:23, 10 May 2022 (UTC)

Tests from doc

 * → Example.svg
 * → Example.svg
 * → Example.svg
 * → Example.svg
 * → Example.svg
 * → Other:Example.svg
 * — xaosflux  Talk 18:40, 10 May 2022 (UTC)
 * → Example.svg
 * → Other:Example.svg
 * — xaosflux  Talk 18:40, 10 May 2022 (UTC)
 * → Other:Example.svg
 * — xaosflux  Talk 18:40, 10 May 2022 (UTC)
 * — xaosflux  Talk 18:40, 10 May 2022 (UTC)

It should be noted that this page, as written, doesn't remove other namespaces, while will:





I can't see any cases where this will matter, and it's arguably undocumented behaviour for this template, but it's worth noting. Adam Cuerden (talk)Has about 7.8% of all FPs 19:09, 10 May 2022 (UTC)


 * About 15 templates use it,, probably if that's all this template actually does, it should just be replaced with the magic word in those cases and deleted. Galobtter (pingó mió) 01:54, 11 May 2022 (UTC)
 * Yeah,I checked all 15 uses, and they're literally all just using some variant of  or the same, but one step removed (like passing it to an image layout template or module). That's a good way to standardise inputs, but the magic word can do that no problem. Adam Cuerden (talk)Has about 7.8% of all FPs 04:21, 11 May 2022 (UTC)
 * FYI: Going slow on this because it has main page links. — xaosflux  Talk 13:15, 11 May 2022 (UTC)
 * ...That would be an excellent reason, aye. Better safe than sorry Adam Cuerden (talk)Has about 7.8% of all FPs 15:07, 11 May 2022 (UTC)
 * 15 transclusions replaced. Let me know if you see any issues &mdash; Martin (MSGJ · talk) 12:09, 27 May 2022 (UTC)
 * It appears that some change made in relation to this discussion may have broken the sidebar at List of proclamations by Donald Trump (2018). Can someone please take a look? – Jonesey95 (talk) 15:19, 27 May 2022 (UTC)
 * It was caused by ! to provide alt text &mdash; Martin (MSGJ · talk) 15:25, 27 May 2022 (UTC)

With no further error reports, seems like this is resolved. The remaining transclusions are direct uses of this template, mainly on talk pages &mdash; Martin (MSGJ · talk) 09:51, 3 June 2022 (UTC)


 * Seems some (most? all?) are from old subst copies of Template:UpcomingPOTD which left horrible code like  at Talk:Martin Van Buren. Gonnym (talk) 19:27, 9 June 2022 (UTC)