Tag library reference for the following tag libraries:
Core tag library for CMS
This is version 3.5.
Required attributes are marked with a *
Everything between adminOnly tags will only be shown on an authoring instance, not on a public instance. This allows you to provide functionality that is only available to page authors but not to the general public.
Can contain: JSP
<cms:adminOnly>
<cms:editBar/>
</cms:adminOnly>
| Name | Description | Type |
|---|---|---|
| showInPreview | Show content in the Preview. Default is false. | boolean |
adds an attribute to the request within an includeTemplate tag
Can contain: EMPTY
| Name | Description | Type |
|---|---|---|
| name* | String | |
| value | String |
Adds a button to a parent bar. Must be nested into a mainBar or newBar to work.
Can contain: EMPTY
| Name | Description | Type |
|---|---|---|
| dialogName* | Name of the dialog to open | String |
| label* | Label for this button | String |
| position* | Where to add this button. Can be left or right. Default is left | String |
iterate over contentNode collection
Can contain: JSP
<cms:contentNodeIterator contentNodeCollectionName="mainColumnParagraphs">
<cms:adminOnly>
<cms:editBar/>
</cms:adminOnly>
<cms:includeTemplate/>
</cms:contentNodeIterator>
| Name | Description | Type |
|---|---|---|
| begin | Zero-based index of first item to process, inclusive. | int |
| contentNode | The content object to use. | String |
| contentNodeCollectionName | contentNodeIterator is used whenever you want to loop over content, typically paragraphs. A parameter contentNodeCollectionName will contain the name of the contentNode you are looping over. contentNodeCollectionName is created by providing a newBar with the corresponding name. This will result in elements being created within that contentNode, and thus allow you to loop over these. | String |
| end | Zero-based index of last item to process, inclusive. | String |
| items | if this attribute is set, the tag will iterate on the collection directly passed here instead of fetching the collection named by contentNodeCollectionName. This collection must contains info.magnolia.cms.core.Content items. | java.util.Collection |
| path | The absolute path to the content. You must define the repository attribute if the content is not stored in the website repositoty | String |
| repository | Used if the uuid or path attribute is set. Defaults to website | String |
| step | Process every stepth element (e.g 2 = every second element). | int |
| uuid | The uuid to use for finding the content. You must define the repository attribute if the content is not stored in the website repositoty | String |
| varStatus | Name of variable to hold the loop status with the following properties: index ? position of the current item; count ? number of times through the loop (starting with 1); first ? boolean indicator if this is the first iteration; last ? boolean indicator if this is the last iteration | String |
Displays Magnolia editBar which allows you to edit a paragraph. This tag is often used within contentNodeIterator, which in turn will set all relevant parameters automatically.
Can contain: JSP
| Name | Description | Type |
|---|---|---|
| adminOnly | Show only in admin instance, default to true. | boolean |
| contentNodeCollectionName | The contentNode collection. | String |
| contentNodeName | The contentNode (i.e. paragraph) you wish to edit. | String |
| deleteLabel | The text of the delete button, defaults to "Delete"; use "" to get no delete button. | String |
| editLabel | The text of the edit button, defaults to "Edit". | String |
| moveLabel | The text of the move button, defaults to "Move"; use "" to get no move button. | String |
| paragraph | Name of paragraph (as defined in config). Does not have to be set inside "contentNodeIterator". | String |
display edit button
Can contain: EMPTY
| Name | Description | Type |
|---|---|---|
| adminOnly | Show only in admin instance, defaults to true. | boolean |
| contentNodeCollectionName | String | |
| contentNodeName | String | |
| label | String | |
| paragraph | String | |
| small | boolean | |
| template | String | |
| editLabel | @deprecated | String |
| parFile | @deprecated | String |
this is exactly the opposite of the ifNotEmpty Tag
Can contain: JSP
| Name | Description | Type |
|---|---|---|
| actpage | If true we work on the current page instead of the current paragraph | boolean |
| atomName | String | |
| contentNodeCollectionName | String | |
| contentNodeName | String | |
| nodeDataName | String | |
| containerListName | @deprecated use contentNodeCollectionName | String |
| containerName | @deprecated use contentNode | String |
This is exactly the opposite of the ifNotExisting Tag.
Can contain: JSP
| Name | Description | Type |
|---|---|---|
| actpage | If true we work on the current page instead of the current paragraph | boolean |
| contentNodeCollectionName | String | |
| contentNodeName | String | |
| nodeDataName | String |
checks if the current container is first in the collection
Can contain: JSP
This tag has no attributes.
checks if the current container is last in collection
Can contain: JSP
This tag has no attributes.
evaluates the body only if a container exitsts and / or the corresponding atom exists and is not empty
Can contain: JSP
| Name | Description | Type |
|---|---|---|
| actpage | If true we work on the current page instead of the current paragraph | boolean |
| atomName | String | |
| contentNodeCollectionName | String | |
| contentNodeName | String | |
| nodeDataName | String | |
| containerListName | @deprecated use contentNodeCollectionName | String |
| containerName | @deprecated use contentNode | String |
evaluates the body only if a container and / or the corresponding atom does not exist
Can contain: JSP
| Name | Description | Type |
|---|---|---|
| actpage | If true we work on the current page instead of the current paragraph. | boolean |
| contentNodeCollectionName | String | |
| contentNodeName | String | |
| nodeDataName | String |
Include a JSP. This is typically used to render a paragraph. Within contentNodeIterator, parameters are provided automatically by the loop.
Can contain: JSP
| Name | Description | Type |
|---|---|---|
| contentNode | info.magnolia.cms.core.Content | |
| contentNodeName | the name of the contentNode (i.e. paragraph) you wish to show | String |
| container | @deprecated use contentNode | info.magnolia.cms.core.Content |
| path | @deprecated. file to be included (e.g. /templates/jsp/x.jsp) This is deprecated: just use basic jsp tags (i.e. <jsp:include/>) if you need to include a jsp in your templates. | String |
Add the needed css and js links for magnolia edit controls. This tag should always bee added to html head.
Can contain: EMPTY
| Name | Description | Type |
|---|---|---|
| adminOnly | Show links only in admin instance, default to true. You can set it to false if you want magnolia css and js files added also for a public instance. | boolean |
Loads another page into actpage. One usage would be within a site-menu structure. loadPage does not nest pages, so the corresponding unloadPage-tag will not revert to the previously loaded page, but restore actpage to the currently displayed page, i.e. the value it held before loadPage was called for the first time.
Can contain: JSP
| Name | Description | Type |
|---|---|---|
| level | ??? | int |
| path | path of the page to be loaded | String |
| templateName | ??? | String |
sub tag of loadPage, its body contains the path of the page to load
Can contain: JSP
This tag has no attributes.
Displays the mainBar, i.e. the bar that allows you to change the page properties and switch to preview mode. This tag also add the CSS and JS links if not previously defined, but it's recommended to add the cms:links tag to the header of the page. CSS links are not valid inside the HTML body tag.
Can contain: JSP
| Name | Description | Type |
|---|---|---|
| adminButtonVisible | Set it to false if you don't want to show the AdminCentral button | boolean |
| label | Label for the page properties button | String |
| paragraph | Name of the paragraph for the page properties (as defined in config) | String |
Displays a newBar that allows you to create new paragraphs.
Can contain: JSP
<cms:newBar
contentNodeCollectionName="mainColumnParagraphs"
paragraph="samplesTextImage,samplesDownload,samplesLink"/>
| Name | Description | Type |
|---|---|---|
| adminOnly | Show only in admin instance, default to true. | boolean |
| contentNodeCollectionName | stored under this name, you will need the name for later retrieval of contents. (required) | String |
| newLabel | text of the button, defaults to "New" | String |
| paragraph | comma separated list of paragraph types | String |
Writes out the content of a nodeData or - for nodeData of type binary - information of the nodeData
Can contain: EMPTY
<!-- EXAMPLE - outputting a nodes value into the page -->
<!-- output the value stored in the node namd "title" -->
<cms:out nodeDataName="title"/>
<!-- EXAMPLE - outputting a node into an EL variable -->
<!-- output the value stored in the node namd "myprop" to a variable named "check" -->
<!-- thus exposing it to EL functionality -->
<cms:out nodeDataName="myprop" var="check"/>
<c:if test="${check == 'ok'}">
done
</if>
<!-- EXAMPLE - outputing a link from a uuid stored in a node -->
<!-- output a relative link to the page whose UUID is stored in the node named "link" to a variable "relative_link" -->
<cms:out nodeDataName="link" var="relative_link uuidToLink="relative" />
<a href="${relative_link}">go to page</a>
<!-- EXAMPLE - writing a binary file's URL out as a variable -->
<!-- this example shows how to display an image stored in the content repository using cms:out -->
<cms:ifNotEmpty nodeDataName="image">
<cms:out nodeDataName="image" var="imageurl" />
<img class="navIcon" src="${pageContext.request.contextPath}${imageurl}" />
</cms:ifNotEmpty>
| Name | Description | Type |
|---|---|---|
| actpage | If true we work on the current active page instead of any other node. | boolean |
| contentNode | The content object to use. | String |
| contentNodeCollectionName | String | |
| contentNodeName | # Inside a "contentNodeIterator" * if not set, the current content node is taken. * if set empty (contentNodeName=""), the top level content is taken. * if specified, the named content node is taken. # Outside a "contentNodeIterator" * if not set or empty: the top level content is taken * if specified, the named content node is taken | String |
| dateLanguage | String | |
| datePattern | String | |
| defaultValue | Default value used if the expresion evaluates to null or an empty string | String |
| fileProperty | String | |
| inherit | Inherit the value from parent pages, if not set in the current one. | boolean |
| lineBreak | defaults to BR-tag. Set to "" to have no line break at all, or any other value to be used as the line break. | String |
| nodeDataName* | the name of the nodeData you wish to write out (required). There are following special values supported name, uuid, path, handle. If you specify one of special values, the behavior changes to output the name, uuid, path, or handle of the node instead of the value it stores. | String |
| path | The absolute path to the content. You must define the repository attribute if the content is not stored in the website repository. | String |
| repository | Used if the uuid or path attribute is set. Defaults to website. | String |
| scope | Scope for the attribute named from the "var" parameter. Setting this attribute doesn't have any effect if "var" is not set. | String |
| uuid | The uuid to use for finding the content. You must define the repository attribute if the content is not stored in the website repository. | String |
| uuidToLink | Transform a uuid value to a link. The following values are supported: none: no uuid to link resolving. (default value) absolute: Resolve to a absolute link using the repository to uri mapping feature. handle: resolve to a absolute link but do not use the repository to uri mapping. relative: resolve to relative path. Path is relative to current page. | String |
| uuidToLinkRepository | Used if the uuidToLink attribute is set. The content is found in this repository. Defaults to website. | String |
| var | If set, the result of the evaluation will be set to a variable named from this attribute (and in the scope defined using the "scope" attribute, defaulting to PAGE) instead of being written directly to the page. | String |
iterate over Content (page) collection
Can contain: JSP
| Name | Description | Type |
|---|---|---|
| hiddenAttribute | If a page contains a boolean property with this name and it is set to true, the page is skipped by the iterator. Defaults to "hidden". | String |
Everything between publicOnly tags will only be shown on the public instance.
Can contain: JSP
<cms:publicOnly>
Public now!
</cms:publicOnly>
| Name | Description | Type |
|---|---|---|
| showInPreview | Show content in the Preview. Default is true. | boolean |
Execute a query on a magnolia repository.
Can contain: EMPTY
| Name | Description | Type |
|---|---|---|
| nodeType | Nodetype for nodes to return. Defaults to "mgnl:content" | String |
| query* | the query | String |
| repository | The repository to execute this query on. Defaults to "website" | String |
| type | Query type: "sql" or "xpath". Defaults to xpath. | String |
| var* | The result for this query (Collection of content objects) will be added to the pageContext with this name. | String |
Set contentNode in resource
Can contain: EMPTY
| Name | Description | Type |
|---|---|---|
| content | Same as contentNode but deprecated | String |
| contentNode | The content object to use. | String |
| contentNodeCollectionName | Name of the collection holding the content node, e.g. "mainColumnParagraphs" | String |
| contentNodeName | Inside a "contentNodeIterator": if not set the current content node is taken, if set empty (contentNodeName="") the top level content is taken, if specified the named content node is taken. Outside a "contentNodeIterator": if not set or empty: the top level content is taken, if specified, the named content node is taken | String |
| forBodyOnly | If true the node is unset after the end tag. Default is false. | String |
| path | The absolute path to the content. You must define the repository attribute if the content is not stored in the website repositoty | String |
| repository | Used if the uuid or path attribute is set. Defaults to website | String |
| scope | Attention this is not the jstl scope but the magnolia scope! Values are local: same as paragraph paragraph: the current paragraph global: a globally use node (default value) page: same as page current: the current page | String |
| uuid | The uuid to use for finding the content. You must define the repository attribute if the content is not stored in the website repositoty | String |
| container | @deprecated use contentNode | info.magnolia.cms.core.Content |
| containerName | @deprecated use contentNodeName | String |
Exposes a content node to the pagecontext as a Map of nodeData, in order to access the exposed object using JSTL.
Can contain: EMPTY
<cms:setNode var="currentNode"/>
<c:if test="${!empty currentNode.title}">
<c:out value="${currentNode.title}"/>
</c:if>
| Name | Description | Type |
|---|---|---|
| content | Same as contentNode but deprecated | String |
| contentNode | The content object to use. | String |
| contentNodeCollectionName | Name of the collection holding the content node, e.g. "mainColumnParagraphs" | String |
| contentNodeName | Inside a "contentNodeIterator": if not set the current content node is taken, if set empty (contentNodeName="") the top level content is taken, if specified the named content node is taken. Outside a "contentNodeIterator": if not set or empty: the top level content is taken, if specified, the named content node is taken | String |
| path | The absolute path to the content. You must define the repository attribute if the content is not stored in the website repositoty | String |
| repository | Used if the uuid or path attribute is set. Defaults to website | String |
| scope | Scope for the variable. Can be "page" (default), "request", "session", "application" | String |
| uuid | The uuid to use for finding the content. You must define the repository attribute if the content is not stored in the website repositoty | String |
| var* | The content node will be added to the pagecontext with this name. | String |
The unloadPage-tag will restore actpage to the currently displayed page. This can be necessary after you have used loadPage to temporarily have access to a different page, e.g. for building a menu.
Can contain: EMPTY
This tag has no attributes.
Set the current user (info.magnolia.cms.security.User) into a pageContext variable.
Can contain: EMPTY
| Name | Description | Type |
|---|---|---|
| anonymous | Display anonymous users as "anonymous". Default to false (variable will not be set for anonymous users) | boolean |
| var* | The current user will be set to the pageContext variable with this name. | String |
@deprecated this tag does nothing in magnolia 2.x
Can contain: EMPTY
This tag has no attributes.
Core functions for CMS
This is version 3.5.
Required attributes are marked with a *