Dear all,
For our corporate Intranet site I'm looking at creating a simple template with navigation at the top, content in the middle and a small footer at the bottom (see ibm.com for an example of the sort of layout I'm looking for). I'm using a freshly installed 4.1rc for this test.
I've started with monobook and copied \skins\monobook.php and \skins\monobook* to \skins\test.php and skins\test* respectively. I've changed the mentions of "monobook" to "test". The template created works fine under firefox, but not IE. IE complains about an error in the generated js code which I've tracked down to a call in RawPage.php "echo $sk->getUserJs();". I've commented that out and all is now fine - but I'd prefer not to change the codebase.
Can anyone advise what I need to do to either (1) disable the opportunity to run user specific css / js in my new "test" template; or (2) fix my newly created "test" template so the user-specific css/js works properly.
If anyone can point me towards a better starting point than monobook for the layout I'm trying to achieve that would also be appreciated.
Cheers,
al.
Alistair Johnson wrote:
I've started with monobook and copied \skins\monobook.php and \skins\monobook* to \skins\test.php and skins\test* respectively. I've changed the mentions of "monobook" to "test". The template created works fine under firefox, but not IE. IE complains about an error in the generated js code which I've tracked down to a call in RawPage.php "echo $sk->getUserJs();". I've commented that out and all is now fine - but I'd prefer not to change the codebase.
Can anyone advise what I need to do to either (1) disable the opportunity to run user specific css / js in my new "test" template; or (2) fix my newly created "test" template so the user-specific css/js works properly.
Copy [[MediaWiki:Monobook.js]] to [[MediaWiki:Test.js]] and see if that helps.
-- brion vibber (brion @ pobox.com)
Can anyone advise what I need to do to either (1) disable the opportunity to run user specific css / js in my new "test" template; or ...
I did this in 1.3.9, though I don't think it'll work in 1.4.x. But if you're running 1.3.x,
Comment out line 89ish in SkinPHPTal.php: //$this->setupUserCssJs();
and lines 150ish through 155ish /* if($this->loggedin) { $tpl->set( "jsvarurl", $this->makeUrl('-','action=raw&gen=js&smaxage=0') ); } else { $tpl->set( "jsvarurl", $this->makeUrl('-','action=raw&gen=js') ); } */
Then in Skin.php lines 158-170ish, function getHeadScripts() { /* global $wgStylePath, $wgUser, $wgLang, $wgAllowUserJs; $r = "<script type="text/javascript" src="{$wgStylePath}/wikibits.js"></script>\n"; if( $wgAllowUserJs && $wgUser->getID() != 0 ) { # logged in $userpage = $wgLang->getNsText( Namespace::getUser() ) . ":" . $wgUser->getName(); $userjs = htmlspecialchars($this->makeUrl($userpage.'/'.$this->getSkinName().'.js', 'action=raw&ctype=text/javascript')); $r .= '<script type="text/javascript" src="'.$userjs.""></script>\n"; } return $r; */ return ''; }
and then lines 195ish-205ish: function getUserStyles() { //global $wgOut, $wgStylePath, $wgLang; //$s = "<style type='text/css'>\n"; //$s .= "/*/*/ /*<![CDATA[*/\n"; # <-- Hide the styles from Netscape 4 without hiding them from IE/Mac //$s .= $this->getUserStylesheet(); //$s .= "/*]]>*/ /* */\n"; //$s .= "</style>\n"; //return $s; return ''; }
This worked well to clear up the loopback for user styles and user JavaScript.
Good Luck.
--N. Buzdor
mediawiki-l@lists.wikimedia.org