Adds useful methods to Helma's built-in HopObject prototype.
To use this optional module, its repository needs to be added to the application, for example by calling app.addRepository('modules/core/HopObject.js')
To use this optional module, its repository needs to be added to the application, for example by calling app.addRepository('modules/core/HopObject.js')
Methods
Iterates over each child node of the HopObject.
parameters
Function | callback |
The callback function to be
called for each child node. On every call the first
argument of this function is set to the current value
of the counter variable i .
|
macro returns the id of a HopObject
macro returns the url for any hopobject
parameters
param | ||
action |
macro rendering a skin or displaying
its source (param.as == "source")
parameters
param | ||
name |
this macro renders a text depending on
the value of a given property
parameters
param |
generic macro that loops over the childobjects
and renders a specified skin for each of them
parameters
Object | providing the following properties: skin: the skin to render for each item (required) collection: the collection containing the items limit: max. number of items per page (req.data.page determines the page number) sort: property name to use for sorting order: sort order (either "asc" or "desc") itemPrefix: text to prepend to each items skin render itemSuffix: text to append to each items skin render |
Render the number of child nodes of the HopObject.
Three cases are distinguished which can be customized
by setting param.verbose to "true" and defining the
corresponding field of the
param
argument:
- param.none - not a single child node
- param.one - exactly one child node
- param.many - more than one child node
parameters
Object | param | The default macro parameter |
String | name | The default name for a child node |