Tag reference sheet

Tag library reference for the following tag libraries:

Magnolia Templating CMS Tag Support - version 2.1

Expose migrated custom tags.

Namespace definition: xmlns:cmsUtilTaglib="cmsUtilTaglib"

Tags

  • breadcrumb Outputs "breadcrumbs" with links to parents of the current page
  • newlines Converts text in the body of the tag adding tags at new lines or wrapping lines in paragraphs
  • poweredBy A simple tag which can display the version and edition of the running Magnolia instance
  • scaleImage Creates a scaled copy of an image
  • searchResultSnippet Output a set of snippets taken from any paragraph in the given page mathing any of the search term
  • simpleNavigation Draws a simple, css based, navigation menu
  • txt2img Tag that converts text into PNG images, and outputs a div element containing a set of img elements

Required attributes are marked with a*

<cmsUtilTaglib:breadcrumb>

Outputs "breadcrumbs" with links to parents of the current page.

Can contain:empty

This tag has no attributes.

<cmsUtilTaglib:newlines>

Converts text in the body of the tag adding <br /> tags at new lines or wrapping lines in paragraphs.

Can contain:JSP

This tag has no attributes.

<cmsUtilTaglib:poweredBy>

A simple tag which can display the version and edition of the running Magnolia instance.

Can contain:empty

This tag has no attributes.

<cmsUtilTaglib:scaleImage>

Creates a scaled copy of an image. The maximum width and height of the images can be specified via the attributes. <br /> <br /> If the scaled image with the specified name does not exist in the repository, then this tag will create it and save it. If the scaled image already exists, then it will not be recreated. <br /> <br /> The name of the node that contains the original image is set by the attribute 'parentContentNode', and the name of the nodeData for the image is set by the attribute 'parentNodeDataName'. If 'parentContentNode' is null, the local content node is used. <br /> <br /> The name of the content node that contains the new scaled image is set by the attribute 'imageContentNodeName'. This node is created under the original image node. This ensures that, if the original images is deleted, so are all the scaled versions. <br /> <br /> This tag writes out the handle of the content node that contains the image. <br /> <br />

Can contain:empty

This tag has no attributes.

<cmsUtilTaglib:searchResultSnippet>

Output a set of snippets taken from any paragraph in the given page mathing any of the search term.

Can contain:empty

This tag has no attributes.

<cmsUtilTaglib:simpleNavigation>

Draws a simple, css based, navigation menu. The menu layout can then be customized using css, and the default menu should be enough for most uses. Two following page properties will also be used in the menu: <ul> <li><code>navTitle</code>: a title to use for the navigation menu, if different from the real page title</li> <li><code>accessKey</code>: an optional access key which will be added to the link</li> <li><code>wrappingElement</code>: an optional html element (div, span, p, etc) to go within the &lt;a&gt; tag wrapping the anchor text</li> </ul>

Can contain:empty

This tag has no attributes.

<cmsUtilTaglib:txt2img>

Tag that converts text into PNG images, and outputs a div element containing a set of img elements. The font face, text color, text size and background color can be set via the tag attributes. <br /> <br /> The images are saved under the node specified by the attribute parentContentNodeName. Under this parent node, a new node is created, with the name specified by the attribute imageContentNodeName. Under this node, each image will have it own node. The names of the image node are based on the text that they contain. (Special characters such as &amp;, /, chinese characters, etc. are replaces by codes to ensure that these names are legal.) <br /> <br /> If the images for the specified text do not exist in the repository under the specified parent node, then the this tag will create the images and save them. If the images for the text already exist, then they will not be recreated. <br /> <br /> The text to be converted into images can be split in three ways. If the attribute textSplit is null or is set to TEXT_SPLIT_NONE, then a single image will be created of the text on one line. If textSplit is set to TEXT_SPLIT_WORDS, then the text is plit into words (i.e. wherever there is a space). Finally, if textSplit is set to TEXT_SPLIT_CHARACTERS, then a seperate image is created for each letter. <br /> <br /> The tag outputs a div that contains one or more img's. The CSS class applied to the div is specified by the divCSS attribute. The CSS applied to the images depends on how the text was split. For text that was not split, the CSS applied is set to CSS_TEXT_IMAGE, for words it is CSS_WORD_IMAGE, and for characters it is CSS_CHARACTER_IMAGE. Any spacing that is required between images will need to be set in your css stylesheet. <br /> <br /> The textFontFace attribute may either be a font name of a font installed on the server, or it may be a path to a TTF file. The class to generate PNG images from TrueType font strings is originally by Philip McCarthy - http://chimpen.com (http://chimpen.com/things/archives/001139.php). I have made a couple of small changes. <br /> <br />

