OpenWGA 7.8 - WebTML reference

WebTML tags » foreach

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

Purpose:

Sorts the iteration output by a  metadata field

Description:

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.


Value(s):

Name of the metadata field to sort by

Examples:

This example sorts the output by the documents title:

<tml:collection>

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