Manual talk:Interface/Sidebar

''Discuss the contents of Manual:Navigation bar. Note this is not really a good place to ask support questions''


 * /Archived discussion from meta/

Rename to 'Sidebar'
I propose we rename this page to 'Manual:Sidebar'. 'Sidebar' seems to be the name the developers have chosen for this part of the interface. By default it happens to have a section called 'navigation', but overall it's a sidebar right? -- Harry Wood 12:50, 25 July 2006 (UTC)


 * "Navigation bar" makes it easier to identify which elements are being edited, especially in the case of skins where the bar isn't on the side, or where other sets of links (user panel, footer panel) are also moved to one side or near the navigation bar. The title as it stands was selected for a reason. A redirect here from Manual:Sidebar would be helpful, of course. 86.133.212.163 14:42, 4 August 2006 (UTC)


 * OK so you might use a skin where the sidebar is not actually on the side. But you still edit it by editing the MediaWiki:Sidebar page. This is the name MediaWiki developers have given it. What about the case where your MediaWiki:Sidebar page doesn't have a 'navigation' heading? -- Harry Wood 14:35, 21 August 2006 (UTC)

In one particular location, we refer to allow_url_fopen as the "marching ant of doom", but it doesn't make it the canonical name. :) I still think that "navigation bar" overall makes more sense, to more people, regardless of their skin preferences. robchurch | talk 18:37, 21 August 2006 (UTC)

Unlocking the sidebar file?
For newbies/nonprogrammers like myself, it would be helpful to tell us how to unlock the Mediawiki:Sidebar page. I'm having a hard time finding it anywhere in the documentation. (Sarah Kanouse)--67.63.89.244 20:04, 6 July 2006 (UTC)


 * No need to do any programming Sarah. The page is 'protected' by default. You need to login as user with 'sysop' permissions to edit the sidebar. Look at 'special pages' -> 'user list'. See who is sysop. Ask them to do it. ...or is it your own wiki installation. In that case you need to log in as the WikiSysop user you configured when you installed it. When logged in as the right user, you can edit the page as normal -- Harry Wood 12:47, 25 July 2006 (UTC)

I found when I first installed MediaWiki on my server that I could not edit the MediaWiki:Sidebar. I tried everything I had found in articles here and elsewhere but to no avail. I then had a bright idea :), make a new user and give him sysop rights. I then logged in and was able to edit the MediaWiki:Sidebar with the new user. I am still not able to edit the MediaWiki:Sidebar with the original bureaucrat/sysop admin. (1.6.10) TonyE

Skinning
how do you change the color of the text on the first-level headings?? example: on my wiki I want to change the words "navigation", "search" and "toolbox" to be all in white. --BenMcLean 21:19, 6 May 2006 (UTC)
 * Sorry I can't answer this question exactly, but I do know what you're asking is a skinning question, not something that can be done in wikitext. You'll have to mess around with the files of the 'skins' directory.--24.55.70.103 06:32, 8 July 2006 (UTC)


 * I created a new section at the bottom. We should add more detail about skinning w.r.t. the sidebar -- Harry Wood 12:47, 25 July 2006 (UTC)

No, leave that for the general skinning information, when that's written. 86.133.212.163 15:01, 4 August 2006 (UTC)

You don't have to change anything about the skins file, to change the name of navigation go to MediaWiki:Navigation, for search go to MediaWiki:Search, for toolbox go to MediaWiki:Toolbox.66.0.5.4 18:27, 22 August 2006 (UTC)


 * He wants to change their colour, not their wording. 86.134.49.147 10:45, 24 August 2006 (UTC)


 * So to actually answer the question...


 * have a look for the '#p-navigation a' CSS entry, and add a text 'color' definition like this:

