Tag reference sheet

Tag library reference for the following tag libraries:

cms functions - version 3.5

Core functions for CMS

Namespace definition: xmlns:cmsfn="http://www.magnolia.info/tlds/cmsfn-taglib.tld"

EL Functions

Required attributes are marked with a*

cmsfn:canEdit()

Function class: info.magnolia.cms.taglibs.CmsFunctions

Function signature: boolean canEdit()

Check if the current user can edit the active page

cmsfn:currentPage()

Function class: info.magnolia.cms.taglibs.CmsFunctions

Function signature: info.magnolia.cms.core.Content currentPage()

Returns the current active page (can be set using the loadPage tag).

cmsfn:currentParagraph()

Function class: info.magnolia.cms.taglibs.CmsFunctions

Function signature: info.magnolia.cms.core.Content currentParagraph()

Returns the current paragraph.

cmsfn:editMode()

Function class: info.magnolia.cms.taglibs.CmsFunctions

Function signature: boolean isEditMode()

Check if the current page is open in editing mode. Shortcut for checking if the server is admin, preview unset, permissions to modify the page available for the current user.

cmsfn:firstPageWithCollection(java.lang.String,int)

Function class: info.magnolia.cms.taglibs.CmsFunctions

Function signature: boolean firstPageWithCollection(java.lang.String,int)

Find and load the first parent page containing named collection of nodes. This function can be useful while building pages that should inherit columns from parent pages. Loaded page must be unloaded using the <cms:unloadPage /> tag. Sample use: <pre> <c:if test="${cmsfn:firstPageWithCollection("column", 3)}"> content inherited from page ${cmsfn:currentPage().handle}.html <cms:contentNodeIterator contentNodeCollectionName="column"> <cms:includeTemplate /> </cms:contentNodeIterator> <cms:unloadPage /> </c:if> </pre>

cmsfn:firstPageWithNode(java.lang.String,int)

Function class: info.magnolia.cms.taglibs.CmsFunctions

Function signature: boolean firstPageWithNode(java.lang.String,int)

Find and load the first parent page containing a named node. This function can be useful while building pages that should inherit a paragraph from parent pages. Loaded page must be unloaded using the <cms:unloadPage /> tag. Sample use: <pre> <c:if test="${cmsfn:firstPageWithNode("node", 3)}"> content inherited from page ${cmsfn:currentPage().handle}.html <<cms:includeTemplate contentNodeName="node" /> <cms:unloadPage /> </c:if> </pre>

cmsfn:getSelector()

Function class: info.magnolia.cms.util.SelectorUtil

Function signature: java.lang.String getSelector()

cmsfn:isLoggedIn()

Function class: info.magnolia.cms.taglibs.CmsFunctions

Function signature: boolean isLoggedIn()

Check if a user is currently logged in (not anonymous)

cmsfn:link(java.lang.String)

Function class: info.magnolia.cms.taglibs.CmsFunctions

Function signature: java.lang.String link(java.lang.String)

Output the url of a given content (usually a page), as context path + page handle + default extension

cmsfn:mainPage()

Function class: info.magnolia.cms.taglibs.CmsFunctions

Function signature: info.magnolia.cms.core.Content mainPage()

