Participation in the Muppet Wiki Forums requires a full understanding of the Rules and Etiquette.
Hey gang, some time ago Wikia/Fandom changed the way File description pages work. If you're logged in, you can navigate to File:Kermit-the-frog.jpg and see the upload history of the image, what articles it appears on, etc. If you're logged out, the Fandom software redirects you to the page that's most associated with the image (in this example, probably Kermit the Frog).
Some time before, I created Template:Medialink which allows editors to link to an image from within the body of an article's text, with the expected outcome being that the image is opened in the same lightbox you would get if you clicked on an embedded image. Click on the "liner notes" link on the Alfie the Christmas Tree article to see a demonstration of this.
Given the change in navigation for anonymous users, we may find the Medialink template helpful to use and a less-frustrating experience for readers who might click on a regular File link as in the Kermit example above, and find themselves on an article instead of the image we wanted them to see.
To that end, I just installed a preload feature which should show up on the right-hand side of the edit mode for any page. It's just under the Preview section marked Preload template. Click the drop-down and select the template you want to use (there's only one there right now) and the template will be pre-loaded into the article at the point where you left your cursor. Note that it doesn't work unless you use underscores in place of any spaces that might be in the filename. The syntax looks like this... (edit: syntax has changed; see 17 November 2020 post below)
{{medialink|filename=file_name_requires_underscores_for_spaces|text=Any text here.}}
...you just have to fill in the values for filename and text.
* * *
That's one thing. Here's the second: An even longer time ago, Wikia/Fandom changed the layout of the File pages to what is, in my opinion, a less functional page. Here's a look at the old vs the new layouts:
If you choose, you can enable the old versions again. This plugin can't be enabled wiki-wide, you have to set it up for your personal use if you want to use it. Go to Your Preferences and make sure "Enable personal JavaScript" is checked, then save your changes. Then go to w:Special:MyPage/global.js and add the following code:
importArticles({ type: 'script', articles: [ 'u:dev:OldFilePages/code.js' ] });
Save the page, give the server a few minutes to propagate and bypass the cache, and you should start seeing the legacy version of File description pages again. —Scott (talk) 14:19, August 27, 2020 (UTC)
- Awesome, thanks! Just a heads-up regarding the Medialink template: It doesn't seem to work with files that contain the &-sign, so some file renaming might be in order whenever we come across that problem.
- And you probably meant that the plugin can't be enabled Fandom-wide; it should work wiki-wide for us, right? It does work like a charm. Huzzah! :D —Julian (talk) 15:16, August 27, 2020 (UTC)
- Enabling the old File page layout can't be done wiki-wide for others due to the site's terms of use. If an individual chooses to enable it, they have to do so for themselves with their own customization. If it were up to me, I'd set it as the default for everyone. But, if you make the changes on your global.js file, it will work on every Fandom wiki. Does that make sense?
- As for ampersands and other special characters, it may be possible to replace those with html codes. For example, an ampersand would be & a m p ; (with no spaces). I haven't tested this yet and I don't know if it's easier than just renaming the file. We should try to avoid special characters in filenames anyway. They're find for embedding, but for similar reasons when the software gets confused trying to render it with certain other wiki tools. —Scott (talk) 15:27, August 27, 2020 (UTC)
- I just added some code to Template:Medialink which should make it unnecessary to have to keep adding files to Muppet Wiki:Image chamber so that they don't show up in Special:UnusedFiles when we're doing maintenance. Unlike the previous version, this new method should also make the file page compatible with Special:WhatLinksHere as well. —Scott (talk) 14:24, September 11, 2020 (UTC)
- Just an update that I replaced the medialink template with Template:popup. Completely different code that no longer needs filename= or text= and doesn't require underscores in the file name. —Scott (talk) 00:54, 17 November 2020 (UTC)