magnolia-templating-jsp Version: 4.5-RC1 Last Published: Feb 27, 2012

Tag reference sheet

Tag library reference for the following tag libraries:

Magnolia Templating CMS Tag Support - version 2.1

Magnolia is an open-source enterprise class Content Management System developed by Magnolia International Ltd., based on the standard API for Java Content Repositories (JCR).

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 adding Magnolia specific javascripts and css

Required attributes are marked with a*

<cms:area>

A jsp tag for rendering an arbitrary piece of content.

Can contain:empty

Attributes

NameDescriptionType
area*String
components*String
content*String
contextAttributes*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

NameDescriptionType
content*String
contextAttributes*String
dialog*String
editable*String
path*String
uuid*String
workspace*String

<cms:init>

A jsp tag for adding Magnolia specific javascripts and css.

Can contain:empty

Attributes

NameDescriptionType
content*String
dialog*String
path*String
uuid*String
workspace*String

Magnolia Templating Functions Tag Support - version 2.1

Magnolia is an open-source enterprise class Content Management System developed by Magnolia International Ltd., based on the standard API for Java Content Repositories (JCR).

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