ExtendedWebListPlugin
Extended Web List Plugin provides the ability to only show subwebs within current top web.
Description
The current built-in WEBLIST macro does not have the capability of only showing subwebs within the current top level web. This plugin adds this feature to a new macro EXTENDEDWEBLIST.
This plugin is very simple. It mirrors all the features of WEBLIST except it adds the option
rootwebs
which will cause EXTENDEDWEBLIST to return the entire web tree under the current web branch.
This is useful when you have many webs with many subwebs. The list of webs in the
WebLeftBar can become quite long when you see all the subwebs. With this plugin you can put something like this in the System/WebLeftBarWebsList
* *%MAKETEXT{"Webs"}%*
%EXTENDEDWEBLIST{" * <span style=\"white-space:nowrap\"><a href=\"%SCRIPTURLPATH{"view"}%/$name/%HOMETOPIC%\"><img src=\"%ICONURL{web-bg}%\" border=\"0\" alt=\"\" width=\"16\" height=\"16\" style=\"background-color:%$markerVAR{\"WEBBGCOLOR\" web=$qname}$marker%\" /> <nop>$indentedname</a></span>" subwebs="%BASEWEB%" rootwebs="on" webs="public"}%
Later more features may be added. But the plugin is created for this simple purpose.
Syntax Rules
- Extended version of WEBLIST with additional
rootwebs
parameter, provided by ExtendedWebListPlugin. Makes a list of all webs. Obfusticated webs are excluded, e.g. webs with a NOSEARCHALL = on
preference setting. The "format"
defines the format of one web item. The $name
gets expanded to the name of the web, $qname
gets expanded to double quoted name, $marker
to marker
where web matches selection
.
- Syntax:
%EXTENDEDWEBLIST{"format" ...}%
- Supported parameters:
Parameter: | Description: | Default: |
"format" | Format of one line, may include $name (the name of the web), $qname (the name of the web in double quotes), $indentedname (the name of the web with parent web names replaced by indents, for use in indented lists), and $marker (which expands to marker for the item matching selection only) | "$name" |
format="format" | (Alternative to above) | "$name" |
separator=", " | Line separator | "$n" (new line) |
web="" | if you specify $web in format, it will be replaced with this | "" |
webs="public" | Comma separated list of webs, public expands to all non-hidden. NOTE: Administrators will see all webs, not just the public ones | "public" |
marker="selected" | Text for $marker if the item matches selection | "selected" |
selection="%WEB%" | Current value to be selected in list | selection="%WEB%" |
subwebs="Sandbox" | show webs that are a sub-web of this one (recursivly) | "" |
rootwebs="on" | Always show the root web when webs="public" , even when subwebs is set. This is used when you want to show all root webs and the entire subweb tree of the web or subweb specified in subwebs . If set to "off" , only subwebs are shown when subwebs is defined. | "on" |
- Example:
%EXTENDEDWEBLIST{" * [[$name.WebHome]]"}%
- creates a bullet list of all webs.
- Example:
<form><select name="web"> %WEBLIST{"<option $marker value=$qname>$name</option>" webs="Trash, public" selection="%WEB%" separator=" "}% </select></form>
- creates a dropdown of all public webs + Trash web, with the current web highlighted.
- Related: TOPICLIST, SEARCH, WEBLIST
Example
If this plug-in is installed you should get a weblist below in bullet view
%EXTENDEDWEBLIST{" * $indentedname" subwebs="Extensions" rootwebs="on" webs="public"}%
Installation Instructions
You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server.
Open configure, and open the "Extensions" section. Use "Find More Extensions" to get a list of available extensions. Select "Install".
If you have any problems, or if the extension isn't available in
configure
, then you can still install manually from the command-line. See
http://foswiki.org/Support/ManuallyInstallingExtensions for more help.
Plugin Info
Change History: |
|
1.1 (30 Jul 2015) |
Foswiki:Main.KennethLavrsen - Removed forgotten debug line that flooded debug log. Fixed a regex that could miss certain web names. Please don't perltidy my plugins again |
1.0 (10 Dec 2008) |
Initial version. Plugin policy is feel free to modify in compatible way |
CPAN Dependencies: |
none |
Other Dependencies: |
none |
Perl Version: |
5.008 |
Related Topics: Plugins,
DeveloperDocumentationCategory,
AdminDocumentationCategory,
DefaultPreferences,
SitePreferences