Tags:
create new tag
view all tags

Question

I would like to have a single WebLeftBar for all sub-webs. I understand that I can form a template web for creating new sub webs that use an existing WebLeftBar as a template, but I'd like to have a sigle WebLeftBar so I don't have to update existing sub webs or propagate changes when I perform updates.

Is there an alternative to creating a blank WebLeftBar that includes a WebWideLeftBar and instead have all webs share the same page?

Environment

TWiki version: TWikiRelease04x01x00
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: OS X, 10.4
Web server: Apache 1.3
Perl version: v5.8.6
Client OS: various
Web Browser: Firefox, Safari
Categories: Deployment

-- CharlesLong - 05 Jul 2007

Answer

ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.

I've tried imitating this with an include of a WebWideLeftBar that, by default, contains the WebLeftBarWebsList and the "tools" but, much to my disappointment, "tools" are relative to the web they are in and thus don't work for an include.

-- CharlesLong - 10 Jul 2007

Alternatively you could create a viewleftbar.pattern.tmpl subtemplate (see PatternSkinCustomization).

-- ArthurClemens - 10 Jul 2007

What you can do is use the following expression:

%CALC{"$REPLACE(%WEB%,$FIND(.,%WEB%),$LENGTH(%WEB%))"}%

This will return the name of the 'root' web. Eg, if Support is Foo.Bar.Baz, it will return Foo. You can use this expression in the proper template, eg. viewleftbar.pattern.tmpl, and replace

%INCLUDE{"%WEB%.WebLeftBar"}%

with

%INCLUDE{"%CALC{"$REPLACE(%WEB%,$FIND(.,%WEB%),$LENGTH(%WEB%))"}%.WebLeftBar"}%

You could decorate this with some conditional rendering if you only need this feature for some webs.. You could even make it overrideable, by first checking for a topic in the subweb, eg OverrideWebLeftBar, and include that if it is there and use the CALC expression if it isn't.

-- KoenMartens - 20 Aug 2007

Change status to:
Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2007-08-20 - KoenMartens
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.