Wiki Tricks - Web Left Bar


Groups can customize the left side bar for the entire web by editing the WebLeftBar topic. Individuals are encouraged to create a "personal sidebar" topic; the contents is added to the left bar when that person is logged into Wiki.

However, what if an individual wants to override the entire left side bar? Here's how one person put it:

I know this side bar is useful, but I haven't clicked on any of those useful links for a long time. How do I override the WebLeftBar topic with my own personal customized version?

Solution 1

Step 1

Create your web left bar definition, e.g. Main.WikiGuestMyLeftBar.

Refer to WebLeftBar for ideas.

Be sure to include
<div class="patternLeftBarPersonal">
%INCLUDE{"%MAINWEB%.%WIKINAME%LeftBar" warn="<a href=\"%SCRIPTURLPATH%/edit%SCRIPTSUFFIX%/%MAINWEB%/%WIKINAME%LeftBar?templatetopic=%TWIKIWEB%.WebLeftBarPersonalTemplate\">Create</a> personal sidebar"}%

in your new topic.

Step 2

Create a View override template, e.g. Main.WikiGuestMyViewTemplate, overriding the definition of webleftbar with your topic.



Example: WikiTutNewViewTemplate (raw view)

Step 3

Set the VIEW_TEMPLATE variable in your home topic (WikiGuest) to use your view template instead of the default.

   * Set VIEW_TEMPLATE = MyWeb.Main.WikiGuestMyViewTemplate


Try it here: WikiTutOverrideView

Solution 2

Hide the left bar completely. (From PatternSkinCssCookbookNoLeftBar.)

Are you sure you want to do this? You'll be removing any personal side bar for everyone who visits the page!

For a Single Page

1. You can add the following to any page
<link rel="stylesheet" href="%PUBURL%/Help/WikiTut/noleftbar.css" type="text/css" media="all" />


2. or set a variable in your WebPreferences topic:
   * Set NoLeftBar = <link rel="stylesheet" href="%PUBURL%/Help/WikiTut/noleftbar.css" type="text/css" media="all" />

and then use
on any page.

For Every Page in a Web

1. Set the following variable in your WebPrefereces
   * Set USERSTYLEURL = %PUBURL%/Help/HideWebLeftBar/noleftbar.css

Related: PatternSkinCssCookbookNoTopBar.

Topic attachments
I Attachment Action Size Date Who Comment
noleftbar.csscss noleftbar.css manage 69 bytes 17 Dec 2009 - 20:05 UnknownUser hide the left bar
Topic revision: r2 - 13 Jun 2014, VickiBrown
This site is powered by Foswiki Copyright © by the contributing authors. All material on this wiki is the property of the contributing authors.
Foswiki version v2.1.6, Release Foswiki-2.1.6, Plugin API version 2.4
Ideas, requests, problems regarding CFCL Wiki? Send us email