Hello,
Discovering version 1.5...
I need to pass a variable from skintemplate.php to monobook and use this variable in an INCLUDE statement:
<?php include($this->text('menulang')) ?>
Unfortunately, the text of the variable is displayed, but the include seems to be forgotten.
The include works fine as long as I give him the string variable:
<?php include("menuFr.txt)) ?> or <?php include("menuDe.txt)) ?>
A bit desperate I tried something more complicated such as: <?php include(settype($this->text('menulang'),"string")) ?> with no more success: I end up with menuFr.txt displayed instead of the content of the menuFr.txt file.
Found solution:
I detect the prefered language from the visitor: -I take only the first two characters (en-us -> En; fr-ca -> Fr;) -If other than Fr, De, En, then it's En is used -I set the menulang = menuXx.txt directly in monobook.php -I set the menulangPage = menuXx directly in monobook.php
1) use the haveData function from skinTemplate.php instead of text:
<?php include($this->haveData('menulang')) ?>
2) use a page from your MediaWiki namespace as a navigation menu: the function to use is msghtml
<h5 >Menu:<?php $this->text('menulang') ?></h5> <div class="pBody"> <ul id="t-menu"><?php $this->msgHtml($menulangPage) ?> </ul> </div>
Does anybody knows if there is a simpler way of doing this. I 've heard a lot of interwiki language, is it applied to change the interface from visitor to visitor?
Thanks a lot François
mediawiki-l@lists.wikimedia.org