Topic on Extension talk:Vector

How to use Vector features for new skin?

9
Fxk2 (talkcontribs)

Hi,

we created a nice new skin for our Wiki - and now we want to integrate the simplesearch-feature, as well as the collapsible sidebar. Any advice on how we can that?

Would it be an idea to copy the Vector-Extension, rename it after our new Skin or something similar? Cheers --Fxk2 13:38, 20 December 2011 (UTC)

Pastakhov (talkcontribs)
194.80.246.1 (talkcontribs)

That's not what he asked. He wants to know how to use the Vector extension with a skin that is based on Vector.

Ashimema (talkcontribs)

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.

FreedomFighterSparrow (talkcontribs)

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...

Kryand (talkcontribs)

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.

FreedomFighterSparrow (talkcontribs)

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...)

109.226.59.54 (talkcontribs)

I've been searching this for days, until I found this talk here. I am also very new to mediawiki. Thanks to you, I found this new tutorial. So, thanks for the help, and I hope you'll get to see this because it's an old thread.

109.226.59.54 (talkcontribs)

After reading the above tutorial, and trying it, I can't make it work. I also found THIS post which is exactly what happens to me with V1.21

I wonder if there's an easy way to simply "inherit" the Vector theme and only make visual changes to the .css without learning and changing the inner parts of an installed mediawiki.

Reply to "How to use Vector features for new skin?"