You have been redirected from an outdated version of the article. Below is the content available on this topic. To view the old article click here.

all()

Usage

all(collection, expression)

Description

Evaluates a StructrScript expression for every element of a collection and returns true if the expression evaluates to true for all of the elements. The keyword data contains a reference to the loop variable. See also: any() and none().

Example

${all(user.groups, is_allowed(data, current, 'read'))}

Search results for "all()"

all()

Evaluates a StructrScript expression for every element of a collection and returns true if the expression evaluates to true for all of the elements. The keyword data contains a reference to the loop variable. See also: any() and none().

all(collection, expression)

call()

Calls the SchemaMethod with the given name and returns the result. This method is used to execute global schema methods (methods that are not associated with a type).

call(name [, key1, value1 [, ... ]] )
$.call(name [, map])

JavaScript

In any other than the JavaScript context, you are required to use get() and call() to access built-in functions and constants. This results in code like the following example.

Business Logic

The third option to implement logic is to use a global schema method, especially when the logic is not bound to a specific type. Global schema methods can be called via REST using a special maintenance endpoint, scheduled for execution with a cron-like syntax or called from any scripting envrionment using the call() or call_privileged() functions.