How to use Vector features for new skin?

Jump to: navigation, search

I'de love to know the answer to this too.. It must be a simple switch somewhere that sets the Vector extension to rely upon the Vector skin, but i can't see it anywhere in the code upon first look.

Ashimema (talk)18:49, 22 March 2012

The one I know of is in Vector.hooks.php, function beforePageDisplay, which looks like this:

public static function beforePageDisplay( $out, $skin ) {
        if ( $skin instanceof SkinVector ) {
                // Add modules for enabled features

Starting on line 96 in MW 1.17. Obviously, you need to change SkinVector to the appropriate class for your skin... but I haven't tested it personally.

Of course, there might be other hidden ones...

FreedomFighterSparrow (talk)21:27, 22 March 2012

Based on this suggestion, I tried something different. It seems like you should be able to safely extend the Vector classes when you declare the classes of your new skin, for example:

class SkinNEWSKIN extends SkinVector
class NEWSKINTemplate extends VectorTemplate

Rather than extending SkinTemplate and BaseTemplate respectively. That should have the same effect as the above suggestion without requiring that you make modifications to the Vector extension (which may be overwritten in subsequent updates, etc).

So far on my wiki, it's working exactly as expected without a hitch.

Kryand (talk)21:29, 12 February 2013

Yes, that definitely seems like a better solution :-) BTW, if you haven't seen it already, there's a tutorial by Daniel Friesen on doing that.

(I believe I tried something like it when Vector first appeared, but I was too new to MediaWiki and it just didn't work. Anyway, my current skin is so different from Vector that there's no point in it, anymore...)

FreedomFighterSparrow (talk)18:41, 18 February 2013