Greetings:

I used this code that I found here: 
https://www.mediawiki.org/wiki/Manual:Interface/Sidebar#content_of_sidebar_and_toolbox_.28javascript.29

<?php
$wgHooks['SkinBuildSidebar'][] = 'lfHideSidebar';
function lfHideSidebar( $skin, &$bar ) {
        global $wgUser;
        // Hide sidebar for anonymous users
        if ( !$wgUser->isLoggedIn() ) {
                $bar = array(
                        'navigation' => array(
                                array(
                                        'text'   => wfMsg( 'login' ),
                                        'href'   => SpecialPage::getTitleFor( 
'Login' )->getLocalURL(),
                                        'id'     => 'n-login',
                                        'active' => ''
                                )
                        )
                );
        }
        return true;
}



When I tried to access my wiki I got the white page of death.


I am using MW 1.21.1

Looking for help with this code or a better way to hide the sidebar for 
anonymous users.

Thanks,


Wade
_______________________________________________
MediaWiki-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Reply via email to