OpenWGA 7.7 - TMLScript reference

CollectionResult
Method :

each(function)

On object CollectionResult
Usage Applies a function to each element of the collection result.
Description

The given function is called for every document that is retrieved from the collection and receives it as a TMLContext parameter.

Parameters

function (Function):

A JavaScript function

Return value The CollectionResult for further chaining.
Allowed in script types
  • WebTML pages and normal WebTML actions
  • Master actions
  • TMLScript tasks in jobs
  • Content type events
Examples


WGA.nav().children().each(function(doc){
    console.log(doc.TITLE)
});