0
votes

On my site, I would like to change the code so that whenever a user's page is linked, (in the personal links in the upper right, after recent changes, anywhere really), instead of navigating to a user's page on the wiki, it directs to another completely separate page. The link itself I have worked out. I just need to find exactly what I need to edit in the MediaWiki code.

Similarly, I'd like to know where the code is for displaying links to talk pages as well.

1
At first I tried looking the vector theme, but then I realized it's more likely to be in some .php file in the general mediawiki folders. I really have no idea where to start looking. - TJ Barber

1 Answers

1
votes

You should not hack the MediaWiki core for this. It will make your wiki difficult or impossible to maintain and keep updated.

What you are probably looking for is a hook, that lets you write an extension to modify the behaviour of some internal links. Your best shot is probably InternalParseBeforeLinks or InternalParseBeforeSanitize. This will, of course, not prevent anyone from visiting the user pages and talk pages, but it will change the behaviour of internal links.

For a very simple example of an extension using this hook see e.g. https://www.mediawiki.org/wiki/Extension:TernaryPipedLinks

To change the behaviour of links in the wiki's header, etc, you will have to write your own custom skin, or modify an existing one. That is a much larger task. And users will still be able to visit the said pages, of course.

edit: The suggestion from svick in the comments would probably make a lot more sense, in your case