display: block; color:YELLOW; }
 * 1) p-navigation a {
 * This will change the links ('a' elements) to be yellow


 * So I guess Manual:Skins is the place where this kind of thing should be explained? That page needs some work. In the meantime see also 'Skins' on meta -- Harry Wood 01:28, 23 January 2007 (UTC)

Problem changing the navigation/sidebar
After changing MediaWiki:Sidebar, the changes appear on the top http://www.holoprosencephaly.net/MediaWiki:Sidebar like links change "mainpage, community portal, etc... but i wan to add links at left side where is tool box links. how can i change left side links. can some one tell me.

After changing MediaWiki:Sidebar, the changes don't appear on the pages until I edit the pages. Is that the expected behavior?

And I can't figure out how to make the new navigation show up on the Main Page -- just editing that doesn't seem to be sufficient.


 * Nevermind. It seems there's just a delay as that change propagates. See also the discussion at Help:Navigation bar. I'm new enough that I don't know when to use the Manual vs. Help - but in this case the Help page seems more complete.

Bottom section of the rewritten version of |this page. 86.133.212.163 15:02, 4 August 2006 (UTC)

I'm having the same problem, and none of the suggested actions (touch, action=purge, etc) seems to have any effect. I am running 1.4.5. Does this work only on later versions of MediaWiki? --71.35.120.111 03:51, 22 August 2006 (UTC)


 * This documentation was written with current releases in mind. Take a look at these Google results for information on 1.4.x - and please upgrade to at least the latest 1.4.x release, which is 1.4.15; it contains a vast number of security and data corruption fixes. 86.134.49.147 10:42, 24 August 2006 (UTC)

Getting very much the same problem (with 1.6.8). If I go to MediaWiki:Sidebar and look at what's there vs. what's in the navigation bar, they are nothing alike. I've tried everything I can find anywhere to fix this, and it just doesn't work. --168.166.124.100 18:26, 5 October 2006 (UTC)


 * Just add &action=purge onto the end of the URL, and that will clear the cache for that page and show any skin changes you've made. 87.82.10.23 12:05, 15 October 2006 (UTC)

I'm having this issue with 1.7.1. If I change the sidebar page, I can see the changes there, but nowhere else in the wiki. I've tried trunacting the objectcache table, touching the LocalSettings.php file, clearing my browser's cache, closing and opening my browser, purging the page manually through the purge action to no avail! Why is it so hard to view the changes in the sidebar? (Enrique Delgado) 150.147.13.123 14:24, 23 October 2006 (UTC). Update: I found a workaround in this blog until we get a definitive solution. (Enrique Delgado) 150.147.13.123 14:08, 24 October 2006 (UTC)

Added a paragraph at the very end describing a another possible reason why changes to the sidebar might not show up in the live wiki. Since this failure mode was not covered in this article before, I think it is a valid addition. Hans Ecke 216.150.215.2 23:41, 14 December 2006 (UTC)

I have installed 1.9 and simply cannot change the sidebar. I tried everything, edited the content of MediaWiki:Sidebar, truncated, touched, reloaded, and so on... I have found that the actual navigation is defined in the languages/messages/MessagesEn.php file, beginning from line 446. I can only change the sidebar by changing the content of this file. What am I doing wrong, why isn't it working with the MediaWiki:Sidebar thing as described? --84.160.32.30 21:17, 28 January 2007 (UTC)

I just installed 9.3.1. Here is what I did to edit the sidebar: --AJim 00:12, 3 March 2007 (UTC)
 * log in as a sysop
 * go to Special pages | System messages
 * you will see a table with two columns
 * the left colum is headed Name
 * all messages are listed here, alphabetically by name
 * find the message sidebar in this list
 * the name sidebar in the left column is a link
 * there is a separate link below each name Talk
 * click on the sidebar link
 * you will see a new page labelled MediaWiki:Sidebar
 * press the Edit tab
 * you will see the list described elsewhere, i.e. *navigation etc.
 * edit this page as needed
 * save this page
 * the navigation list will change on your browser
 * The next time you enter the System messages list, the sidebar entry will have a different background color and the box to the right will be split horizontally into the original (default), above, and your revised version, below.

Two items on one line
Is there any way to link to two items on one line, for example, a blog and its RSS feed? I've tried separating the items with spaces, slashes, double-brackets, and more, but none of it works. AdamRetchless 17:18, 8 July 2006 (UTC)
 * Yeah that kind of thing might be impossible (without by passing the sidebar contents mechanism in the skin php code) Anyone know? -- Harry Wood 12:47, 25 July 2006 (UTC)

It will require improvements to the sidebar handling code...but the English Wikipedia are pondering something like this, so it might get implemented soon. Watch this space. ;) 86.134.49.147 10:45, 24 August 2006 (UTC)

