Netscape DevEdge

Skip to: [content] [navigation]

How to Implement a Netscape MultiBar Sidebar Tab

Introduction

One disadvantage of Netscape Sidebars is the space taken up in the Sidebar panel by each distinct Sidebar. If you have dozens of related Sidebars, your Sidebar panel can grow to an unmanageable size.

By creating a "MultiBar" you can package many different sidebar tabs into a single sidebar tab. Each individual sidebar is selectable using a simple pull down list which is remembered each time you reopen the sidebar tab. You can also add new sidebars to the MultiBar and make them immediately available to your users without requiring them to perform an additional installation.

See the DevEdge Multibar as an example of how several Sidebar Tabs for developers are grouped together.

Manifest

The MultiBar installation uses the following files:

cookie.html

This hidden HTML document is used to manage the cookies used to remember the previously opened sidebar in the MultiBar.

sidebar.html

This HTML document that will be loaded into the sidebar panel during your user's first visit. Once it is displayed, it will be replaced by either the last viewed sidebar or the first sidebar in the sidebar-contents.xml list.

sidebar.css

CSS rules for styling your sidebar.

sidebar.js

the logic of MultiBar.

sidebar.xul

defines the UI of the MultiBar in XUL.

sidebar-contents.xml

contains the list of sidebars to populate the dropdown.

Example

<?xml version="1.0"?>
<sidebar-contents>
  <sidebar-item>
    <name>DevEdge News</name>
    <url>http://devedge.netscape.com/viewsource/devedge-news_en.html</url>
  </sidebar-item>  
  <sidebar-item>
    <name>CSS2 Quick Reference</name>
    <url>http://devedge.netscape.com/toolbox/sidebars/2001/css2qr/prop-visual.html</url>
  </sidebar-item>
</sidebar-contents>
README

A README and License for MultiBar.

A <sidebar-item> has 2 children - the <name> element which is the name to be displayed in the sidebar selection pull down list and the <url> element which is a URI to the sidebar's location.

By default, the first <sidebar-item> is loaded. When a user chooses another item from the sidebar selection dropdown, a cookie is set (called "sidebarChoice") which contains the selected sidebar's position in the list.

Since the list of sidebars is stored on your web site, it is easy to add new sidebars to the list without requiring your user to install it individually.

Installation

  1. Download the source (multibar.zip)

  2. Unzip multibar.zip into the location where you wish to set up your MultiBar.

  3. Customize the sidebar-contents.xml file to contain information on each sidebar you wish to have loaded in your MultiBar.

  4. Create an installer for your sidebar tab.

License

Netscape grants you a royalty free license to use, modify or distribute this software provided that the copyright notice appears on all copies. This software is provided "AS IS," without a warranty of any kind.

See also

To learn more about Netscape Sidebars please see the following:

A+R