Returns the main loaded page (doesn't change when using the loadPage tag).

cmsfn:nodeDataIterator(info.magnolia.cms.core.Content, java.lang.String)

Function class: info.magnolia.cms.taglibs.CmsFunctions

Function signature: java.util.Collection nodeDataIterator(info.magnolia.cms.core.Content, java.lang.String)

Function to iterate over a node Data that has "checkbox" as control type, for example. See http://jira.magnolia-cms.com/browse/MAGNOLIA-1969

cmsfn:systemProperties()

Function class: info.magnolia.cms.taglibs.CmsFunctions

Function signature: java.util.Properties systemProperties()

Returns the system properties

cmsfn:systemProperty(java.lang.String)

Function class: info.magnolia.cms.taglibs.CmsFunctions

Function signature: java.lang.String systemProperty(java.lang.String)

Returns the value of a system property

CMS Tag Library - version 4.4

Core tag library for CMS

Namespace definition: xmlns:cms="cms-taglib"

Tags

  • adminOnly Everything between adminOnly tags will only be shown on an authoring instance, not on a public instance
  • attribute Adds an attribute to the request within an includeTemplate tag
  • button Adds a button to a parent bar
  • contentNodeIterator Iterate over contentNode collection
  • editBar Displays Magnolia editBar which allows you to edit a paragraph
  • editButton Displays an edit button
  • ifEmpty This is exactly the opposite of the ifNotEmpty tag
  • ifExisting This is exactly the opposite of the ifNotExisting Tag
  • ifFirstContentNode Checks if the current container is first in the collection
  • ifLastContentNode Checks if the current container is last in collection
  • ifNotEmpty Evaluates the body only if a container exitsts and / or the corresponding atom exists and is not empty
  • ifNotExisting Evaluates the body only if a container and / or the corresponding atom does not exist
  • includeTemplate Delegates to an appropriate ParagraphRenderer, or include a JSP
  • links Adds the needed css and js links for magnolia edit controls
  • loadPage Loads another page into actpage
  • loadPagePath Sub tag of loadPage, its body contains the path of the page to load
  • mainBar Displays the mainBar, i
  • newBar Displays a newBar that allows you to create new paragraphs
  • out Writes out the content of a nodeData or - for nodeData of type binary - information of the nodeData
  • pageIterator Iterates over a Content (page) collection
  • publicOnly Everything between publicOnly tags will only be shown on the public instance
  • query Executes a query on a Magnolia repository
  • set Set contentNode in resource
  • setNode Exposes a content node to the pagecontext as a Map of nodeData, in order to access the exposed object using JSTL
  • unloadPage The unloadPage tag will restore actpage to the currently displayed page
  • user Set the current user (info

Required attributes are marked with a*

<cms:adminOnly>

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

Example

<pre> &lt;cms:adminOnly&gt; &lt;cms:editBar/&gt; &lt;/cms:adminOnly&gt; </pre>

Attributes

NameDescriptionType
showInPreviewAlso show content in preview mode. Default is false.boolean

<cms:attribute>

Adds an attribute to the request within an includeTemplate tag.

Can contain:empty

Attributes

NameDescriptionType
name**String
value*String

<cms:button>

Adds a button to a parent bar. Must be nested into a mainBar or newBar to work.

Can contain:empty

Attributes

NameDescriptionType
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

<cms:contentNodeIterator>

Iterate over contentNode collection. 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.

Can contain:JSP

Example

<pre> &lt;cms:contentNodeIterator contentNodeCollectionName="mainColumnParagraphs"&gt; &lt;cms:adminOnly&gt; &lt;cms:editBar/&gt; &lt;/cms:adminOnly&gt; &lt;cms:includeTemplate/&gt; &lt;/cms:contentNodeIterator&gt; </pre>

Attributes

NameDescriptionType
beginZero-based index of first item to process, inclusive.int
contentNodeThe content object to use.String
contentNodeCollectionNameName of the collection holding the content node, e.g. "mainColumnParagraphs".String
contentNodeNameInside 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
endZero-based index of last item to process, inclusive.int
inheritInherit the value from parent pages, if not set in the current one.boolean
itemsif 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
nodeDataNamenodeDataName is not supported in this tag !String
pathThe absolute path to the content. You must define the repository attribute if the content is not stored in the website repository.String
repositoryUsed if the uuid or path attribute is set. Defaults to "website".String
stepProcess every stepth element (e.g 2 = every second element).int
uuidThe uuid to use for finding the content. You must define the repository attribute if the content is not stored in the website repository.String
varStatusName 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
actpageIf true we work on the current active page instead of any other node. @deprecatedboolean

<cms:editBar>

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

Attributes

NameDescriptionType
adminOnlyShow only in admin instance, default to true.boolean
contentNodeCollectionNameThe contentNode collection.String
contentNodeNameThe contentNode (i.e. paragraph) you wish to edit.String
deleteLabelThe text of the delete button, defaults to "Delete". Use "" to get no delete button.String
dialogName of the dialog to open. If specified, overrides the paragraph attribute, or the dialog name determined by the current paragraph if any.String
editLabelThe text of the edit button, defaults to "Edit".String
moveLabelThe text of the move button, defaults to "Move". Use "" to get no move button.String
paragraphName of paragraph (as defined in config). Does not have to be set inside "contentNodeIterator".String
showParagraphNameShow the paragraph name, default to false.boolean

<cms:editButton>

Displays an edit button.

Can contain:empty

Attributes

NameDescriptionType
adminOnlyShow only in admin instance, defaults to true.boolean
contentNodeCollectionName*String
contentNodeNameIf attribute is not used, a content node with the name of the page will be added. If contentNodeName attribute is set but with no value between the quotes, the properties are stored directly under the Web page. If a contentNodeName is set then a content node with the according name will be added.String
dialogThe dialog type.String
labelThe button's label. (defaults to "Edit")String
smallSets the size of the button, true for small button, false for a large one (defaults to true).boolean
templateSet display handler (JSP / Servlet), needs to know the relative path from WEB-INF. TODO: deprecate this ???String
editLabel@deprecated use the label attribute instead.String
paragraphThe paragraph type. @deprecated since 4.1, use the setDialog() instead.String

<cms:ifEmpty>

This is exactly the opposite of the ifNotEmpty tag.

Can contain:JSP

Attributes

NameDescriptionType
contentNodeThe content object to use.String
contentNodeCollectionNameName of the collection holding the content node, e.g. "mainColumnParagraphs".String
contentNodeNameInside 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
inheritInherit the value from parent pages, if not set in the current one.boolean
nodeDataName*String
pathThe absolute path to the content. You must define the repository attribute if the content is not stored in the website repository.String
repositoryUsed if the uuid or path attribute is set. Defaults to "website".String
uuidThe uuid to use for finding the content. You must define the repository attribute if the content is not stored in the website repository.String
actpageIf true we work on the current active page instead of any other node. @deprecatedboolean
atomName@deprecatedString
containerListName@deprecated use the contentNodeCollectionName attribute instead.String
containerName@deprecated use the contentNodeName attribute instead.String

<cms:ifExisting>

This is exactly the opposite of the ifNotExisting Tag.

Can contain:JSP

Attributes

NameDescriptionType
contentNodeThe content object to use.String
contentNodeCollectionNameName of the collection holding the content node, e.g. "mainColumnParagraphs".String
contentNodeNameInside 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
inheritInherit the value from parent pages, if not set in the current one.boolean
nodeDataName*String
pathThe absolute path to the content. You must define the repository attribute if the content is not stored in the website repository.String
repositoryUsed if the uuid or path attribute is set. Defaults to "website".String
uuidThe uuid to use for finding the content. You must define the repository attribute if the content is not stored in the website repository.String
actpageIf true we work on the current active page instead of any other node. @deprecatedboolean

<cms:ifFirstContentNode>

Checks if the current container is first in the collection.

Can contain:JSP

This tag has no attributes.

<cms:ifLastContentNode>

Checks if the current container is last in collection.

Can contain:JSP

This tag has no attributes.

<cms:ifNotEmpty>

Evaluates the body only if a container exitsts and / or the corresponding atom exists and is not empty.

Can contain:JSP

Attributes

NameDescriptionType
contentNodeThe content object to use.String
contentNodeCollectionNameName of the collection holding the content node, e.g. "mainColumnParagraphs".String
contentNodeNameInside 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
inheritInherit the value from parent pages, if not set in the current one.boolean
nodeDataName*String
pathThe absolute path to the content. You must define the repository attribute if the content is not stored in the website repository.String
repositoryUsed if the uuid or path attribute is set. Defaults to "website".String
uuidThe uuid to use for finding the content. You must define the repository attribute if the content is not stored in the website repository.String
actpageIf true we work on the current active page instead of any other node. @deprecatedboolean
atomName@deprecatedString
containerListName@deprecated use the contentNodeCollectionName attribute instead.String
containerName@deprecated use the contentNodeName attribute instead.String

<cms:ifNotExisting>

Evaluates the body only if a container and / or the corresponding atom does not exist.

Can contain:JSP

Attributes

NameDescriptionType
contentNodeThe content object to use.String
contentNodeCollectionNameName of the collection holding the content node, e.g. "mainColumnParagraphs".String
contentNodeNameInside 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
inheritInherit the value from parent pages, if not set in the current one.boolean
nodeDataName*String
pathThe absolute path to the content. You must define the repository attribute if the content is not stored in the website repository.String
repositoryUsed if the uuid or path attribute is set. Defaults to "website".String
uuidThe uuid to use for finding the content. You must define the repository attribute if the content is not stored in the website repository.String
actpageIf true we work on the current active page instead of any other node. @deprecatedboolean

<cms:includeTemplate>

Delegates to an appropriate ParagraphRenderer, or include a JSP. This is typically used to render a paragraph. Within contentNodeIterator, parameters are provided automatically by the loop.

Can contain:JSP

Attributes

NameDescriptionType
contentNode*info.magnolia.cms.core.Content
contentNodeNameThe name of the contentNode (i.e. paragraph) you wish to show.String
noEditBarsSet to true if the content should not be rendered in edit mode (edit bars, ...).boolean
container@deprecated use the contentNode attribute insteadinfo.magnolia.cms.core.Content
path@deprecated file to be included (e.g. "/templates/jsp/x.jsp"). Just use basic jsp tags (i.e. <jsp:include/>) if you need to include a jsp in your templates.String

<cms:links>

Adds the needed css and js links for magnolia edit controls. This tag should always bee added to html head.

Can contain:empty

Attributes

NameDescriptionType
adminOnlyShow links only in admin instance, defaults to true. You can set it to false if you want magnolia css and js files added also for a public instance.boolean

<cms:loadPage>

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

Attributes

NameDescriptionType
level*int
pathPath of the page to be loaded.String
templateName*String

<cms:loadPagePath>

Sub tag of loadPage, its body contains the path of the page to load.

Can contain:JSP

This tag has no attributes.

<cms:mainBar>

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

Attributes

NameDescriptionType
adminButtonVisibleSet this to false if you don't want to show the AdminCentral button.boolean
dialogName of the dialog for the page properties. (as defined in config)String
labelLabel for the page properties button.String
paragraph@deprecated use the dialog attribute insteadString

<cms:newBar>

Displays a newBar that allows you to create new paragraphs.

Can contain:JSP

Example

<pre> &lt;cms:newBar contentNodeCollectionName="mainColumnParagraphs" paragraph="samplesTextImage,samplesDownload,samplesLink"/&gt; </pre>

Attributes

NameDescriptionType
adminOnlyShow only in admin instance, default to true.boolean
contentNodeCollectionNameNew paragraphs will be stored under this node's name. You will need the name for later retrieval of contents.String
contentNodeNameA single new paragraph will be stored as a node with this name.String
newLabelText of the button, defaults to "New".String
paragraph*Comma separated list of allowed paragraph types.String

<cms:out>

Writes out the content of a nodeData or - for nodeData of type binary - information of the nodeData.

Can contain:empty

Example

<!-- 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>

Attributes

NameDescriptionType
contentNodeThe content object to use.String
contentNodeCollectionNameName of the collection holding the content node, e.g. "mainColumnParagraphs".String
contentNodeNameInside 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
dateLanguageSet which date format shall be delivered. Does only apply for nodeDatas of type=Date. Language according to <code>java.util.Locale</code>.String
datePatternSets the output date format, as per java.text.SimpleDateFormat. Default is "yyyy-MM-dd". Only applies for nodeDatas of type=Date. <ul> <li><b>G </b> Era designator Text AD <li><b>y </b> Year Year 1996; 96 <li><b>M </b> Month in year Month July; Jul; 07 <li><b>w </b> Week in year Number 27 <li><b>W </b> Week in month Number 2 <li><b>D </b> Day in year Number 189 <li><b>d </b> Day in month Number 10 <li><b>F </b> Day of week in month Number 2 <li><b>E </b> Day in week Text Tuesday; Tue <li><b>a </b> Am/pm marker Text PM <li><b>H </b> Hour in day (0-23) Number 0 <li><b>k </b> Hour in day (1-24) Number 24 <li><b>K </b> Hour in am/pm (0-11) Number 0 <li><b>h </b> Hour in am/pm (1-12) Number 12 <li><b>m </b> Minute in hour Number 30 <li><b>s </b> Second in minute Number 55 <li><b>S </b> Millisecond Number 978 <li><b>z </b> Time zone General time zone Pacific Standard Time; PST; GMT-08:00 <li><b>Z </b> Time zone RFC 822 time zone -0800 </ul>String
defaultValueDefault value used if the expresion evaluates to null or an empty string.String
escapeXmlDetermines whether output will be XML escaped.boolean
filePropertySets which information of a file to retrieve. Only applies for nodeDatas of type=Binary. Supported values (sample value): <ul> <li><b>path (default): </b> path inlcuding the filename (/dev/mainColumnParagraphs/0/image/Alien.png)</li> <li><b>name </b>: name and extension (Alien.png)</li> <li><b>extension: </b> extension as is (Png)</li> <li><b>extensionLowerCase: </b> extension lower case (png)</li> <li><b>extensionUpperCase: </b> extension upper case (PNG)</li> <li><b>nameWithoutExtension: </b> (Alien)</li> <li><b>handle: </b> /dev/mainColumnParagraphs/0/image</li> <li><b>icon: </b>the default icon for the type of document</li> <li><b>pathWithoutName: </b> (/dev/mainColumnParagraphs/0/image.png)</li> <li><b>size: </b> size in bytes (2827)</li> <li><b>sizeString: </b> size in bytes, KB or MB - max. 3 digits before comma - with unit (2.7 KB)</li> <li><b>contentType: </b> (image/png)</li> <li><b>width: </b>image width in pixels (images only)</li> <li><b>height: </b>image height in pixels (images only)</li> </ul>String
inheritInherit the value from parent pages, if not set in the current one.boolean
lineBreakDetermines how line breaks are converted. Defaults to "<br />". 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
pathThe absolute path to the content. You must define the repository attribute if the content is not stored in the website repository.String
repositoryUsed if the uuid or path attribute is set. Defaults to "website".String
scopeScope for the attribute named from the "var" parameter. Setting this attribute doesn't have any effect if "var" is not set.String
uuidThe uuid to use for finding the content. You must define the repository attribute if the content is not stored in the website repository.String
uuidToLinkTransform a uuid value to a link. The following values are supported: <ul> <li>none: no uuid to link resolving. (default value)</li> <li>absolute: Resolve to a absolute link using the repository to uri mapping feature.</li> <li>handle: resolve to a absolute link but do not use the repository to uri mapping.</li> <li>relative: resolve to relative path. Path is relative to current page.</li> </ul>String
uuidToLinkRepositoryUsed if the uuidToLink attribute is set. The content is found in this repository. Defaults to "website".String
varIf 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
actpageIf true we work on the current active page instead of any other node. @deprecatedboolean

<cms:pageIterator>

Iterates over a Content (page) collection.

Can contain:JSP

Attributes

NameDescriptionType
hiddenAttributeIf 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

<cms:publicOnly>

Everything between publicOnly tags will only be shown on the public instance.

Can contain:JSP

Example

<pre> &lt;cms:publicOnly&gt; Public now! &lt;/cms:publicOnly&gt; </pre>

Attributes

NameDescriptionType
showInPreviewAlso show content in preview mode. Default is false.boolean

<cms:query>

Executes a query on a Magnolia repository.

Can contain:empty

Attributes

NameDescriptionType
nodeTypeNodetype for nodes to return. Defaults to "mgnl:content".String
query*The query.String
repositoryThe repository to execute this query on. Defaults to "website".String
typeQuery 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

<cms:set>

Set contentNode in resource.

Can contain:empty

Attributes

NameDescriptionType
contentNodeThe content object to use.String
contentNodeCollectionNameName of the collection holding the content node, e.g. "mainColumnParagraphs".String
contentNodeNameInside 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
forBodyOnlyIf true the node is unset after the end tag. Default is false.String
inheritInherit the value from parent pages, if not set in the current one.boolean
nodeDataNamenodeDataName is not supported in this tag !String
pathThe absolute path to the content. You must define the repository attribute if the content is not stored in the website repository.String
repositoryUsed if the uuid or path attribute is set. Defaults to "website".String
scopeAttention this is not the jstl scope but the magnolia scope! Values are <ul> <li>local: same as paragraph</li> <li>paragraph: the current paragraph</li> <li>global: a globally use node (default value)</li> <li>page: same as page</li> <li>current: the current page</li> </ul>String
uuidThe uuid to use for finding the content. You must define the repository attribute if the content is not stored in the website repository.String
actpageIf true we work on the current active page instead of any other node. @deprecatedboolean
container@deprecated use the contentNode attributeinfo.magnolia.cms.core.Content
containerName@deprecated use the contentNodeName attributeString

<cms:setNode>

Exposes a content node to the pagecontext as a Map of nodeData, in order to access the exposed object using JSTL. Since JSTL doesn't allow calling a method like <code>Content.getNodeData(String)</code> the <code>Content</code> is wrapped into a <code>NodeMapWrapper</code> which exposes NodeData using a map interface. This tag can be useful in similar situations: (see @jsp.tag-example)

Can contain:empty

Example

<pre> &lt;cms:setNode var="currentNode"/&gt; &lt;c:if test="${!empty currentNode.title}"&gt; &lt;c:out value="${currentNode.title}"/&gt; &lt;/c:if&gt; </pre>

Attributes

NameDescriptionType
contentNodeThe content object to use.String
contentNodeCollectionNameName of the collection holding the content node, e.g. "mainColumnParagraphs".String
contentNodeNameInside 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
inheritInherit the value from parent pages, if not set in the current one.boolean
nodeDataNamenodeDataName is not supported in this tag !String
pathThe absolute path to the content. You must define the repository attribute if the content is not stored in the website repository.String
repositoryUsed if the uuid or path attribute is set. Defaults to "website".String
scopeScope for the declared variable. Can be "page" (default), "request", "session" or "application".String
uuidThe uuid to use for finding the content. You must define the repository attribute if the content is not stored in the website repository.String
var*The content node will be added to the pagecontext with this name.String
actpageIf true we work on the current active page instead of any other node. @deprecatedboolean
content@deprecated use the contentNode attributeString

<cms:unloadPage>

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.

<cms:user>

Set the current user (info.magnolia.cms.security.User) into a pageContext variable.

Can contain:empty

Attributes

NameDescriptionType
anonymousDisplay 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