FlexWebListPlugin
Flexible way to display hierarchical web lists
This is a replacement for TWiki's standard
WEBLIST variable. It is extended to improve the display of hierarchical web structures, a feature added to TWiki-4 and adds more flexibility when used in TWikiApplications. The FLEXWEBLIST can be used for example to generate a hierarchical navigation scheme or a nested site map.
%FLEXWEBLIST{...}%
This tag iterates over all specified webs and all of their subwebs recursively while using the specified format strings to produce the output.
Parameters:
-
webs
: a list of webs to be displayed and/or "public" - a list of all non-hidden webs, "webtemplate" - a list of all template webs; "publiccurrent" - a list of all non-hidden webs including the current one; (defaults to "public")
-
format
: format string to render one item (defaults to "$web ")
-
header
: format string prepended to the output result
-
footer
: format string appended to the result; if the list of webs is empty neither header nor footer are added.
-
separator
: text to be put between webs; can be none
for no separators
-
subformat
: format string to be used to format subwebs (defaults to format
)
-
subheader
: format string preceding the output of any subweb (defaults to header
)
-
subfooter
: format string following the output of any subweb; subheader and subfooter are only added if the list of subwebs of the current web is not empty (defaults to footer
)
-
subseparator
: text to be put between subwebs; can be none
for no separators (defaults to separator
)
-
subwebs
: regular expression that subwebs must match to be listed; this can also be none
, all
, only
to suppress subwebs, show all or only dispay explicitly mentioned subwebs (default is all
)
-
selection
: selected items in the list of webs
-
marker
: text for $marker
if the item maches the selection (see pseudo variables below)
-
markerformat
: format string used instead of (sub)format string for selected items
-
exclude
: regular expression of items excluded from the output
-
include
: regular expressions of items that must match in order to be included in the output
-
adminwebs
: a regular expression of webs that are considered to be only relevant for TWikiAdmins and are hiddend to non-admin users. In general it is recommended to hide webs by restricting access rights to it. There are however cases when you want to hide a web but still use it although the user is not aware of it. Best example is and Application web holding TWikiApplications. Users are using those applications but should not be bothered with their implementation.
-
map
: list of key=value
pairs to map the name of a web to a different value (e.g. map="TWiki=System,Main=Home" will expand the variable $name
as "System" instead of TWiki and as "Home" instead "Main")
Parameters default to the emtpy string if not mentioned otherwise. Note, that some of them although similar to WEBLIST have different default values.
Pseudo-variables: Each of the above format strings (format, header, footer, subformat, subheader, subfooter and markerformat) may contain special variables that are replaced with a current value:
-
$web
: the full name of the web, e.g. Main/Foo/Bar
-
$qname
: the full name of the web in quotes, e.g. "Main/Foo/Bar"
(deprecated)
-
$name
: the name of the web without the leading parent webs, e.g. Bar
-
$origname
: the original name of the web despite any name mapping
-
$parent
: the name of the parent web of a sub web or the empty string if there's none
-
$marker
: marker text (see above) if the current item is selected, empty otherwise
-
$depth
: level of embedding of a subweb; main level web have depth 0 etc.
-
$nrsubwebs
: number of subwebs a current web has
-
$indent
: expands to three spaces for each level a web is embeded; main level webs get three spaces, subwebs on first level six spaces and so on.
-
$indent(string)
: same as $indent
but using string
instead of three spaces
-
$n
: replaced with a newline char (\n)
-
$percnt
: replaced with a percent char (%)
-
$dollar
: replaced with a dollar char ($)
-
$nop
: removed from the format string before expanding common TWiki variables
The following picture illustrates when which format strings are used
format
separator
format
subformat
subseparator
...
subseparator
subformat
separator
...
subseparator
format
See the
FlexWebListExamples.
- Unzip
FlexWebListPlugin.zip
in your twiki installation directory. Content:
|
|
File: |
Description: |
data/TWiki/FlexWebListExamples.txt |
|
data/TWiki/FlexWebListNavi.txt |
|
data/TWiki/FlexWebListPlugin.txt |
|
data/TWiki/FlexWebListTree.txt |
|
lib/TWiki/Plugins/FlexWebListPlugin/Core.pm |
|
lib/TWiki/Plugins/FlexWebListPlugin.pm |
|
|
|
|
- Visit
configure
in your TWiki installation, and enable the plugin in the {Plugins} section.
Related Topics: FlexWebListExamples,
FlexWebListNavi,
FlexWebListTree,
TWikiPlugins,
VarWEBLIST