Jump to content

Topic on User talk:Dantman

Problem with modified Vector skin

14
Lieutenant S. Reznov (talkcontribs)

I used the directions here http://blog.redwerks.org/2012/02/28/mediawiki-subskin-tutorial/ to create a modified Vector skin here http://en.sturmkrieg.com but the CSS doesn't seem to work. I copied the Vector.css and some of the Common.css wiki pages into the screen.css file, and for some reason, only some of the CSS seems to work, as can be seen here http://en.sturmkrieg.com/index.php?title=Sturmkrieg_Wiki&useskin=sturmkrieg

This post was posted by Lieutenant S. Reznov, but signed as Inquisitor Ehrenstein.

Dantman (talkcontribs)

Try adding 'skin.vector' to the dependencies of your skins RL module. And use addModules instead of addModuleStyles.

Lieutenant S. Reznov (talkcontribs)

Where is the RL module? Is that in the skin files or one of the core files?

EDIT

I found this in sturmkrieg.php

$wgResourceModules['skins.sturmkrieg'] = array(
	'styles' => array(
		'sturmkrieg/screen.css' => array( 'media' => 'screen' ),
	),
	'remoteBasePath' => &$GLOBALS['wgStylePath'],
	'localBasePath' => &$GLOBALS['wgStyleDirectory'],
);

Where should I add it?

This post was posted by Lieutenant S. Reznov, but signed as Inquisitor Ehrenstein.

Dantman (talkcontribs)

Make that:

$wgResourceModules['skins.sturmkrieg'] = array(
	'styles' => array(
		'sturmkrieg/screen.css' => array( 'media' => 'screen' ),
	),
	'dependencies' => 'skin.vector',
	'remoteBasePath' => &$GLOBALS['wgStylePath'],
	'localBasePath' => &$GLOBALS['wgStyleDirectory'],
);

Btw, your url shouldn't have []'s in it.

And remember to update addModuleStyles to addModules.

Lieutenant S. Reznov (talkcontribs)

Thanks. I added the 'dependencies' => 'skin.vector', line. Are you say this line $wgResourceModules['skins.sturmkrieg'] = array( should not have the [] in it?

EDIT

I have this

$wgResourceModules['skins.sturmkrieg'] = array(
	'styles' => array(
		'sturmkrieg/screen.css' => array( 'media' => 'screen' ),
	),
	
	'remoteBasePath' => &$GLOBALS['wgStylePath'],
	'localBasePath' => &$GLOBALS['wgStyleDirectory'],
	'dependencies' => 'skin.vector'
);

It doesn't seem to work.

This post was posted by Lieutenant S. Reznov, but signed as Inquisitor Ehrenstein.

Dantman (talkcontribs)

You've done something strange. Your skin isn't even loading 'skins.sturmkrieg' anymore.

Lieutenant S. Reznov (talkcontribs)

I changed addModuleStyles to addModules. For some reason, it doesn't load any of the sturmkrieg/screen.css when I set that. I'm guessing maybe I should change it back to useModuleStyles? I'll set it back to that for now. When it does that, some of the CSS for the new skin loads, but most of it seems to be the Vector CSS.

I'll update this code here, that lists the code for the skin.

This post was posted by Lieutenant S. Reznov, but signed as Inquisitor Ehrenstein.

Lieutenant S. Reznov (talkcontribs)

Do you know what to do when only some of the CSS is loading? useModuleStyles seems to load some of the CSS from the new skin, while useModules doesn't use any of it.

This post was posted by Lieutenant S. Reznov, but signed as Inquisitor Ehrenstein.

Lieutenant S. Reznov (talkcontribs)
Dantman (talkcontribs)

Please upgrade, 1.17 is EOL. And lots of the skinning stuff is not available.

Lieutenant S. Reznov (talkcontribs)
Dantman (talkcontribs)

I was saying that the 'url' in $wgExtensionCredits['skin'][] shouldn't have '[]' around the url. It's a plain url, not wikisyntax expecting external link syntax.

Lieutenant S. Reznov (talkcontribs)
Lieutenant S. Reznov (talkcontribs)

I have this for the files:

sturmkrieg.php
<?php
/**
 * Sturmkrieg skin
 *
 * @file
 * @ingroup Skins
 * @author Sasha Ehrenstein (http://www.sturmkrieg.de/User:Inquisitor_Ehrenstein)
 */

if( !defined( 'MEDIAWIKI' ) ) die( "This is an extension to the MediaWiki package and cannot be run standalone." );

$wgExtensionCredits['skin'][] = array (
	'path' => __FILE__,
	'name' => 'Sturmkrieg',
	'url' => "[http://www.sturmkrieg.com]",
	'author' => '[http://www.sturmkrieg.de/User:Inquisitor_Ehrenstein Inquisitor Ehrenstein]',
	'descriptionmsg' => 'mywiki-desc',
);

$wgValidSkinNames['sturmkrieg'] = 'Sturmkrieg';
$wgAutoloadClasses['SkinSturmkrieg'] = dirname(__FILE__).'/Sturmkrieg.skin.php';
$wgExtensionMessagesFiles['Sturmkrieg'] = dirname(__FILE__).'/Sturmkrieg.i18n.php';

$wgResourceModules['skins.sturmkrieg'] = array(
	'styles' => array(
		'sturmkrieg/screen.css' => array( 'media' => 'screen' ),
	),
	'remoteBasePath' => &$GLOBALS['wgStylePath'],
	'localBasePath' => &$GLOBALS['wgStyleDirectory'],
);
Sturmkrieg.i18n.php
<?php
/**
 * Internationalization file for skin Sturmkrieg.
 *
 * @file
 * @ingroup Skins
 */

$messages = array();

/** English
 * @author Inquisitor Ehrenstein
 */
$messages['en'] = array(
	'skinname-sturmkrieg' => "Sturmkrieg",
	'sturmkrieg-desc' => "The default skin of Sturmkrieg.",
);
Sturmkrieg.skin.php
<?php
/**
* Skin file for skin Sturmkrieg.
*
* @file
* @ingroup Skins
*/

require_once( dirname( __FILE__ ) . '/../Vector.php' );

/**
 * SkinTemplate class for Sturmkrieg skin
 * @ingroup Skins
 */
class SkinSturmkrieg extends SkinVector {

	var $skinname = 'sturmkrieg', $stylename = 'sturmkrieg';

	/**
	 * @param $out OutputPage object
	 */
	function setupSkinUserCss( OutputPage $out ){
		parent::setupSkinUserCss( $out );
		$out->addModuleStyles( "skins.sturmkrieg" );
	}

}

This post was posted by Lieutenant S. Reznov, but signed as Inquisitor Ehrenstein.

Reply to "Problem with modified Vector skin"