Feature Proposal: new variable "WEBROOT"
Motivation
Now that TWIki has subwebs, we need a new variable that refers to the root of a web tree.
If I am in the People/Vicki/Notes web, %WEB% is Notes. We need a variable that returns "People".
--
TWiki:Main/VickiBrown
- 22 Dec 2007
Could you spare a few more words on the usecase attached?
TWiki:Plugins.FlexWebListPlugin
could perhaps be expanded with this option.
--
TWiki:Main.SteffenPoulsen
- 22 Dec 2007
Description and Documentation
This was originally filed as
http://develop.twiki.org/~twiki4/cgi-bin/view/Bugs/Item5166
discussion started. Closed as "No Action required"
Reopening here. We should not lose the discussion that was started.
Examples
Steffen - Yes, this would be excellent for
FlexWebListPlugin. Here's the use case:
In our TWiki at cfcl.com, I've set up a lot of webs and sub webs. I decided that I don't want to see all of the sub webs in the sidebars, so I've modified TWiki.WebLeftBarWebsList to show two lists:
- the current web hierarchy
%FLEXWEBLIST{... include="%INCLUDINGWEB%(/\w+)?" ...%
- the top level webs (no subwebs)
%FLEXWEBLIST{... subwebs="none" exclude="Shared|Trash.*" ...%
This works great when I enter a web (screenshot 1) but not so great when I'm down in a subweb (screenshot 2). I want to be able to say "show me my current hierarchy, up to my "web" parent and his subwebs, but no other webs or their subwebs.
In this example, when I'm in "Tut" I would like to be able to show the same weblist that I can show when I'm in "Learn".
I'm thinking WEBROOT because it's the root of the current subweb tree (the name of the directory that''s under data/)
- Screenshot 1:
|
- Screenshot 2:
|
Impact
Implementation
--
Contributors: VickiBrown - 27 Dec 2007
Discussion
I have actually also missed exactly this feature.
The feature I have missed is the ability to show the weblist with the root level only and the current web (current meaning the web tree I am currently viewing a topic in) expanded.
If it is OK not to add this to the core but to the
FlexWebListPlugin then no feature proposal has to be accepted. Then it is only
MichaelDaum that needs to accept as the
FlexWebListPlugin has the ContactAuthorFirst policy.
Looking at the proposal as a core feature
As a core feature is would be to add a simple new feature to
WEBLIST.
And it may make sense to add a simple fully compatible feature that enables people list the entire webtree of the current web.
--
KennethLavrsen - 27 Dec 2007
As far as I understand the proposal, you need the
trail of webs up to the root down in some subweb, that is given you are in subweb
Learn/Tut/Extra/Foo/Bar
you want to show the list of parent webs somewhat like this:
Is that the needed usecase? If so then please have a look at the
BreadCrumbsPlugin. Use it to generate the
web breadcrumbs down
to the current web. Switch off the topics using
recurse=topicoff.
Another solution is to use
the
FilterPlugin and take the
%WEB% as "a list to be formatted", i.e. separated at the
/ and
.
chars and render it in whatever way you want. That will look like this:
%FORMATLIST{"%WEB%" split="/" format=" * $1"}%
In any case, I have not understood when a
WEBROOT variable comes into play.
--
MichaelDaum - 28 Dec 2007
scary, I thought
%WEB% should be equal to =People/Vicki/Notes
otherwise, how can
%WEB%.%TOPIC% point to the current
WebHome?
--
SvenDowideit - 29 Dec 2007