Download for PHP  R515 (beta)
Welcome » Extensions » Extension list » SortAssocLists
Expand

Input document

.

Upload document:

SortAssocLists

Extension list »

See also AnchorizeAssocLists.

Once called all document’s associative lists become sorted by their term name (<dt>).

Parameters

by
Either text or raw. The first compares items’ plain text while the latter compares their source markup. For example, when comparing **bold** and apriore text compares «bold» and «apriore» and the latter goes the first while raw compares «**b…» and "«a…» and the former comes before the latter.
collation
Name of collation used to compare strings (using strcoll function); is passed to setlocale PHP function. Since UverseWiki internally works with UTF-8 this collation must specify UTF-8 as well – for this reason if «.UTF-8» suffix isn’t given it’s appended automatically.
  • Sample collation names (for most *nix systems): ru_RU, en_US.
desc
Lets you sort lists in descending order.
on
render Lets you delay this action to run on render phase rather than on parse phase – this way it’s possible to sort associative lists dynamically produced by other actions, if any. This flag is always set when by is text.
type
Comparison type: str (default), int, float. Last two options pick from items’ value (see by) earliest substrings looking like numbers and compares them. For float decimal part separators are period and comma (4.5 and 4,5 are the same).

Sorting individual lists

This action affects all lists in current document so you can’t sort some of them using one set of settings and others using a different setup. However, you can create nested documents with %%(wacko) formatter:

As you see,
this list is sorted as
Note
the order – asterisk goes before «And».
strings
based on items’ raw markup.
33
sorted as integers
22
in descending order.
11
And this list is

Languages