TopicListPlugin
Gives you the possibility to generate a list of topics by macro or rest handler. Should be also optimized for a great number of topics
Introduction
Yet it is not able to use a rest function to recieve a list of all topics of a web, picking them up e.g. by the starting character "S" or similar. A use case is e.g. the
TinyMCE editor, when you like to be able to pick the topics out of list when you try to link.
The goal is, to make this plugin efficient even if you have a great number of topics. Mostly this can be done, by excluding topics by a starting character, to shorten/filter the result.
Usage
Macro %GETTOPICLIST%
Parameter |
Default |
Description |
searchwebs |
Current web |
which web should be used to get the topic-list. User -all- for getting all topics of all webs. you can also use a comma-separated list of webs |
pattern |
* ( all ) |
regular expression for matching topic-names |
casesens |
1 |
be case sensitive |
negate |
0 |
negate the pattern. So all topics which do match the pattern, are not shown |
max |
50 |
maximum number of results. Use 0 for infinite |
order |
< |
literal order, < for increasing, > for decreasing |
format |
" * [[%WEB.%TOPIC][%TOPIC]]" |
format for each resulting row, %WEB gets replaced by the web, %TOPIC by the topic name |
_delimiter |
"\n" |
what delimiter should be used to seperated the topics |
_globalformat |
"%TOPICS" |
the whole topic list will replace the %TOPICS varibale in this string. This string will be return as the result of the rest handler |
Examples:
- List maximum 20 topics of this web starting with "S", decreasing order: %GETTOPICLIST{pattern="^S.*$" max="40" order=">"}%
%GETTOPICLIST{searchwebs="-all-" pattern="^S.*$" max="40" order=">"}%
- List all topics of this Main web not starting with "S", increasing order: %GETTOPICLIST{searchwebs="Main" pattern="^S.*$" negate="1" max="20"}%
Rest Methods
topicList
Parameter |
Default |
Description |
searchwebs |
Current web |
which web should be used to get the topic-list. User -all- for getting all topics of all webs. you can also use a comma-separated list of webs |
pattern |
* ( all ) |
regular expression for matching topic-names |
casesens |
1 |
be case sensitive |
negate |
0 |
negate the pattern. So all topics which do match the pattern, are not shown |
max |
50 |
maximum number of results. Use 0 for infinite |
order |
< |
literal order, < for increasing, > for decreasing |
format |
"'%TOPIC'" |
format for each resulting row, %WEB gets replaced by the web, %TOPIC by the topic name. The result is by default formated as JSON array item |
_delimiter |
"," |
what delimiter should be used to seperated the topics |
_globalformat |
"[%TOPICS]" |
the whole topic list will replace the %TOPICS varibale in this string. This string will be return as the result of the rest handler, by default a JSON array |
Installation instructions
- just use the installer attached to the topic or even easier, use the configure-system/Extension to easy install it through an user-interface
Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the Plugin on the server where Foswiki is running.
- Set SHORTDESCRIPTION = Gives you the possibility to generate a list of topics by macro or rest handler. Should be also optimized for a great number of topics
Related Topics: SitePreferences,
Plugins