OpenWGA 7.8 - WebTML reference

WebTML tags » foreach

<tml:foreach sortmeta ="meta-field">


Sorts the iteration output by a  metadata field


This is only valid for type="content".

Use this attribute together with sortorder. It specifies the name of a metadata field, whose values will be used for sorting. The output will be sorted by the natural sorting order of the fields values.

Sorting can have very bad performance on large collections, even if only a small part of that collection is displayed. The reason for this is that OpenWGA needs to load all documents in the collection before it can sort them and determine what documents are in the requested page.

On collections from queries please consider using the query languages own ordering capabilities instead if possible.

On navigators please consider using attribute order instead if possible.


Name of the metadata field to sort by


This example sorts the output by the documents title:


    <tml:query> ... </tml:query>
    <tml:foreach sortorder="ascending" sortmeta="TITLE">
    <li><tml:meta name="title"/></li>