sidebar for anon
Is there a way to have a different sidebar for logged in users and anonymous users? --81.39.161.118 01:40, 12 August 2006 (UTC)


 * Not at this time, although it might not be too difficult to hack in. 86.134.49.147 10:45, 24 August 2006 (UTC)


 * You can probably do something similar to what I did to get different namespaces to have their own sidebars. In includes/Skin.php there is a function called buildSidebar.  Just edit that to check for $wgUser->isLoggedIn and called a different system message than Sidebar.

if ($wgUser->isLoggedIn) { $lines = explode( "\n", wfMsgForContent( 'sidebar' ) ); } else { $lines = explode( "\n", wfMsgForContent( 'anon_sidebar' ) ); }


 * Then in your Wiki, go to MediaWiki:anon_sidebar and create your new sidebar.

Search Box and Toolbox
Is there any way to change what is shown in the search box and the toolbox?


 * Edit the skin. Note that the toolbox contains context-dependent items which change according to the properties of the page being viewed. 86.134.49.147 10:45, 24 August 2006 (UTC)

Understanding the Indirection Used for the Sidebar
Am relatively new to all this but have already set up a handfull of wiki's!

It took me several reads and some experiments to understand that "indirection" is being used by the Sidebar. This when the example mentions:


 * portal-url|Community Portal

Its going to go to look in system message for portal-url. This is the same as the page called MediaWiki:Portal-url. In the my (default) version, the page MediaWiki:Portal-url contains one line reading: Project:Community Portal. That then causes it to look for a page named "Community Portal" in my project. In my wiki, that page did not initially exist - but it is an editable page - so people can contribute to that page.

So - whatever is on the first line of that MediaWiki:Portal-url page will be the actual page that is opened - its one level of indirection!

That had me totally confused for a while!!

I thought I'd share that in case others are suffering from the same confusion. --Wodenickel 02:34, 29 August 2006 (UTC)

Context-dependent navigation bar
Is there a way to get a navigation bar that contains context-dependent items which change according to the namespace of the page being viewed? --82.83.151.177 19:09, 29 August 2006 (UTC)


 * A quick change to includes/Skin.php will get you want you need. The code below will keep Sidebar for all system namespaces and allow you to create new ones for custome namespaces.


 * Replace

global $wgLang, $wgContLang;
 * with

global $wgLang, $wgContLang, $wgTitle;
 * and then replace

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

$NameSpaceNumber = $wgTitle->getNamespace; if ($NameSpaceNumber < 100) { $lines = explode( "\n", wfMsgForContent( 'sidebar' ) ); } else { if($NameSpaceNumber & 1) { $NameSpaceNumber -= 1; } $lines = explode( "\n", wfMsgForContent( 'sidebar_'.$NameSpaceNumber ) ); }

&lt;Egingell&gt;
 * with (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' ) ); }
 * with (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 ));

In my two alternates above: 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] &lt;/Egingell 08:23, 20 April 2007 (UTC)&gt;


 * You can then access the new sidebar inside your wiki by going to the page MediaWiki:Sidebar_[NS_NUM] (i.e. MediaWiki:Sidebar_100 for the first custom namespace)


 * Yup, you'd have to code it yourself at the moment. I imagine in Output.php. There's a call you can do to find out what namespace your in, then have a

