MediaWiki Remove Sidebar When Not Logged in

Posted on 2007-10-11
Last Modified: 2010-11-02
I don't want the sidebar to display until after a user has logged in.

I found out how to do that with the toolbox:

But I can't find a similar article regarding the sidebar.

Is there a way to not display the sidebar until after a user logs in to my Mediawiki 1.11.0?

Question by:gateguard
    LVL 49

    Accepted Solution


    You can edit the MonoBook.php skin and add an if statement around the while sidebar.

    It starts with the following code around line 150
    <script type="<?php $this->text('jsmimetype') ?>"> if(window.isMSIE55) fixalpha(); </script>

    And ends at about line 227 - 229 with:

    You can build an if statement around it like:

    <script type="<?php $this->text('jsmimetype') ?>"> if(window.isMSIE55) fixalpha(); </script>
    <?php if($this->data['loggedin']) { ?>
    <?php } ?>

    You can choose to include or exclude the first script statement inside the if statement. I think it is safer to have the if statement start just after the script tag.

    Kind regards


    Author Comment

    It worked.  Thank you.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    A colleague recently asked me about how to give his client a small part of the web site that could be completely under the client's control.  Since I have done this sort of thing before to add emergency banners to a web site, I decided I would creat…
    This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now