On Mon, 23 Jul 2012 15:02:16 -0700, Adm linuxloverstaff@gmail.com wrote:
Hello, I have allready programmed mediawiki extensions but no skins.
Read over the tutorials I have on skinning MediaWiki 1.18+
http://blog.redwerks.org/2012/02/08/mediawiki-skinning-tutorial/ http://blog.redwerks.org/2012/02/28/mediawiki-subskin-tutorial/
I have 2 issues:
- In the extension I can made a file ext.i18n.php and then use:
$wgExtensionMessagesFiles['ext'] = dirname( __FILE__ ) . 'ext.i18n.php'; wfMsg('something');
With skins it doesn't work. Can you help me?
The tutorial covers this.
You should consider the skins/SkinName.php pattern deprecated, and only use it for built-in skins now.
Construct your skins using the pattern: skins/myskinname/myskinname.php skins/myskinname/myskinname.i18n.php skins/myskinname/MySkinName.skin.php
The naming of MySkinName.skin.php doesn't really matter, but that file will be the equivalent of what you used to put in skins/MySkinName.php. With this pattern you'll have a skins/myskinname/myskinname.php file which you can add the i18n file to and setup the autoloading and resource loader modules. Just like an extension you'll install your skin by using `require_once( "$IP/skins/myskinname/myskinname.php" );`... for now.
- How to get the full url of a skin image?
Put as many images as possible inside of your css files instead of in the output. ResourceLoader handles your images extremely well if you put them in the module css.
If you absolutely must use a path inside your source you can use `$tpl->getSkin()->getSkinStylePath( 'myimage.png' )` to get the absolute path to 'skins/myskinname/myimage.png' (ie: the name is relative to the base of your skin folder) and echo that into your markup (PLEASE do use the Html:: class or escape it with htmlspecialcharacters if you echo it directly).
thanks all! regards, ADM