I hope this thread finds everyone of you healthy.
I am creating a MediaWiki skin from scratch. The homepage design is very different then the article page, actaully none of the elements of the homepage exists on the article page.
So i was wondering how to skin article page seperately, i mean is there any file i have to create for article page to design it differently?
Thanks in advance for your time to answer my question.
The same skin will be called for the mainpage and other pages, but it is easy enough to use separate code in your skin class. Just check in your skin if $title->isMainPage()
is true, and then execute whatever code you want to use to render the main page. Your skin will look something like this:
<?php
class MySkinTemplate extends BaseTemplate {
public function execute() {
/* Print out header */
$this->html( 'headelement' );
$title = $this->getSkin()->getTitle();
if ($title->isMainPage()){
echo( '<h1>Welcome to the main page!</h1>' );
$this->html( 'bodytext' );
} else {
echo( '<h1>' );
$this->html( 'title' );
echo( '</h1>' );
$this->html( 'bodytext' );
}
$this->printTrail();
}
}
Se also: