Tag reference sheet

Tag library reference for the following tag libraries:

cmsu

CMS Utility Tag Library

This is version 2.1.

  • aAttribute adds an attribute to the aHref tag (child as aHref)
  • aHref checks if the atom contains a non-empty String value and builds a link if true or tries to find the first page with a specific template Name, starting from a specific page
  • breadcrumb displays a breadcrumb
  • img Writes an html img tag for the image at "nodeDataName"
  • newlines
  • redirect Redirects to the first child page
  • 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
  • simpleMail Sends a simple mail generated with all the fields found in nodeCollectionName
  • simpleNavigation Draws a simple, css based, navigation menu
  • simpleSearch A simple tag which allows searching in all the site content with a "natural language" query
  • strToObj converts a string to an object using split
  • table Table
  • txt2img Convert the text to images
  • xmp Simulates the xmp tag, escaping content
  • date @deprecated see cms-taglib:out
  • fileSrc @deprecated see cms:out
Required attributes are marked with a *

<cmsu:aAttribute>

adds an attribute to the aHref tag (child as aHref)Can contain: EMPTY

Attributes

NameDescriptionType
name*the name of the attributeString
valuethe value of the attributeString

<cmsu:aHref>

checks if the atom contains a non-empty String value and builds a link if true or tries to find the first page with a specific template Name, starting from a specific page. Can contain: JSP

Example

      
<cmsu:aHref ... />

    

Attributes

NameDescriptionType
levellevel from where to start the template searchint
nodeDataNameString
postHrefhref part that is added after the nodeData contentString
preHrefhref part that is added before the nodeData contentString
templateNametemplate name to search forString
atomName@deprecated use nodeDataNameString

<cmsu:breadcrumb>

displays a breadcrumbCan contain: EMPTY

Attributes

NameDescriptionType
delimiterdisplayed between the page names, e.g. ">"String
excludeCurrentexclude the current (active) page from the breadcrumb. Defaults to falseboolean
hidePropertyName for a page property which, if set, will make the page hidden in the breadcrumb.String
linkCreate links to pages. Defaults to trueboolean
startLevel at which level to start. Often you will want to omit top levels, e.g. if you split your site into multiple languages String

<cmsu:img>

Writes an html img tag for the image at "nodeDataName". Also supports writing object tags for flash movies (detected by the "swf" extension. Can contain: EMPTY

Attributes

NameDescriptionType
altNodeDataName Name of the node data holding the alt text for the image. If not set the default is nodeDataName + "Alt". The same value is added to the "title" attribute, if not null. String
classhtml pass through attributeString
contentNodeCollectionNameSee cms:outString
contentNodeNameSee cms:outString
heighthtml pass through attributeString
idhtml pass through attributeString
inheritInherit the value from parent pages, if not set in the current one.boolean
nodeDataName*the name of the nodeData containing the image pathString
stylehtml pass through attributeString
widthhtml pass through attributeString

<cmsu:newlines>

Can contain: JSP

Attributes

NameDescriptionType
para boolean

<cmsu:redirect>

Redirects to the first child page. If the server is an authoring instance or magnolia and the preview mode is not active the tag will simply add to the pagecontext a variable named from the var attribute containing the path of the child page. Can contain: empty

Example

      
<cmsu:redirect var="destpage" />

This page has no content and it will redirect to
<a href="${pageContext.request.contextPath}${destpage}">${destpage}</a> in a public instance.

    

Attributes

NameDescriptionType
varname for the variable which will contain the URL of the page this tag will redirect toString

<cmsu:scaleImage>

Creates a scaled copy of an image.Can contain: EMPTY

Attributes

NameDescriptionType
imageContentNodeName*The name of the new contentNode that will contain the scaled version of the image.String
maxHeightThe maximum height of the image in pixels.int
maxWidthThe maximum width of the image in pixels.int
parentContentNodeNameThe name of the content node that contains the image to be copied and scaled.String
parentNodeDataName*The name of the data node that cotains the image data to be copied and scaled.String

<cmsu:searchResultSnippet>

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

Example

      
<cmsu:simplesearch query="${param.search}" var="results" />
<c:forEach items="${results}" var="page">
    <cmsu:searchResultSnippet query="${param.search}" page="${page}" />
</c:forEach>

    

Attributes

NameDescriptionType
charsNumber of characters to include in search snippets. Default is 100.int
maxSnippetsMaximum number of snippets to print out.int
page* A Content node of type mgnl:content (a magnolia page), typically returned by the simpleSearch Tag info.magnolia.cms.core.Content
query*Search queryString

<cmsu:simpleMail>

Sends a simple mail generated with all the fields found in nodeCollectionName.

Can contain: empty

Attributes

NameDescriptionType
bccMail "bcc" fieldString
ccMail "cc" fieldString
from*Mail "from" fieldString
loggingLog all the information sent by the mail.String
loggingDirectoryWhere to log to. For each page the log is created separately on a weekly baseString
loggingEncodingEncoding of the log file. Default is UTF8. For windows excel use ISO-8859-1String
loggingExtension The file extension to use for new files. Default is log. Use csv for easy opening with Excel String
loggingFilename Name for the file (without extension). If not set, the pages path is used to create a file String
nodeCollectionName Collection (paragraphs) that holds the configured form fields. If not set the current collection is used. String
redirectPage to redirect to after a successfull submissionString
replyToMail "replyTo" fieldString
subject*Mail "subject" fieldString
template Instead of the mail type you can define a template to use. This template must be registered in the mail module String
to*Mail "to" fieldString
typeMail type. used to get the mail from the factoryString

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

Can contain: EMPTY

Example

      
            <cmsu:simpleNavigation startLevel="3" style="mystyle"/>
            Will output the following:
            <ul class="level3 mystyle">
                <li><a href="...">page 1 name </a></li>
                <li><a href="...">page 2 name </a></li>
                <li class="trail"><a href="...">page 3 name </a>
                    <ul class="level3">
                        <li><a href="...">subpage 1 name </a></li>
                        <li><a href="...">subpage 2 name </a></li>
                        <li><strong><a href="...">selected page name </a></strong></li>
                    </ul>
                </li>
                <li><a href="...">page 4 name </a></li>
            </ul>
            
    

Attributes

NameDescriptionType
classProperty Name for a page property that will hold a css class name which will be added to the html class attribute. String
endLevelThe end level for navigation, defaults to 0.int
expandAll Sitemap mode. Can be assigned the "show" value. Only showable pages will be displayed. Any other value will result in displaying all pages String
hideInNav Name for the "hide in nav" nodeData. If a page contains a boolean property with this name and it is set to true, the page is not shown in navigation. Defaults to "hideInNav" String
openMenu Name for the "open menu" nodeData. If a page contains a boolean property with this name and it is set to true, subpages are always shown also if the page is not selected. Defaults to "openMenu" String
startLevelThe start level for navigation, defaults to 0.int
styleThe css class to be applied to the first ul.String

<cmsu:simpleSearch>

A simple tag which allows searching in all the site content with a "natural language" query. It simply strips all the reserved chars from input string, build an xpath query and feed Magnolia QueryManager. By defaults search terms are ANDed, but it also supports using the AND or OR keywords in the query string. Search is not case sensitive and it's performed on any non-binary property.

Can contain: EMPTY

Example

      
<cmsu:simplesearch query="${param.search}" var="results" />
<c:forEach items="${results}" var="page">
    <a href="${pageContext.request.contextPath}${page.handle}.html">${page.title}</a>
</c:forEach>

    

Attributes

NameDescriptionType
query*Query to execute (e.g. "magnolia AND cms OR info")String
scopeScope for the variable. Can be "page" (default), "request", "session", "application"String
startLevel The start level for search, defaults to 0. Can be used to limitthe search only to the current website tree int
var*A collection of Content nodes (pages) will be added to the pagecontext with this name.String

<cmsu:strToObj>

converts a string to an object using split.

Can contain: JSP

Attributes

NameDescriptionType
delimsdelimiters characters; default: /nString
var*name of the pageContext variable where the obj is put toString

<cmsu:table>

Table

Can contain: JSP

Attributes

NameDescriptionType
cellpaddingStandard html attributeString
cellspacingStandard html attributeString
classStandard html attributeString
headerUse first row as column headersboolean
idStandard html attributeString
styleStandard html attributeString

<cmsu:txt2img>

Convert the text to images.

Can contain: EMPTY

Attributes

NameDescriptionType
divCSS The CSS class that will be applied to the div that contains these text images. If the attribute is not set (default) no div will be written. String
imageContentNodeName*The name of the new contentNode to create, under which all image nodes will be saved.String
parentContentNodeNameThe name of the parent of the new contentNode.String
text*The text to be converted.String
textBackColor The color of the background in hexadecimal format, e.g. 'ff0044'. Default is 'ffffff' (white) String
textFontColorThe color of the text in hexadecimal format, e.g. 'ff0044'. Default is '000000' (black)String
textFontFaceThe font face of the text, e.g. 'Helvetica'. Default is 'Helvetica'String
textFontSizeThe size of the text, in points, e.g. 12. Default is '12'int
textSplit The method used to split the text into sub-strings: 'none', 'words', or 'characters'. Default is 'none' String

<cmsu:xmp>

Simulates the xmp tag, escaping content. This is useful for displaying code examples.

Can contain: JSP

This tag has no attributes.

<cmsu:date>

@deprecated see cms-taglib:out.

Can contain: EMPTY

Attributes

NameDescriptionType
actpage@deprecated if "true" atom is taken from the currently active pageboolean
atomName@deprecatedString
language@deprecated Locale string (see java.util.Locale)String
nodeDataName@deprecated where the date comes fromString
pattern@deprecated (see java.text.SimpleDateFormat) - defaults "yyyy.MM.dd - HH:mm:ss"String

<cmsu:fileSrc>

@deprecated see cms:out. Returns informations as path, name or size of a file

Can contain: EMPTY

Attributes

NameDescriptionType
contentNodeName @deprecated if left empty, local contentNode is used as set by contentNodeIterator, otherwise the global contentNode is used String
fileNameOnly@deprecated if "true", the file name without the path will be generatedString
nodeDataName*@deprecatedString