- MediaWiki Skins Design
- Richard Carter
- 381字
- 2021-05-28 17:39:09
Initializing Your Skin
In order to view changes that have made to your skin's design, you need to make a few changes to MediaWiki. We need to inform MediaWiki that we want to view the wiki's content using a different skin from the default, that is, MonoBook.
CSS and Image Files
You will need to create a new directory in the skins
directory, such as skins/yourskinname/
, within your MediaWiki installation directory, where yourskinname
is the name of your new MediaWiki skin.
To keep things simple, we will call our new skin jazzmeet
, and store it in the skins/jazzmeet/ directory
. The primary Cascading Style Sheets (CSS) file for each skin is usually in this skin
directory and is known as main.css
. But it can be changed in the header of your skin's PHP template. For example, the CSS file for our new skin should be located at skins/jazzmeet/main.css
within our wiki's installation directory.
shared.css
in skins/common/
contains styles that are used by all of the skins. We can easily ignore this, as we can overwrite any unwanted style in main.css
.
PHP Template
We need to carry out the following steps before we can start skinning MediaWiki:
- Create a PHP file named
YourSkinName.php
. in theskins/
directory. - Open this file and edit the line that reads-
class SkinMonoBook extends SkinTemplate
to readclass YourSkinName extends SkinTemplate
, but replaceYourSkinName
with the name of your new skin. - Find the line that reads
class MonoBookTemplate extends QuickTemplate
; to readclass YourSkinNameTemplate extends QuickTemplate
; Again, replace YourSkinName with the name of your new skin. - Finally, you need to inform MediaWiki about your skin by inserting the following into the file:
$this->skinname = 'yourskinname'; $this->stylename = 'yourskinname'; $this->template = 'YourSkinNameTemplate';
Be sure to replace your skin name with the directory's name (for example, $this->skinname = 'jazzmeet'
), and YourSkinName
with the name of your new skin as it is in the PHP filename.
- 持續(xù)演進(jìn)的Cloud Native:云原生架構(gòu)下微服務(wù)最佳實(shí)踐
- Final Cut Pro X 影視包裝剪輯完全自學(xué)教程(培訓(xùn)教材版)
- Word-Excel-PowerPoint 2010三合一從新手到高手(超值版)
- Oracle Business Intelligence : The Condensed Guide to Analysis and Reporting
- Celtx: Open Source Screenwriting Beginner's Guide
- FreeSWITCH 1.0.6
- 數(shù)字孿生體:第四次工業(yè)革命的通用目的技術(shù)
- Moldflow 2021模流分析從入門到精通(升級(jí)版)
- Cassandra High Performance Cookbook
- OpenAM
- 中文版Photoshop 2020基礎(chǔ)培訓(xùn)教程
- 3ds Max三維動(dòng)畫制作項(xiàng)目式教程
- 中老年學(xué)微信(圖解大字版)
- SOLIDWORKS 2023中文版機(jī)械設(shè)計(jì)從入門到精通
- 手把手教你學(xué)成PPT高手