New %WEBLIST% and %TOPICLIST% variables
- The
%WEBLIST{"..."}% variable gives a list of all webs;
- The
%TOPICLIST{"..."}% variable gives a list of all topics in a web (aka the "index");
See details in
TWiki.TWikiVariables
The format can be freely defined:
WEBLIST as comma delimited list
%WEBLIST{"$name, "}%
Blog,
Codev,
Main,
Plugins,
Sandbox,
Support,
TWiki,
TWiki01,
TWiki02,
TWiki03,
TWiki04,
TWiki04x01,
TWiki04x02,
TWiki04x03,
TWiki05x00,
TWiki05x01,
TWiki06x00,
TWiki06x01,
WikiWed,
WEBLIST as a linked bullet list
%WEBLIST{" * [[$name.WebHome]]"}%
TOPICLIST as comma delimited list
%TOPICLIST{"$web.$name, " web="Know"}%
TOPICLIST as bullet list
%TOPICLIST{" * $web.$name" web="Know"}%
TOPICLIST as selector
%TOPICLIST{"<option>$name</option>"}%
These variables can be used for many things, like customized
TWikiSkins,
IndexWhenEditing etc.
A security note: TWiki has hidden webs, currently defined with the
NOSEARCHALL preferences variable.
-
%WEBLIST{"..."}% omits hidden webs, except for the current web.
-
%TOPICLIST{"..."}% gives an empty list in case a hidden web is searched, except for the current web.
Question: Shall we rename the
NOSEARCHALL preferences variable to a more appropriate
HIDDENWEB? That would mean an upgrade issue of existing TWiki installations, but it would make it more understandable.
--
PeterThoeny - 08 Jun 2001
Nice feature - this should also be useful for
PopupPageIndexForEditing.
--
RichardDonkin - 08 Jun 2001
Tis good. Would it be worth having a generic LIST{} operator that could take any variable and turn it into any of the list formats?
%LIST{"TOPIC", "<option>$name</option>"}%
--
MartinCleaver - 08 Jun 2001
The
%WEBLIST{"<option>$name</option>"}%
variable should be used on the
TWiki.WebSearch page, under Advanced, where a user can search under specific webs. Otherwise, this is a another place to edit when a new web is added.
--
MikeBarton - 25 Jun 2001
I was trying to use the WEBLIST routine and embed VAR calls within the
format to make a skin I am working on a little more flashy. I would suggest adding some functionality to allow VAR calls inside the
format routine such that you can extend the functionality of the WEBLIST functionality.
I figured out a way to do this by adding a new parameter called variable, this gets expanded inside the routine. as the following :
%VAR{"$variable" web"$item"}%
This allows me to imbed one variable in the
format string. This is very contstrained and it might be nice to have a series of variables that can be addressed by the
format string.
I was trying to create a row of table elements with the WEBBGCOLOR of that particular web :
%WEBLIST{format="<td align=center bgcolor=$variable>[[$name.WebHome][$name]]</td>" variable="WEBBGCOLOR"}%
--
ShawnBradford - 11 Jun 2002
See
TopicListWithoutWebTopics
--
MartinCleaver - 18 May 2004