switch(namespace) case 01: //load x case 02: //loady


 * etc This is a crappy explanation if you can't code, but at the moment thats the only way you'll get it I beleive!! --Rick 15:35, 19 October 2006 (UTC)


 * Here's an idea - I reckon you could probably customise the navigation using CSS. The body tag has a class "ns-x" where x is the number of the namespace.  Also, each portlet (box in the sidebar) has it's own ID, which is "p-header" where "header" is the text that sits above the box.  So you can setup your sidebar code (at MediaWiki:sidebar) like this:

* box1 ** item1|label1 ** item2|label2 * box2 ** item3|label3 ** item4|label4 etc.
 * You could then add some css to MediaWiki:common.css to show/hide content for individual namespaces. So to show only box1 in the main namespace, and only box 2 in all other namespaces, you would use:

.ns-0 #p-box2 { display: none;  /* Hide box2 in the main namespace */ }   display: none;   /* Stop display of box1 in all namespaces */ .ns-0 #p-box1 { display: block; /* Re-enable the display of box1 for just the main namespace. */ }
 * 1) p-box1 {
 * I haven't tested the above, so it may not work on all browsers (or even at all!) but it's worth testing out, I think. Let me know how you get on. --HappyDog 15:48, 19 October 2006 (UTC)

MediaWiki:Sidebar - 'no Page matches'?
When I enter 'MediaWiki:Sidebar' in the search-field and hit 'go' as specified in the FAQ, I just get the search results page that tells me that the page doesn't exist. I get no option of creating or editing the page. If I enter MediaWiki:Sidebar after the URL in the address-field in my browser when looking at the mainpage, I do get the option of creating and editing the page, but changes do not show up in the navigation bar (and I cannot edit the current content of the bar..)

Am I missing something?

annon - 22:56, 1 September 2006


 * this old version should answer your question. Someone got rid of all that explaination because it wasn't compact enough -- Harry Wood 20:32, 7 September 2006 (UTC)


 * oh bugger.. I'm running version 1.4.15 or something.. just did an apt-get mediawiki, without checking which version that installed.. thanks for the pointer though. Installing a much newer version now :)

Sidebar: a disappearing trick
(posted monday, 6 nov 2006) My sidebar has 'disappeared' upon changing. I have scoured the help pages and tried several things including those suggested in this page such as:
 * the suggestion above to locate the sidebar "MediaWiki:Sidebar - 'no Page matches'?" - that worked, and I located and edited it; after several restarts and purging caches that sidebar simply did not show up.
 * Make sure you do not have an ill formatted MediaWiki:Sidebar page. If it is formatted incorrectly it will disappear. --Rogerhc 23:40, 21 February 2007 (UTC)


 * found a suggestion for 'touching' localsettings.php (to force a refresh), which I tried, and something did show up. I could see a navigation bar, but it showed the text 'Sidebar' in angled brackets instead of showing the contents of the file.
 * so, I tried to add a new navigation block as the post above suggests "adding additional navigation blocks" - created another menu as a separate page and edited monobook.php. Again, I can see a navigation bar, but it shows the text 'AnotherMenu' in angled brackets instead of showing the contents of the file.
 * Based on the post about redirection, tried to explicitly point to the file by changing the reference to 'AnotherMenu' in monobook.php to 'MediaWiki:AnotherMenu' and now that text shows up in angled brackets

So far, about five hours pouring over all manners of suggestions and tutorials on the web has not yielded a solution. Thanks in advance for your help. I realize that this is not a great addition to this page but I hope that this will lead us to a simple answer regarding navigation bars that I will compile and post to the Manual. From what I can see, I seem to be using MediaWiki 1.8.2 (on a MediaWiki hosting service for a little less than a week).

Format of sidebar code
This manual page says that you can write  on it. Although you can this causes a validation error as they also make the id's of the li's. Every entry should be configured using  style code, they can then be edited at MediaWIki:recentchanges-url and MediaWiki:recentchanges (this will obviously change depending on what you put as the link. Lcarsdata (Talk) 16:34, 8 October 2006 (UTC)


 * This is a known and still-open bug; the values need to be sanitised before use as identifiers in that fashion, rather than removing heavily-used and helpful functionality. robchurch | talk 04:53, 22 November 2006 (UTC)

History moved from meta
In order to comply with the GFDL, I have copied the old history of this page from meta. This page was created from the version as of 19th November 2005. Between November 2005 and June 2006 both versions of the page were edited independently - the changes made at meta have not been incorporated into this version of the article (although they exist in the history which may cause some confusion if stepping through it manually). Go here To see the original history on meta.

I also copied the talk page history. The old discussion from meta is now merged with the discussion page history here, and the final version from meta is available on the /Archived discussion from meta/ sub-page. --HappyDog 19:05, 2 December 2006 (UTC)

Images?
Is there a way to toss some images into the wiki sidebar? Like, if I want to make an image for where the word "navigation" is, how would I go about it? I can try just, you know, normally embedding an image, and it works when I preview the article, but when I save it, it'll just ignore displaying the image. Or is there just a limitation in height/width that I don't know of and am not following? --216.170.23.236 01:34, 11 December 2006 (UTC)
 * You might be able to do it using CSS. --HappyDog 02:24, 11 December 2006 (UTC)
 * Um... Just making sure I understand where you're going with this... Are you suggesting I put the image in the template that I'm using, and then use the CSS position attribute to put the image where I want it? I mean, I think I can see how that can work, but it just kind of seems weird to do something like that... Is there a reason why the text "navigation", "resources", etc text isn't and can't be parsed like an article?  --68.112.32.182 04:53, 17 December 2006 (UTC)
 * Providing you've set up your sidebar correctly, then you should be able to add something like this to MediaWiki:common.css

background-image: url(...); background-position: top left; background-repeat: no-repeat; padding-left: 20px; }
 * 1) n-recentchanges {
 * This would add an image to the left of the recent changes link. Set padding-left to the width of your image.  You can also do funky things like hide the bullet point, I should imagine.  Take a look at the html source and you will see the IDs for each of the links, or alternatively you can use the id of the containing div, or even the 'pBody' class to affect the whole box, or all boxes. Hope that helps - it's from memory so some of the details might be wrong, but that should give you enough to go on. --HappyDog 19:26, 18 December 2006 (UTC)
 * That appears to work JUST EXCELLENT for me (and, ignore the IP Addresses, I'm the same guy that started this, just that I've switched locations since then). Thanks!  Google yourself a cookie and eat it!  :D--66.168.139.30 08:44, 19 December 2006 (UTC)

Thanks! It tasted great, but then I logged off and my browser deleted it. A great way to stay thin! :) --HappyDog 23:56, 7 January 2007 (UTC)


 * Very nice that it is supposed to work. But when I make the changes to MediaWiki:common.css nothing is happening. No changes.. I work with monobook. Any ideas? And does the formatting of the common.css make any difference? --ArminT 13:59, 16 May 2007 (UTC)

