User:Egingell

meta:User:Treader

Original
global $wgLang, $wgContLang;

New
global $wgLang, $wgContLang, $wgTitle;

Original
$lines = explode( "\n", wfMsgForContent( 'sidebar' ) );

alternate 1
// Change the default sidebar to a custom one (MediaWiki:Sidebar_[NS_NUM] if it exists) on any namespace, // not just custom namespaces. If MediaWiki:Sidebar_[NS_NUM] doesn't exists, use MediaWiki:Sidebar. $sideBar_str = wfMsgForContent( 'sidebar_'.$NameSpaceNumber ); if ($sideBar_str != '&amp;lt;sidebar_'.$NameSpaceNumber . '&amp;gt;' ) { $lines = explode( "\n", $sideBar_str ); } else { $lines = explode( "\n", wfMsgForContent( 'sidebar' ) ); }

alternate 2
// Change the default sidebar to include a custom one (MediaWiki:Sidebar_[NS_NUM] if it exists) // on any namespace, not just custom namespaces. $sideBar_str_default = wfMsgForContent( 'sidebar' ); $sideBar_str_custom = wfMsgForContent( 'sidebar_'.$NameSpaceNumber ); if ($sideBar_str_custom != '&amp;lt;sidebar_'.$NameSpaceNumber.'&amp;gt;' ) { $sideBar_str_default .= "\n". $sideBar_str_custom; } // Remove dupes. See array_unique $lines = array_unique(explode( "\n", $sideBar_str_default ));

Info
MediaWiki:Sidebar => Default Sidebar

MediaWiki:Sidebar_[NS_NUM] => Custom Sidebar for [NS_NUM]

Note
You can get the namespace number from Special:Prefixindex. Look at the URL in the Location/Address bar of your web browser, it will look like this: [Your Wiki Site]/index.php?title=Special%3APrefixindex&from=&namespace=[NS_NUM]