Loading...
 
Skip to main content

History: PluginSort

Source of version: 10 (current)

Copy to clipboard
            ! Plugin Sort
Use this ((wiki plugin)) 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.

!!Parameters
{pluginmanager plugin="sort"}
{REMARKSBOX()}Note that the plugin treats the lines that -+~np~{SORT()}~/np~+- and -+~np~{SORT}~/np~+- are on as the first and last line. {REMARKSBOX}
!! Examples
!!!Example 1
''This code:''
{CODE(colors="tiki")}
^{SORT(sort="asc")}Some messy lines
that need to be sorted
now we can
thanks to Oliver{SORT}^
{CODE}

''Would produce:''
^{SORT(sort="asc")}Some messy lines
that need to be sorted
now we can
thanks to Oliver{SORT}^

!!! Example 2 (natural sorting and case insensitive)
''This code:''
{CODE(colors="tiki")}
^{SORT()}
IMG0.png
IMG3.png
img1.png
img10.png
img12.png
img2.png
{SORT}^
{CODE}

''Would produce:''
^{SORT()}
IMG0.png
IMG3.png
img1.png
img10.png
img12.png
img2.png
{SORT}^
!!Related pages
* -+natcasesort+- — Sort an array using a case insensitive "natural order" algorithm
+ http://php.net/manual/en/function.natcasesort.php