Cannot edit navigation bar
I have just downloaded and installed the latest version of MediaWiki 1.9.0 When I enter "MediaWiki:Sidebar" into the "search" box nothing is found.

When I go via "All pages" I find MediaWiki:Sidebar/en. I can edit this page, but my modifications are never reflected in the navigation / side bar.
 * This is because system messages are no longer stored in the wiki if unmodified. Simply create that page manually. Lcarsdata (Talk) 10:50, 19 March 2007 (UTC)

MediaWiki:Sidebar/en is ignored, edit MediaWiki:Sidebar instead, see .--Patrick 22:12, 19 March 2007 (UTC)

Adding Web Links
I would like to add external links to the sidebar, but I don't seem to know the trick. Does anyone know how to add eternal links to the sidebar? Thanks

I have had a similar problem. I want to add a link to an RSS Feed. I'm using * http://(mydomain)/w/index.php?title=Special:Newpages&feed=rss|New items but it keeps putting the link in the box as "INVALID-TITLE". I've tried changing the title, changing names, etc. Using 1.9. JustinLong 03:14, 18 February 2007 (UTC)


 * It appears to be choking on the ampersand. Escaping it as "&amp;amp;" doesn't work because there's still an ampersand present, and escaping it as "%26" doesn't work because that gets passed all the way through into the title of the page. I don't know what to do about it. I'm trying to get a wiki edit ("...&action=edit") link into the navigation bar and I'm running into the same problem. --Midorigin 02:01, 2 March 2007 (UTC)


 * I expanded the text:


 * Else, target itself is taken as link target (this does not work for some external links, notably those with "&" in it; use the first method instead: make a page in the MediaWiki namespace)


 * Patrick 08:17, 2 March 2007 (UTC)

