Hi
I just can't figure out how to make an if expression on skin/template file that checks if you are on main page or not - and after that writes some html. The problem seems to be that I can't find the freakin variable that contains the name of current page or article.
I searched the entire forum and also the archive of this list. There doesn't seem to be any reasonable answer to this, only lots of questions similar to mine. But I guess somebody must know, after all somebody coded this... right? :)
Greetings, Teemu
http://meta.wikimedia.org/wiki/Help:Magic_words
On 10/23/07, Teemu Lantta teemu.lantta@helsinki.fi wrote:
Hi
I just can't figure out how to make an if expression on skin/template file that checks if you are on main page or not - and after that writes some html. The problem seems to be that I can't find the freakin variable that contains the name of current page or article.
I searched the entire forum and also the archive of this list. There doesn't seem to be any reasonable answer to this, only lots of questions similar to mine. But I guess somebody must know, after all somebody coded this... right? :)
Greetings, Teemu
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
On 10/23/07, Teemu Lantta teemu.lantta@helsinki.fi wrote:
I just can't figure out how to make an if expression on skin/template file that checks if you are on main page or not - and after that writes some html. The problem seems to be that I can't find the freakin variable that contains the name of current page or article.
You might be looking for something like:
$this->data['title'] == 'Main Page')
Joshua
Teemu Lantta wrote :
I just can't figure out how to make an if expression on skin/template file that checks if you are on main page or not - and after that writes some html. The problem seems to be that I can't find the freakin variable that contains the name of current page or article.
you can use this :
<?php //check whether the page is main page in any language if ( $this->data['title'] == wfMsgForContent('mainpage') ) { ?>
some html here
<?php } else { ?>
some html here
<?php } ?>
mediawiki-l@lists.wikimedia.org