Item5498: WebTopBar and WebBottomBar SHOULD be modifiable on a per-web basis
Priority: Enhancement
Current State: Proposal Required
Released In: n/a
Target Release: n/a
I've read the arguments at
Bugs/Item2136. I disagree. Use a conditional. IF
Tasks.WebTopBar
exists, use it, else use the page in %TWIKIWEB%=. But TWiki should be customizable web by web.
I agree with
WillNorris, "I expect Web prefixed topics to apply web-wide." The failure of
WebTopBar to be modifiable violates the Principele of Least Surprise.
Arthur says "I haven't come across the question that often on IRC or Support.". Keep in mind that TWiki is used predominately behind corporate firewalls - where quesrtions come up in local forums. This question has arisen again in our local discussion list and is ikn our bug database. It's not an uncommon question, only a question that doesn't get taken to twiki.org.
--
TWiki:Main/VickiBrown - 03 Apr 2008
quickly reading
Item2136 Kenneth seems to be indicating that he'd like to see a feature request with analysis and discussion - I presume mostly to make sure there are no hidden gotcha's
Its not going to be hard to implement as a 'if local
WebTopBar exisits, use it, else fall back to the TWiki web one - so I don't really understand why not - but that just shows that maybe more discussion is needed ?
--
TWiki:Main.SvenDowideit - 04 Apr 2008
I agree with Kenneth and Sven. This report is not about something documented that is supposed to work but doesn't (a bug), but about something that could work in a different (enhanced) way: a
Feature Proposal.
--
TWiki:Main.GilmarSantosJr - 04 Apr 2008
Well, no, actually, it Was documented and USED to work and no longer does.
WebTopBar was customizable pre- TWiki 4. IN fact, somehow, two of the webs at our company are still able to customize
WebTopBar. The name of the page implies a web-specific page.
It used to work; it stopped working. It's expected. Therefore: bug.
--
TWiki:Main.VickiBrown - 16 Apr 2008
I just checked Cairo (last release before TWiki 4.0).
The WebTopBar belongs to the PatternSkin only and is called one place: twiki.pattern.tmpl
%TMPL:DEF{"topbar"}%<div class="twikiHidden"><a href="#Content">Skip to topic</a> | <a href="#PageBottom">Skip to bottom</a><hr /></div><div class="twikiTopBar"><div class="twikiTopBarContents"><form name="top" action="%SCRIPTURLPATH%/view%SCRIPTSUFFIX%/%WEB%/%TOPIC%"> %INCLUDE{"%TWIKIWEB%.WebTopBar"}%</form></div></div>%TMPL:END%
So it is included from TWIKIWEB. Not from local web.
Next let us look at TWiki.WebTopBar
<div class="twikiLeft">
<a href="%WIKILOGOURL%"><img src="%WIKILOGOIMG%" border="0" alt="Home"/></a>
</div>
<div class="twikiRight twikiSearchBox">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><label for="go">Jump: </label><input type="text" id="go" name="topic" size="16" /></td>
</tr>
</table>
</div>
From this you can see that the part that can be tailored is the WIKILOGOURL and WIKILOGOIMG so you can replace the image and the link that clicking on the image leads to per web by setting the two variables in WebPreferences. This is still the case.
And what about the documentation in Cairo?
The WebTopBar is described in PatternSkinCustomization.txt and it says
These parts are dynamically included topics:
* Top bar: TWiki.WebTopBar
* Left bar: included topic WebLeftBar (one !WebLeftBar topic per web)
* Personal links block: %MAINWEB%.%<nop>USERNAME%LeftBar. Your own personal leftbar: %MAINWEB%.%USERNAME%LeftBar
* Bottom bar: included topic TWiki.WebBottomBar
So documentation says clearly that you find the
WebTopBar in the TWiki web. So the only real valid argument is the name of the topic.
NOW how big a problem is it for an admin to change the
WebTopBar to be local to each web?
We move forward to 4.2.0
The inclusion has now moved to viewtopbar.pattern.tmpl
%TMPL:DEF{"topbar"}%<div id="patternTopBar"><div id="patternTopBarContents">%INCLUDE{"%TWIKIWEB%.WebTopBar"}%</div></div><!-- /patternTopBar-->%TMPL:END%
So all you have to do is remove the %TWIKIWEB%. from the
INCLUDE and put a
WebTopBar in each local web.
Or you can change the line to
%TMPL:DEF{"topbar"}%<div id="patternTopBar"><div id="patternTopBarContents">%INCLUDE{"%TOPBARWEB%.WebTopBar"}%</div></div><!-- /patternTopBar-->%TMPL:END%
and define the TOPBARWEB in Main.TWikiPreferences to be "TWiki" and re-define it in those webs where you want an alternative top bar.
There are other ways to do similar thing.
Without access to the templates but as admin you can alter the TWiki.WebTopBar to include a local topic !%BASEWEB%.LocalWebTopBar.
And another fun way is to edit the WebTopBar in the TWiki web to say
%INCLUDE{"%IF{"istopic '%BASEWEB%.LocalWebTopBar'" then="%BASEWEB%.LocalWebTopBar" else="%TWIKIWEB%.LocalWebTopBar"}%"}%
Or again editing the template replace the simple include by
%INCLUDE{"%IF{"istopic '%BASEWEB%.WebTopBar'" then="%BASEWEB%.WebTopBar" else="%TWIKIWEB%.WebTopBar"}%"}%
The latter is probably the most logical.
So this is not such a big deal and relatively easy for anyone to implement as it suits them
But now comes why this needs to be discussed as a feature proposal.
What annoys me when I upgrade TWiki is that my tailored WebTopBar gets overwritten. And additionally I would not want to have a copy of the top bar in each web because I use the same bar everywhere.
So maybe I would rather have the template default to including Main.WebTopBar and fall back on TWiki.WebTopBar.
Such a change deserves a little discussion. Therefore a proposal topic should be made. (Copy all of this to it).
--
KennethLavrsen - 16 Apr 2008
Interesting. I really though that WebTopBar was per-web in Cairo. Did my company edit the templates?
I still think that WEBTopBar needs to be per-web in TWiki (it's expected. It
looks like
WebLeftBar. It "should work")
I would recommend putting the conditional into the template as you indicate above. It's logical and it "just works" seamlessly.
TWIki should not sacrifice power and functionalioty for "simplicity" in the skin templates.
And I absolutely agree that things like this that get customized need to move into Main and out of TWIKIWEB
--
TWiki:Main.VickiBrown - 17 Apr 2008
Proposal added:
TWiki:Codev.WebTopBarShouldBeWebPerWeb
--
TWiki:Main.VickiBrown - 17 Apr 2008