Magnolia 5.6 reached end of life on June 25, 2020. This branch is no longer supported, see End-of-life policy.
...
The function examples on this page require sample content. Look at each example to figure out what kind of content it needs.
Example: children
Children
is a function that retrieves the children of the current node. To get meaningful results you need to execute the code on a page that has some children.
...
Returns a map of localized links to the current node. This means: If you have defined three locales en
, de_DE
and de_CH
the function returns localized links to the node of the context on which you are applying the function. (If the current content node is a component, the function searches the parent page node.) Magnolia 5.4.1+
Example: The map could look like this:
...
String dump(Object obj, int depth, boolean asHtml)
obj | required Specifies the object type to be inspected. The following objects are available in the default implementation of this inspector function:
|
depth | optional, default is 3 Specifies the depth of the inspection. |
asHtml | optional, default is false Output into a simple HTML format. |
String
cmsfn.dump(obj, depth, asHtml)
...
Checks whether the content is requested in the page editor in edit mode on author instance.
boolean isEditMode()
...
Checks whether the content is requested in the page editor in preview mode. The check can be run either on the author instance or on the public instance.
boolean isPreviewMode()
...
Code Block | ||
---|---|---|
| ||
[#assign queryStringAndFragment = cmsfn.queryStringAndFragment("http://example.com#myApp::running?q=abcd")] Query string and fragment: ${queryStringAndFragment} |
See also Get localized links above.
Retrieves the language currently used.
...
Code Block | ||
---|---|---|
| ||
<html xml:lang="${cmsfn.language()}" lang="${cmsfn.language()}" class="no-js"> |
Info |
---|
Please note that |
...
content | required The content map whose metadata you want to get. | |||||||||||||||||||||||||
property | required Metadata property: |
CREATED | "mgnl:created" |
CREATED_BY | "mgnl:createdBy" |
LAST_MODIFIED | "mgnl:lastModified" |
LAST_MODIFIED_BY | "mgnl:lastModifiedBy" |
TEMPLATE | "mgnl:template" |
LAST_ACTIVATED | "mgnl:lastActivated" |
LAST_ACTIVATED_BY | "mgnl:lastActivatedBy" |
ACTIVATION_STATUS | "mgnl:activationStatus" |
DELETED | "mgnl:deleted" |
DELETED_BY | "mgnl:deletedBy" |
COMMENT | "mgnl:comment" |
...