Hello everyone,
I want to modify the default Vector theme that comes with 1.21.1. But before I do that I want to rename it. I want to name it nighttime. I created a folder called nighttime and copied all the vector files into it. Then I made a copy of Vector.php and called it Nighttime.php. I then modified the appropriate contents of Nighttime.php as follows...
--------------- class SkinNighttime extends SkinTemplate {
protected static $bodyClasses = array( 'vector-animateLayout' );
var $skinname = 'nighttime', $stylename = 'nighttime', $template = 'NighttimeTemplate', $useHeadElement = true;
...
unction setupSkinUserCss( OutputPage $out ) { parent::setupSkinUserCss( $out ); $out->addModuleStyles( 'skins.nighttime' );
...
class NighttimeTemplate extends BaseTemplate { -----------------
You can see what the site looks after I renamed everything at http://beta.dropshots.com/j00100/media/75373447 It appears as if there is no formatting.
I did some searching on Google but everything I found dealt with older versions. Does anyone know how to rename Vector and have it working on 1.21?
Thanks
The skinning tutorial is: https://www.mediawiki.org/wiki/Manual:Skinning/Tutorial
And for creating derivative skins use this technique: http://blog.redwerks.org/2012/02/28/mediawiki-subskin-tutorial/
New skins should be created using the skinname/skinname.php patterns in those tutorials.
Mid-term plans for skinning are likely going to include dropping support for custom/3rd-party skins which add php files directly to skins/ instead of using autoloading and a file to require like how extensions do it.
10 Июнь 2013 г. 9:15:44 пользователь (j00100@mail.com) написал:
Hello everyone, I want to modify the default Vector theme that comes with 1.21.1. But before I do that I want to rename it. I want to name it nighttime. I created a folder called nighttime and copied all the vector files into it. Then I made a copy of Vector.php and called it Nighttime.php. I then modified the appropriate contents of Nighttime.php as follows...
class SkinNighttime extends SkinTemplate { protected static $bodyClasses = array( 'vector-animateLayout' ); var $skinname = 'nighttime', $stylename = 'nighttime', $template = 'NighttimeTemplate', $useHeadElement = true;
... unction setupSkinUserCss( OutputPage $out ) { parent::setupSkinUserCss( $out ); $out->addModuleStyles( 'skins.nighttime' ); ... class NighttimeTemplate extends BaseTemplate {
You can see what the site looks after I renamed everything at http://beta.dropshots.com/j00100/media/75373447 It appears as if there is no formatting. I did some searching on Google but everything I found dealt with older versions. Does anyone know how to rename Vector and have it working on 1.21? Thanks
Also, if you change skin name you may encounter some incompatibilities, for example Extension:VisualEditor has a whitelist for "supported skin names":
class VisualEditorHooks { /** List of skins VisualEditor integration supports */ protected static $supportedSkins = array( 'vector', 'apex', 'monobook' );
That's why I started to modify Vector directly, instead of copying it according to Daniel Friesen tutorial. Dmitriy
On 2013-06-10 3:02 AM, "Dmitriy Sintsov" questpc@rambler.ru wrote:
10 Июнь 2013 г. 9:15:44 пользователь (j00100@mail.com) написал:
Hello everyone, I want to modify the default Vector theme that comes with 1.21.1. But
before I do that I want to rename it. I want to name it nighttime. I created a folder called nighttime and copied all the vector files into it. Then I made a copy of Vector.php and called it Nighttime.php. I then modified the appropriate contents of Nighttime.php as follows...
class SkinNighttime extends SkinTemplate { protected static $bodyClasses = array( 'vector-animateLayout' ); var $skinname = 'nighttime', $stylename = 'nighttime', $template = 'NighttimeTemplate', $useHeadElement = true;
... unction setupSkinUserCss( OutputPage $out ) { parent::setupSkinUserCss( $out ); $out->addModuleStyles( 'skins.nighttime' ); ... class NighttimeTemplate extends BaseTemplate {
You can see what the site looks after I renamed everything at
http://beta.dropshots.com/j00100/media/75373447 It appears as if there is no formatting.
I did some searching on Google but everything I found dealt with older
versions. Does anyone know how to rename Vector and have it working on 1.21?
Thanks
Also, if you change skin name you may encounter some incompatibilities,
for example Extension:VisualEditor has a whitelist for "supported skin names":
class VisualEditorHooks { /** List of skins VisualEditor integration supports */ protected static $supportedSkins = array( 'vector', 'apex',
'monobook' );
Visual editor should really use a hook for that....
----
The reason you got no formatting is probably due to renaming thr line: $out->addModuleStyles( 'skins.nighttime' );
Without creating a skins.nighttime module. This should all be covered in Daniel's link.
-bawolff
wikitech-l@lists.wikimedia.org