Open main menu

Changes

214 bytes added ,  08:29, 5 October 2008
== How to make your own skin ==
A skin generally has it's own directory, plus two setup files.
If you wanted to create a skin called 'Happy' you would have
<pre>
happy
Happy.php
Happy.deps.php
</pre>
in the 'skins' directory.
 
The easiest way to create your skin is to copy the monobook skin and start from there.
 
You can create a skin all by yourself by following the steps provided below:
# Go to your mediawiki directory;
# Copy the monobook directory and name it with the name of your skin, exempli gratia: mywikiskinhappy;# Copy the MonoBook.php file and name it with the name of your skin, exempli gratia: MyWikiSkinHappy.php;# Edit MyWikiSkinHappy.php and change the class name to SkinMyWikiSkin, exempli gratiaSkinHappy: <source lang="php">class SkinMyWikiSkin SkinHappy extends SkinTemplate;</source># In MyWikiSkinHappy.php, change make the other template class to have your skin name together with the word 'Template, exempli gratia': <source lang="php">class MyWikiSkinTemplate HappyTemplate extends QuickTemplate;</source># In MyWikiSkinAlso in Happy.php, make the references to the skin match the names: <source lang="php"> function initPage( &$out ) { SkinTemplate::initPage( $out ); $this->skinname to have a string value of your skin name, exempli gratia: = 'mywikiskinhappy';// matches the physical directory name# In MyWikiSkin.php, make $this->stylename to have a string value of your skin name, exempli gratia: = 'mywikiskinhappy';// matches the physical directory name# In MyWikiSkin.php, make $this->template to have a string value of your skin name properly capitalised with the word Template, exempli gratia: = 'MyWikiSkinTemplateHappyTemplate';// matches the template class name }</source># In your mywikiskin happy directory edit the image and CSS filesuntil your heart is content;# Edit and customise MyWikiSkinHappy.php as you please;# In LocalSettings.php set $wgDefaultSkin = 'mywikiskin'.
== Nice Examples ==
4,558

edits