Followed this tutorial: http://blog.redwerks.org/2012/02/28/mediawiki-subskin-tutorial/
Still wrestling with getting my vector subskin to recognize customizations in screen.css.
The myskin.php file contains:
$wgResourceModules['skins.myskin'] = array( 'styles' => array( 'myskin/css/screen.css' => array( 'media' => 'screen' ),
And myskin.skin.php contains:
class SkinMySkin extends SkinVector {
var $skinname = 'myskin', $stylename = 'myskin', $useHeadElement = true; /** * @param $out OutputPage object */ function setupSkinUserCss( OutputPage $out ){ parent::setupSkinUserCss( $out ); $out->addModuleStyles( "skins.myskin" ); } }
Given that the goal of a subskin is to not have to make any changes to core code, what is the line: $out->addModuleStyles( "skins.myskin" ) doing? Isn't that saying to load a module called skins.myskin?
All I want is a vector skin with some custom CSS, but I can't seem to figure this out.
Any help would be greatly appreciated.
Thanks Bill
On 2014-01-20 1:07 PM, Bill Traynor wrote:
Given that the goal of a subskin is to not have to make any changes to core code, what is the line: $out->addModuleStyles( "skins.myskin" ) doing? Isn't that saying to load a module called skins.myskin?
Yes, you put your custom css into that module. And because parent::setupSkinUserCss is called this means that both your module and vector's are loaded.
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://danielfriesen.name/]
On Mon, Jan 20, 2014 at 4:11 PM, Daniel Friesen daniel@nadir-seen-fire.com wrote:
On 2014-01-20 1:07 PM, Bill Traynor wrote:
Given that the goal of a subskin is to not have to make any changes to core code, what is the line: $out->addModuleStyles( "skins.myskin" ) doing? Isn't that saying to load a module called skins.myskin?
Yes, you put your custom css into that module. And because parent::setupSkinUserCss is called this means that both your module and vector's are loaded.
Thanks Daniel,
For what it's worth, I didn't quite glean that fact from your tutorial. Although, I'm sure someone more experienced than me would have.
Does my CSS have to be LESS now in 1.22?
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://danielfriesen.name/]
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
On Mon, 20 Jan 2014 22:15:57 +0100, Bill Traynor btraynor@gmail.com wrote:
Does my CSS have to be LESS now in 1.22?
No, you can just use CSS. Only .less files are considered to contain LESS code and compiled.
(Also, all valid CSS is also valid LESS.)
On Mon, Jan 20, 2014 at 4:11 PM, Daniel Friesen daniel@nadir-seen-fire.com wrote:
On 2014-01-20 1:07 PM, Bill Traynor wrote:
Given that the goal of a subskin is to not have to make any changes to core code, what is the line: $out->addModuleStyles( "skins.myskin" ) doing? Isn't that saying to load a module called skins.myskin?
Yes, you put your custom css into that module. And because parent::setupSkinUserCss is called this means that both your module and vector's are loaded.
Does the module go into Resources.php? Isn't editing Resources.php effectively editing a core MediaWiki file?
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://danielfriesen.name/]
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
On Mon, Jan 20, 2014 at 4:50 PM, Bill Traynor btraynor@gmail.com wrote:
On Mon, Jan 20, 2014 at 4:11 PM, Daniel Friesen daniel@nadir-seen-fire.com wrote:
On 2014-01-20 1:07 PM, Bill Traynor wrote:
Given that the goal of a subskin is to not have to make any changes to core code, what is the line: $out->addModuleStyles( "skins.myskin" ) doing? Isn't that saying to load a module called skins.myskin?
Yes, you put your custom css into that module. And because parent::setupSkinUserCss is called this means that both your module and vector's are loaded.
Does the module go into Resources.php? Isn't editing Resources.php effectively editing a core MediaWiki file?
I see now. The $wgResourceModules statement in myskin.php loads the appropriate module, hence no editing of Resources.php is necessary.
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://danielfriesen.name/]
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
mediawiki-l@lists.wikimedia.org