Can contain:empty

This tag has no attributes.

Magnolia Templating Functions Tag Support - version 2.1

Templating functions (cmsfn) Tag Library exposes most of the utility methods defined in info.magnolia.templating.functions.TemplatingFunctions as JSP functions.

Namespace definition: xmlns:cmsfn="http://magnolia-cms.com/taglib/templating-components/cmsfn"

EL Functions

Required attributes are marked with a*

cmsfn:ancestors(info.magnolia.jcr.util.ContentMap, java.lang.String)

Function class: info.magnolia.templating.jsp.cmsfn.JspTemplatingFunction

Function signature: java.util.List ancestors(info.magnolia.jcr.util.ContentMap, java.lang.String)

* info.magnolia.jcr.util.ContentMap contentMap: null * java.lang.String nodeTypeName: null

cmsfn:asContentMap(javax.jcr.Node)

Function class: info.magnolia.templating.jsp.cmsfn.JspTemplatingFunction

Function signature: info.magnolia.jcr.util.ContentMap asContentMap(javax.jcr.Node)

* javax.jcr.Node content: null

cmsfn:asContentMapList(java.util.Collection)

Function class: info.magnolia.templating.jsp.cmsfn.JspTemplatingFunction

Function signature: java.util.List asContentMapList(java.util.Collection)

* java.util.Collection nodeList: null

cmsfn:asJCRNode(info.magnolia.jcr.util.ContentMap)

Function class: info.magnolia.templating.jsp.cmsfn.JspTemplatingFunction

Function signature: javax.jcr.Node asJCRNode(info.magnolia.jcr.util.ContentMap)

* info.magnolia.jcr.util.ContentMap contentMap: null

cmsfn:asNodeList(java.util.Collection)

Function class: info.magnolia.templating.jsp.cmsfn.JspTemplatingFunction

Function signature: java.util.List asNodeList(java.util.Collection)

* java.util.Collection contentMapList: null

cmsfn:children(info.magnolia.jcr.util.ContentMap, java.lang.String)

Function class: info.magnolia.templating.jsp.cmsfn.JspTemplatingFunction

Function signature: java.util.List children(info.magnolia.jcr.util.ContentMap, java.lang.String)

* info.magnolia.jcr.util.ContentMap content: null * java.lang.String nodeTypeName: null

cmsfn:content(java.lang.String, java.lang.String)

Function class: info.magnolia.templating.jsp.cmsfn.JspTemplatingFunction

Function signature: javax.jcr.Node content(java.lang.String, java.lang.String)

Return the Node for the Given Path from the given repository. If the repository is empty, take the default (website). * java.lang.String path: null * java.lang.String repository: null

cmsfn:contentByIdentifier(java.lang.String, java.lang.String)

Function class: info.magnolia.templating.jsp.cmsfn.JspTemplatingFunction

Function signature: javax.jcr.Node contentByIdentifier(java.lang.String, java.lang.String)

Return the Node for the given identifier from the given repository. If the repository is empty, take the default (website). * java.lang.String id: null * java.lang.String repository: null

cmsfn:createHtmlAttribute(java.lang.String, java.lang.String)

Function class: info.magnolia.templating.jsp.cmsfn.JspTemplatingFunction

Function signature: java.lang.String createHtmlAttribute(java.lang.String, java.lang.String)

Util method to create html attributes <code>name="value"</code>. If the value is empty an empty string will be returned. This is mainly helpful to avoid empty attributes. * java.lang.String name: null * java.lang.String value: null

cmsfn:decode(info.magnolia.jcr.util.ContentMap)

Function class: info.magnolia.templating.jsp.cmsfn.JspTemplatingFunction

Function signature: info.magnolia.jcr.util.ContentMap decode(info.magnolia.jcr.util.ContentMap)

Removes escaping of HTML on properties. * info.magnolia.jcr.util.ContentMap content: null

cmsfn:externalLink(info.magnolia.jcr.util.ContentMap, java.lang.String)

Function class: info.magnolia.templating.jsp.cmsfn.JspTemplatingFunction

Function signature: java.lang.String externalLink(info.magnolia.jcr.util.ContentMap, java.lang.String)

Returns an external link prepended with <code>http://</code> in case the protocol is missing or an empty String if the link does not exist. * info.magnolia.jcr.util.ContentMap content: The node's map representation where the link property is stored on. * java.lang.String linkPropertyName: The property where the link value is stored in. Return: The link prepended with <code>http://</code>

