OpenWGA 5.4 - WebTML reference
WebTML tags<tml:foreach>
Description :For all iterations. The body of this tag gets displayed for every iteration.
By specifying attribute "type" you determine what you want to iterate over:
- type="content" iterates over content documents from a variety of sources
- type="itemvalue" iterates over the values stored in an item or WebTML variable
- type="loop" iterates simply a given number of times
See the documentation of these types for a proper description.
show inherited attributes ... | |||
Name | Value(s) | Purpose | |
count | 1...n | Specifies on type="loop" the number of iterations | |
currentvalue | Variable | For type="itemvalue", type="loop" und type="tagresult" the current values of the iteration were written to the specified variable. | |
filllastpage | true|false|t|f|1|0 | Controls, if the last page of a foreach-loop will be filled up with the last documents of the previous page, if the remaining documents are fewer than the pagesize. This only effects foreach loops with set pagesize. Defaults to "true". | |
filter | TMLScript expression | Specifies a TMLScript expression to filter values or documents that are iterated | |
item | item/variable | Specifies on type="itemvalue" the name of an item whose value is to iterate over | |
linear | true|false | Enables "linear fetching", providing a more linear paging behaviour when invisible documents are involved | |
offset | 1..n | Specifies an offset from which the foreach tag should start iteration and paging computation | |
onlypublished | true|false |
Specifies if only published documents should be considered in the iteration. |
|
page | 1..n | Explicitly select the page to display on a paged output | |
pagesize | 1...n |
Dividing up the output into separate pages, each holding the number of results specified |
|
relationgroup | groupname | Lets type="content" Iterate over the targets of a relation group | |
sortexpression | expression |
Sorts the result of the iteration. By sorting lists of values the native sorting method of the values is used. sortExpression is only allowed on iterations over content documents. It can be used to insert a expression in TMLScript, to sort content documents by the expressions result. |
|
sortitem | item/variable | This attribute specifies the item to sort by, if you iterate over content documents. It is a alternative to sortexpression or sortmeta. | |
sortlanguage | tmlscript|native | Specifies the expression language for the attribute sort expression. | |
sortmeta | Meta-Feld | If you iterate over content documents this attribute specifies the metadata-field to sort by. This attribute is alternative to sortexpression or sortitem. | |
sortorder | ascending|descending | Sorts the result of iteration. A value lists will be sorted negative by its values. sortExpression is only allowed at iterations over content documents. sortExpression can be used to insert a expression in TMLScript, to sort content documents by the expressions result. | |
sourcetag | Tag-ID |
Specifies the id of source tag for a iteration over content documents if type="content". |
|
type="content" | content |
Iterates over content documents |
|
type="itemvalue" | itemvalue |
Iterates over the values stored in an item or WebTML variable |
|
type="loop" | loop |
Iterates a given number of times |
|
xplanguage | native | tmlscript |
Specifies the type of expression language for the attribute sortexpression. |
Tag-Infos :
currentpage: Number of the current displayed page.
pages:Total number of all representable pages.
currentvalue: The current value of the iteration(in detail at type="itemvalue|tagresult|level" the current item value/value in result tag/level).
haspreviouspage: Boolean-object, to indicate if a previous page exists (not made for direct use - use <tml:if haspreviouspage ...>).
hasnextpage: Boolean-objekt, to indicate if a next page exists(not made for direct use - use <tml:if hasnextapge ...>).
startindex: Index of the first value of the current displayed page.
endindex: Index of the last value of the current displayed page.
count: Total number of representable values.
iteration: The current number of iteration.
Examples:
pages:Total number of all representable pages.
currentvalue: The current value of the iteration(in detail at type="itemvalue|tagresult|level" the current item value/value in result tag/level).
haspreviouspage: Boolean-object, to indicate if a previous page exists (not made for direct use - use <tml:if haspreviouspage ...>).
hasnextpage: Boolean-objekt, to indicate if a next page exists(not made for direct use - use <tml:if hasnextapge ...>).
startindex: Index of the first value of the current displayed page.
endindex: Index of the last value of the current displayed page.
count: Total number of representable values.
iteration: The current number of iteration.
See documentation about values of the type attribute for examples how to use them: