Open Source Activism






         How to use open source technology for activism

March 28, 2008

How Do I Change the Mediawiki Navigation Bar?

Filed under: Mediawiki — lennie @ 8:01 am

How do I change the navigation bar is a common question. In a Mediawiki wiki it is a simple task if you know where to go. To edit the navigation bar or sidebar, as it is actually named, go to Mediawiki:Sidebar and edit this page.

Here is what you see when you first edit this page:

* navigation
** mainpage|mainpage
** portal-url|portal
** currentevents-url|currentevents
** recentchanges-url|recentchanges
** randompage-url|randompage
** helppage|help
** sitesupport-url|sitesupport

Notice the format. The first row (navigation) has 1 asterik at the beginning of the line. This is the header for the box. The subsequent lines are the links themselves. Each line starts with 2 asteriks. This syntax puts the item symbol beside the line in the sidebar. The text is then in 2 parts separated with a | (pipe). The first section is the page name or link and the second is the text to be displayed. If you are going to use an external link you must still use the | as a separator.

Lets change the sidebar to include an FAQ link and remove the donations link.

* navigation
** mainpage|mainpage
** portal-url|portal
** currentevents-url|currentevents
** recentchanges-url|recentchanges
** randompage-url|randompage
** helppage|help
** FAQ|FAQ

There are more options as well beside just adding links. What if you want to add a new navigation box. In this example I will add 2 wikis managed by the Sam Adams Alliance. They are Ballotpedia.org and Judgepedia.com.

* navigation
** mainpage|mainpage
** portal-url|portal
** currentevents-url|currentevents
** recentchanges-url|recentchanges
** randompage-url|randompage
** helppage|help
** FAQ|FAQ
* links
** http://ballotpedia.org|Ballotpedia.org
** http://Judgepedia.com|Judgepedia.com

Again, if you leave out the |, the links will not display. As you can see, editing the sidebar is rather simple once you know where to go.

If you want to do something even more fancy and are comfortable with modifying CSS files, you can place an image under the text, change padding or text style. For Mediawiki 1.11 find the following segment of code in the skins/monobook/main.css file:

/*
** the navigation portlet
*/

#p-navigation {
position: relative;
z-index: 3;
}
#p-navigation a {
display: block;
}
#p-navigation li.active a, #p-navigation li.active a:hover {
display: inline;
}

#p-navigation .pBody {
padding-right: 0;
}

#p-navigation li.active a, #p-navigation li.active a:hover {
text-decoration: none;
font-weight: bold;
}



2 Comments »

  1. I have installed Mediawiki on my server, and now when I try to edit the navigation bar by searching for the MediaWiki:sidebar, I see no edit possibility and when I go to the View Source tab, the following message is handed to me:
    “You do not have permission to do that, for the following reason:
    This page provides interface text for the software, and is locked to prevent abuse.

    What does that mean?

    Hope to hear from you :)

    //Elisabeth

      Elisabeth — April 23, 2008 @ 10:59 am

  2. Elisabeth,

    Are you logging in as the admin user WikiSysop, or whatever name you used? The issue you are having means the user you are logged in as is not a Sysop and the sidebar is in Protected mode. Protected mode means only sysops or the owner of the page can edit it.

    Hope that helps.

    Lennie’s last blog post..How to filter out keywords in blog titles from the main page?

      Lennie — April 23, 2008 @ 11:25 am

RSS feed for comments on this post. TrackBack URI

Leave a comment

Hosted by Sam Adams Alliance - Disclaimers

FireStats icon Powered by FireStats