cmsfn:externalLinkTitle(info.magnolia.jcr.util.ContentMap, java.lang.String, java.lang.String)

Function class: info.magnolia.templating.jsp.cmsfn.JspTemplatingFunction

Function signature: java.lang.String externalLinkTitle(info.magnolia.jcr.util.ContentMap, java.lang.String, java.lang.String)

Return a link title based on the @param linkTitlePropertyName. When property @param linkTitlePropertyName is empty or null, the link itself is provided as the linkTitle (prepended with <code>http://</code>). * info.magnolia.jcr.util.ContentMap content: The node where the link property is stored on. * java.lang.String linkPropertyName: The property where the link value is stored in. * java.lang.String linkTitlePropertyName: The property where the link title value is stored Return: the resolved link title value

cmsfn:inherit(info.magnolia.jcr.util.ContentMap, java.lang.String)

Function class: info.magnolia.templating.jsp.cmsfn.JspTemplatingFunction

Function signature: info.magnolia.jcr.util.ContentMap inherit(info.magnolia.jcr.util.ContentMap, java.lang.String)

* info.magnolia.jcr.util.ContentMap content: null * java.lang.String relPath: null

cmsfn:inheritList(info.magnolia.jcr.util.ContentMap, java.lang.String)

Function class: info.magnolia.templating.jsp.cmsfn.JspTemplatingFunction

Function signature: java.util.List inheritList(info.magnolia.jcr.util.ContentMap, java.lang.String)

* info.magnolia.jcr.util.ContentMap content: null * java.lang.String relPath: null

cmsfn:inheritProperty(info.magnolia.jcr.util.ContentMap, java.lang.String)

Function class: info.magnolia.templating.jsp.cmsfn.JspTemplatingFunction

Function signature: javax.jcr.Property inheritProperty(info.magnolia.jcr.util.ContentMap, java.lang.String)

* info.magnolia.jcr.util.ContentMap content: null * java.lang.String relPath: null

cmsfn:isAuthorInstance()

Function class: info.magnolia.templating.jsp.cmsfn.JspTemplatingFunction

Function signature: boolean isAuthorInstance()

cmsfn:isEditMode()

Function class: info.magnolia.templating.jsp.cmsfn.JspTemplatingFunction

Function signature: boolean isEditMode()

cmsfn:isFromCurrentPage(info.magnolia.jcr.util.ContentMap)

Function class: info.magnolia.templating.jsp.cmsfn.JspTemplatingFunction

Function signature: boolean isFromCurrentPage(info.magnolia.jcr.util.ContentMap)

* info.magnolia.jcr.util.ContentMap content: null

cmsfn:isInherited(info.magnolia.jcr.util.ContentMap)

Function class: info.magnolia.templating.jsp.cmsfn.JspTemplatingFunction

Function signature: boolean isInherited(info.magnolia.jcr.util.ContentMap)

* info.magnolia.jcr.util.ContentMap content: null

cmsfn:isPreviewMode()

Function class: info.magnolia.templating.jsp.cmsfn.JspTemplatingFunction

Function signature: boolean isPreviewMode()

cmsfn:isPublicInstance()

Function class: info.magnolia.templating.jsp.cmsfn.JspTemplatingFunction

Function signature: boolean isPublicInstance()

cmsfn:language()

Function class: info.magnolia.templating.jsp.cmsfn.JspTemplatingFunction

Function signature: java.lang.String language()

Get the language used currently. Return: The language as a String.

cmsfn:link(info.magnolia.jcr.util.ContentMap)

Function class: info.magnolia.templating.jsp.cmsfn.JspTemplatingFunction

Function signature: java.lang.String link(info.magnolia.jcr.util.ContentMap)

* info.magnolia.jcr.util.ContentMap contentMap: null

cmsfn:linkForProperty(javax.jcr.Property)

Function class: info.magnolia.templating.jsp.cmsfn.JspTemplatingFunction

Function signature: java.lang.String linkForProperty(javax.jcr.Property)

FIXME Add a LinkUtil.createLink(Property property).... Dirty Hack. FIXME: Should be changed when a decision is made on SCRUM-525. * javax.jcr.Property property: null

cmsfn:linkForWorkspace(java.lang.String, java.lang.String)

Function class: info.magnolia.templating.jsp.cmsfn.JspTemplatingFunction

Function signature: java.lang.String linkForWorkspace(java.lang.String, java.lang.String)

Create link for the Node identified by nodeIdentifier in the specified workspace. * java.lang.String workspace: null * java.lang.String nodeIdentifier: null

cmsfn:metaData(info.magnolia.jcr.util.ContentMap, java.lang.String)

Function class: info.magnolia.templating.jsp.cmsfn.JspTemplatingFunction

Function signature: java.lang.String metaData(info.magnolia.jcr.util.ContentMap, java.lang.String)

Returns the string representation of a property from the metaData of the node or <code>null</code> if the node has no Magnolia metaData or if no matching property is found. * info.magnolia.jcr.util.ContentMap content: null * java.lang.String property: null

cmsfn:page(info.magnolia.jcr.util.ContentMap)

Function class: info.magnolia.templating.jsp.cmsfn.JspTemplatingFunction

Function signature: info.magnolia.jcr.util.ContentMap page(info.magnolia.jcr.util.ContentMap)

Returns the page's {@link ContentMap} of the passed {@link ContentMap}. If the passed {@link ContentMap} represents a page, the passed {@link ContentMap} will be returned. If the passed {@link ContentMap} has no parent page at all, null is returned. * info.magnolia.jcr.util.ContentMap content: the {@link ContentMap} to get the page's {@link ContentMap} from. Return: returns the page {@link ContentMap} of the passed content {@link ContentMap}.

cmsfn:parent(info.magnolia.jcr.util.ContentMap, java.lang.String)

Function class: info.magnolia.templating.jsp.cmsfn.JspTemplatingFunction

Function signature: info.magnolia.jcr.util.ContentMap parent(info.magnolia.jcr.util.ContentMap, java.lang.String)

* info.magnolia.jcr.util.ContentMap contentMap: null * java.lang.String nodeTypeName: null

cmsfn:root(info.magnolia.jcr.util.ContentMap, java.lang.String)

Function class: info.magnolia.templating.jsp.cmsfn.JspTemplatingFunction

Function signature: info.magnolia.jcr.util.ContentMap root(info.magnolia.jcr.util.ContentMap, java.lang.String)

* info.magnolia.jcr.util.ContentMap contentMap: null * java.lang.String nodeTypeName: null

cmsfn:search(java.lang.String, java.lang.String, java.lang.String, java.lang.String)

Function class: info.magnolia.templating.jsp.cmsfn.JspTemplatingFunction

Function signature: java.util.Collection search(java.lang.String, java.lang.String, java.lang.String, java.lang.String)

* java.lang.String workspace: null * java.lang.String statement: null * java.lang.String language: null * java.lang.String returnItemType: null

cmsfn:siblings(info.magnolia.jcr.util.ContentMap)

Function class: info.magnolia.templating.jsp.cmsfn.JspTemplatingFunction

Function signature: info.magnolia.cms.util.SiblingsHelper siblings(info.magnolia.jcr.util.ContentMap)

Returns an instance of SiblingsHelper for the given contentMap. * info.magnolia.jcr.util.ContentMap node: null

cmsfn:simpleSearch(java.lang.String, java.lang.String, java.lang.String, java.lang.String)

Function class: info.magnolia.templating.jsp.cmsfn.JspTemplatingFunction

Function signature: java.util.Collection simpleSearch(java.lang.String, java.lang.String, java.lang.String, java.lang.String)

* java.lang.String workspace: null * java.lang.String statement: null * java.lang.String returnItemType: null * java.lang.String startPath: null

Magnolia Templating CMS Tag Support - version 2.1

Expose templating functions (area, component, init) as JSP custom tags.

Namespace definition: xmlns:cms="http://magnolia-cms.com/taglib/templating-components/cms"

Tags

  • area A jsp tag for rendering an arbitrary piece of content
  • component A jsp tag for rendering an arbitrary piece of content
  • init A jsp tag for making page editor aware of current page and related dialog
  • page A jsp tag for making page editor aware of current page and related dialog

Required attributes are marked with a*

<cms:area>

A jsp tag for rendering an arbitrary piece of content.

Can contain:empty

Attributes

Name Description Type
area * String
components * String
content * String
contextAttributes * String
createAreaNode * String
dialog * String
editable * String
name* * String
path * String
type * String
uuid * String
workspace * String

<cms:component>

A jsp tag for rendering an arbitrary piece of content.

Can contain:empty

Attributes

Name Description Type
content * String
contextAttributes * String
dialog * String
editable * String
path * String
uuid * String
workspace * String

<cms:init>

A jsp tag for making page editor aware of current page and related dialog.

Can contain:empty

Attributes

Name Description Type
content * String
dialog * String
path * String
uuid * String
workspace * String

<cms:page>

A jsp tag for making page editor aware of current page and related dialog.

Can contain:empty

Attributes

Name Description Type
content * String
dialog * String
path * String
uuid * String
workspace * String