How to create sidebar panels
Sidebar panels are a narrow frame displayed to the left (usually) of the main page. However, unlike normal frames, the sidebar panel can be displayed reguardless of what main page the viewer is looking at. They can be used very effectively as an interactive bookmark, keeping your viewers up to date with the progress of your site, giving them a simple set of links so they can quickly get to sections of your site, or providing a search facility to look through your site.
Sidebar panels are just HTML pages. Just create them the same way as you would create any other HTML page. Script is supported although the user can disable scripts.
Sidebar content should be styled to fit in a panel 144 pixels wide (the standard width of a sidebar when there is a scrollbar). Users can resize this panel if necessary.
Links and forms in the sidebar panel page should have target="_main" to make them open in the main window in Internet Explorer and target="_content" to make them open in the main window in Gecko (Netscape 6+, Mozilla etc.). In Opera, links should use either one of these to make the links open in a dedicated window. In IE Mac, links should have no target to make them open in the main window, and a target of '_self' to make them open in the sidebar. Having a target of _self in other browsers causes no harm so I recommend it for all forms and links that are not meant to open in the main window.
As JavaScript is required to add sidebar panels in Gecko (so as the user had to support script to install the panel, you can assume they normally support script) but not in IE, I suggest that you use _main normally, and use script to convert this to _content in Gecko. I also use the script in IE Mac, because it does not matter if the user has disabled script, the links will just use a dedicated window instead:
<body onload="
if( window.sidebar || ( window.ActiveXObject && navigator.platform.indexOf('Mac') + 1 ) ) {
for( var i = 0, toChange = [document.links,document.forms]; toChange[i]; i++ ) {
for( var x = 0; toChange[i][x]; x++ ) {
if( toChange[i][x].target == '_main' ) {
toChange[i][x].target = window.sidebar ? '_content' : '';
}
}
}
}
">
How to install sidebar panels, add bookmarks and set the user's homepage
- In Gecko (Netscape 6+, Mozilla etc.), a JavaScript function is used to add a panel. The user is asked for permission. The panel appears as a tab in the sidebar (View - Show / Hide - Sidebar).
- In Opera 6+, a link with the 'rel' attribute set to 'sidebar' will add a Hotlist (equivalent to a sidebar) panel. In Opera 7+, this can also add a bookmark. If just adding a bookmark the user will need to untick a box called 'Show in hotlist panel' (in the English versions at least ...). The user is asked what they would like to do. The panel appears as a tab in the Hotlist (View - Hotlist) or a bookmark or a link on the user's personal bar.
- In Internet Explorer on Windows, a JavaScript function is used to add a favourite. The user is asked if and where to store it. Another JavaScript function is used, coupled with a DHTML behaviour, to set the homepage. Again, the user is asked for permission. Two .reg files are used to install / uninstall the Explorer Bar panel (as close to a sidebar as IE gets), and make it available to the current user. Users should choose to 'open from current location' and will need to agree to add the information into their registry. They will then need to close all Explorer and Internet Explorer windows. From the next time Explorer or Internet Explorer is run, the panel appears as a menu item in the user's Explorer Bar list (View - Explorer Bar - [Panel title]).
- In Internet Explorer on Mac, the user can manually add the sidebar page into their Page Holder (open the page - open the Page Holder - click the 'Add' button - use the Page Holder Favorites button to add it as a Page Holder Favourite). The panel appears in the user's Page Holder Favourites list (Page Holder - [Page Holder] Favorites - [Panel title]).
- The JavaScript function that is used to add a favourite in Internet Explorer (Windows) will also add a bookmark in iCab 3- (Mac). iCab calls this a 'Hotlist entry'.