simple plugin to limit the length of a list
Description
This is a simple plugin to ease the display of very long lists. Sometimes those lists are so long that you may
not be able or you don't want to display all the items at once. Instead, it is sufficiant to display the first few
items and them a "more" button to reveal the rest of the list.
Examples
You type:
%LIMITLIST{
"1, 2, 3, 4, 5, 6, 7, 8, 9, 10"
split="\s*,\s*"
}%
You get (if installed):
%LIMITLIST{
"1, 2, 3, 4, 5, 6, 7, 8, 9, 10"
split="\s*,\s*"
}%
Syntax
%LIMITLIST{"a,b,c, ..." params}%
Parameter |
Description |
Default |
"..." or text="..." |
the list to process |
|
split="..." |
expression to split the list; won't process the list unless defined |
|
separator="..." |
when processing the list by specifying a split it will be joined again using this character |
, |
format="..." |
format string to be used when processin the list |
<span>$1</span> |
max="..." |
maximum number if items to display at first |
5 |
more_text="..." |
text to be displayed when the list is collapsed |
more |
less_text="..." |
text to be displayed when the list is expanded |
less |
When the list needs to be processed in a more elaborated way please use the
FilterPlugin.
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. "Extensions Operation and Maintenance" Tab -> "Install, Update or Remove extensions" Tab. Click the "Search for Extensions" button.
Enter part of the extension name or description and press search. Select the desired extension(s) and click install. If an extension is already installed, it will
not show up in the
search results.
You can also install from the shell by running the extension installer as the web server user: (Be sure to run as the webserver user, not as root!)
cd /path/to/foswiki
perl tools/extension_installer <NameOfExtension> 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
https://foswiki.org/Support/ManuallyInstallingExtensions for more help.
Dependencies
None
Change History
25 Jan 2024 |
initial release |