Plugin Sort
This Wiki Plugin allows you to sort lines of text alphabetically in ascending or descending order, reverse the current sorting, or shuffle them. Since Tiki versions 6.5, 7.3 and 8.0, the sorting is natural and case insensitive.Usage
To use this plugin in a wiki page, use the syntax:{SORT(sort=>"asc|desc|reverse|shuffle")}data{SORT} - one data per lineRequired parameters are in bold
Preferences required: wikiplugin_sort
| Parameters | Accepted Values | Description | Default | Since |
| sort | asc desc reverse shuffle |
Set the sort order of lines of content (default is ascending) | asc |
Note that the plugin treats the lines that {SORT()} and {SORT} are on as the first and last line. This may be changed in the future.
Example 1
This code,^{SORT(sort=>asc)}Some messy lines
that need to be sorted
now we can
thanks to Oliver{SORT}^Would produce:
now we can
Some messy lines
thanks to Oliver
that need to be sorted
Some messy lines
thanks to Oliver
that need to be sorted
Example 2 (natural sorting and case insensitive)
This code,^{SORT()}
IMG0.png
IMG3.png
img1.png
img10.png
img12.png
img2.png
{SORT}^Would produce:
IMG0.png
img1.png
img2.png
IMG3.png
img10.png
img12.png
img1.png
img2.png
IMG3.png
img10.png
img12.png
And since Tiki 6.5, 7.3 and 8.0, it produces:
IMG0.png
img1.png
img2.png
IMG3.png
img10.png
img12.png
- natcasesort — Sort an array using a case insensitive "natural order" algorithm
http://php.net/manual/en/function.natcasesort.php
