A (probably quite simple) question, how can I get the value of a page title into a variable? We've quite a few very long page titles in our wiki & i want to decrease the font size displayed on screen once the title is (say) greater than 30 characters.
I can't appear to go $value = $this->text('title'); as that just outputs the page title to the screen. How then can I determine the title? Once I have the title in a var I'll strlen it & adjust the formatting accordingly.
Thanks,
al.
$this->text('title') does echo $this->data['title']
so if you want to do an output to html you use the $this->text('title') and if you want to store the value of the page title into another variable or function use $this->data['title']
It took me a while to figure out the way mediawiki 1.4 does it and I actually just found the answer yesterday! Feels great to give back.
Enjoy Ben
On 4/19/05, Alistair Johnson JohnsonA@rembrandt.co.nz wrote:
A (probably quite simple) question, how can I get the value of a page title into a variable? We've quite a few very long page titles in our wiki & i want to decrease the font size displayed on screen once the title is (say) greater than 30 characters.
I can't appear to go $value = $this->text('title'); as that just outputs the page title to the screen. How then can I determine the title? Once I have the title in a var I'll strlen it & adjust the formatting accordingly.
Thanks,
al. _______________________________________________ MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
mediawiki-l@lists.wikimedia.org