Topic on Project:Support desk

[RESOLVED] Need to replace redirect file Redirect arrow without text.svg

4
FlightTime (talkcontribs)

I need to locate System Message page or the file within the MediaWiki program that has the Redirect arrow which is displayed on all redirect pages. I have a black .css themed wiki and the redirect file which I think is File:Redirect arrow without text.svg which shows up as so and I would like to replace it with this one. I've asked this question before but either missed the answer or didn't have any. Any help would be greatly appreciated. Thank you

Allen4names (talkcontribs)

Someone else may know how to do this with javascript but I know that Apache can be configured to do this. See the code below.

Alias /w/skins/common/images/redirectltr.png "/var/www/images/redirectltr.png"

You do need to have mod_alias enabled for this to work.

Bawolff (talkcontribs)

Which image to use is hard coded in Article::viewRedirect, so Allen4names' suggestion, or even just plain just replacing the image in skins/common/images/redirectltr.png (just be careful on upgrade) may be a good approach.

JS wise the code to do this would look like:

$( function($) { $( 'div.redirectMsg img' ).attr( 'src', 'http://mynewimage.png' ) } );

However, there might be a couple miliseconds before the js takes affect where the old image is shown. It might also be possible to do something with css which wouldn't have that problem, maybe something like:

div.redirectMsg img { visibility: hidden }
div.redirectMsg { background-image: url( "http://myimage.com/foo.png" ); background-repeat: no-repeat } 

(you might have to play with margins/padding/background-position to make that align right).


It's also possible to write an extension using the ArticleViewCustom hook (but that hook is not in the most ideal place, so you may end up duplicating quite a bit of code) On the pro side, you can directly output an <img> tag with whatever src attribute you want (or any other html you want).

FlightTime (talkcontribs)

Thank you Bawolff, I went with "skins/common/images/redirectltr.png" and after I re-sized the file it worked, not great but better than before :)


UPDATE: - went from this to this Thank you both much better.

Reply to "[RESOLVED] Need to replace redirect file Redirect arrow without text.svg"