MediaWiki Remove Sidebar When Not Logged in

Posted on 2007-10-11
Medium Priority
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: http://meta.wikimedia.org/wiki/Layout_customization#How_do_I_remove_the_toolbox_for_users_that_are_not_logged_in.3F

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

Roonaan earned 2000 total points
ID: 20080331

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

ID: 20106026
It worked.  Thank you.

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days socially coordinated efforts have turned into a critical requirement for enterprises.
This article discusses four methods for overlaying images in a container on a web page
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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 …
Suggested Courses
Course of the Month15 days, 16 hours left to enroll

850 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