You *can* choose one of the system messages (Special:Allmessages) and edit it to reflect your url. Example: portal-url ---> www.your.url


 * Changing portal-url works just fine BUT... just putting "** | " doesn't, as I read above text it should! it's not just the ampersand it's the complete method of putting external links in the navigation page that gives a hickup. And than it just opens in the same browser screen (after renaming portal-url to the desired url). Is there a way to open into a new browser tab of window? ArminT 19:19, 19 May 2007 (UTC)
 * On addition to my own idiot mind... You will have to format just correctly, so no spaces in front off or behind the "|" in the syntax and it just works like a charm.. (Blame me :)) ArminT 19:19, 19 May 2007 (UTC)

EAS


 * You can also make you're own and add that to the list. Lcarsdata (Talk) 10:50, 19 March 2007 (UTC)

linking to category?
I'm trying to modify the sidebar so that a few links will link directly to the category page they reference, but so far everything i've tried has not worked. some help on this would be great.

nevermind, found it on another site. use the format "Category:Proverbs|Proverbs"


 * Don't - that is invalid usage and will generate bad xml. use transclusion like you're supposed to and put :Category:Proverbs in the link page. Lcarsdata (Talk) 10:49, 19 March 2007 (UTC)

Treeview
Is it possible to create more than one item level in the navigation bar?

e.g.:
 * Mainpage
 * MediaWiki-Portal
 * Users
 * Peter
 * Thomas
 * Events
 * Forum


 * See 3597 which has an ugly hack to do this. --D0li0 23:03, 15 May 2007 (UTC)

Adding link targets
any way to add a target attribute to a link, so that it opens in a new window? Dingfelder 21:15, 7 May 2007 (UTC)

Images in the navigation bar
To make a link in the navigation bar just use this syntax:

** mainpage|mainpage

If you want a link to a internal or external page there is nog problem. But I want a picture as background in the navigation bar. A picture per link.

For example: if you don't want regular text in the navbar. But an clickable image/picture.

** http://www.example.org| (or any other syntax that should work).

I can not find any possibilities within meta, mediawiki of wikipedia help pages. Is this at all possible? Or just a nice (as I see it) feature to have? ArminT 13:40, 25 May 2007 (UTC)

Circumvent the '&' Bug

 * You can circumvent the ampersand bug by (example):
 * Create a new page (such as MediaWiki:MW_Google_Search)
 * Add a URL (such as http://www.google.com/search?q=MediaWiki&num=10 )
 * Add the page's sub title to MediaWiki:Sidebar like so:

** MW_Google_Search|Google: MediaWiki
 * Functioning Example - Check the links in the "wow sites" section.


 * This also allows for some dynamics:
 * Special:Export/ in MediaWiki:Export_This, for example, and "** Export_This|Export Article" in MediaWiki:Sidebar would generate a link to Special:Export/Some Page with text "Export Article" in the sidebar when navigating to Some Page.

(Updated) Egingell 11:19, 26 May 2007 (UTC)