Taglib Reference
In This Section
- 1 The CMS Library
- 1.1 documentLink
- 1.2 editable
- 1.3 form
- 1.4 filterHTMLBasic
- 1.5 filterHTMLRelaxed
- 1.6 filterHTMLTags
- 1.7 filterHTMLTagsAndAttributes
- 1.8 formPart
- 1.9 getMediaItems
- 1.10 getMediaItemVersions
- 1.11 image
- 1.12 includeUrl
- 1.13 isActive
- 1.14 link
- 1.15 object
- 1.16 pagePart
- 1.17 pageMetaData
- 1.18 presentationProperty
- 1.19 render
- 1.20 sizedImage
- 1.21 specialPages
- 1.22 text
- 2 The Functions Library
- 2.1 function
In addition to the information in this topic, see also the description of the class nl.gx.webmanager.taglib of the XperienCentral Javadoc.
The CMS Library
The CMS library is used for retrieving information from the XperienCentral content management system.
<%@taglib uri="http://www.gx.nl/taglib/wm" prefix="wm" %>documentLink
<wm:documentLink> - Returns an HTML link to a document and checks for web user authorization. Example usage:
<wm:documentLink var="docLink" contentId="${productInfo.document}" dataSource="jdbc/internaldb" />
${docLink}Attribute | Description | Required | Expression* |
|---|---|---|---|
| Sets the content ID of the document to which a link should be returned. | Yes | Yes |
| Sets the data source name which can be queried to retrieve more information about the document. | Yes | Yes |
| Specifies the class name to be used in the | No | Yes |
| The text to be used in building the link. The default value is the title of the document that is referred to. | No | Yes |
| Specifies whether the MIME type of the document should be returned (set to | No | No |
| Specifies the text to be used in the | No | Yes |
| Specifies whether the | No | No |
| Specifies whether the | No | No |
| Specifies the name of the HTML frame to be used in the | No | Yes |
| Specifies the JSP variable to store the result in. | No | No |
| Sets the web user groups who are granted access to the document. | No | Yes |
*The attribute supports EL (Expression Language) values.
editable
<wm:editable> - Marks editable content areas on the page inside the editor. The inline edit mode in XperienCentral needs to know where editable content exists on the page. This is accomplished by wrapping the editable areas using the <wm:editable> tag, thereby indicating where the editable content is located. Example usage:
<wm:editable contentHolder="${contentholder}" class="maincontentarea" area="0" tag="div"></wm:editable>This is the most basic and common usage. The class attribute is passed through to the outputted HTML. The following example shows how to wrap the title of a page version:
<wm:editable tag="div" contentHolder="${pageVersion}" area="title" class="main_title">
${pageVersion.title}
</wm:editable>When wrapping content like a page title, no extra static HTML should appear inside the <wm:editable> tag except the page title itself. Any static HTML could be appended to the field being wrapped. Do not use your own element render loop to output the elements content in the tag itself or with a wm:pagepart tag.
The following are examples of incorrect usage of the <wm:editable> tag:
Incorrect usage of the <wm:editable> tag
<wm:editable contentHolder="${contentholder}" class="maincontentarea" area="0" tag="div">
<wm:render presentationName="freestylepresentation content" object="${contentholder}" startSeparator="0" endSeparator="1"/>
</wm:editable>Incorrect usage of the <wm:editable> tag
<wm:editable contentHolder="${contentholder}" class="maincontentarea" area="0" tag="div"><wm:render bject="${contentholder}"/></wm:editable>Naming Convention Best Practice
It is best to give areas a meaningful name instead of assigning them a number. Doing so gives you the flexibility to change the order of areas at a later time if you decide to. For example:
<wm:editable contentHolder="${contentholder}" class="maincontentarea" area="maincontent" tag="div"></wm:editable>form
<wm:form> - Returns an HTML form tag and a (number of) hidden input tags enclosed in it. Additional inputs can be defined in the body of the <wm:form> tag.
The <wm:form> tag is mostly used to render various types of forms. All these forms are processed by the FormHandler which runs on the frontend and processes forms submitted by users. This FormHandler expects several inputs in the form. The <wm:form> tag automatically generates these. What exactly is generated, depends on the handle. Currently the following builtin handles are supported in the <wm:form> tag:
form- Indicates that the form should be processed using theFormHandler.formback- Navigates back one page in the form flow.search- Generates a search form.poll- Generates a form for the poll functionality.forum- Generates a form for the forum functionality.verseonstatus- Generates a form to get to call theVerseonFormStatusHandler.locationservicemappoint- Used by the Location services functionality in XperienCentral.
Except for the form handle, these are all related to specific XperienCentral features.
Example usage (1):
<wm:form handle="search" onSubmit="doSearch();">
<input type="text" name="keyword" />
</wm:form>The example above displays a search form (handle="search"). A search form should specify a keyword, therefore an input is included to set the keyword (using the HTML input tag). Also, some JavaScript should be executed if the form is to be submitted. The onSubmit parameter takes care of that. The rendering of the form parts is delegated using the <wm:render> tag ***. This tag renders the form object of the form element.
Example usage (2):
<wm:form handle="form" onSubmit="return checkForm${formElementId}();">
<input name="dummybutton" type="image" value="" alt="" src="${presentationcontext.website.emptyImage}" style="position: absolute; border-style: none; padding: 0; spacing: 0; text-indent: 0;" height="0" width="0"/>
<wm:render object="${formElement.form}" />
</wm:form>Example usage (3):
<wm:form handle="formback" />This displays the back button in a form.
Attribute | Description | Required | Expression* |
|---|---|---|---|
| Sets the name of the handle that should be used. Valid values: see the description of the available handles above. | Yes | Yes |
| Specifies a comma-separated list of extra parameters to be used in generating the URL in the form. This is the URL of the page to display when an action is performed in the form. By default the following values are already passed on: | No | Yes |
| Specifies the name of the HTML frame to be used in the | No | Yes |
| If a value (OUTP) for this attribute is specified, an HTML input tag is created as follows in the body of the form tag: | No | Yes |
| Specifies the name of the JavaScript function to be used in the | No | Yes |
*The attribute supports EL (Expression Language) values.
The following filterHTML tags were introduced in XperienCentral version 10.19.1. These methods rely on the JSoup clean method.
filterHTMLBasic
<wmfn:filterHTMLBasic> - Filters the HTML using a basic filtering configuration. It allows the following range of text nodes: <a>,
<b>, <blockquote>, <br>, <cite>,
<code>, <dd>, <dl>, <dt>, <em>,
<i>, <li>, <ol>, <p>, <pre>, <q>,
<small>, <span>, <strike>, <strong>,
<sub>,
<sup>, <u>, <ul> and <l>.
${wmfn:filterHTMLBasic(myHtmlToFilter)}filterHTMLRelaxed
<wmfn:filterHTMLRelaxed> - Filters the HTML using a relaxed filtering configuration. It allows the following range of text and structural body HTML: <a>,
<b>, <blockquote>, <br>, <caption>,
<cite>,
<code>, <col>, <colgroup>, <dd>,
<div>, <dl>, <dt>, <em>, <h1>, <h2>,
<h3>, <h4>, <h5>, <h6>,
<i>, <img>, <li>, <ol>, <p>, <pre>,
<q>, <small>, <span>, <strike>, <strong>,
<sub>,
<sup>, <table>, <tbody>, <td>,
<tfoot>, <th>, <thead>, <tr>, <u>,
<ul> and <l>. Example usage:
${wmfn:filterHTMLRelaxed(myHtmlToFilter)}filterHTMLTags
<wmfn:filterHTMLTags> - Filters the HTML. Passed tags are allowed — other tags are removed from the HTML. Example usage:
<c:set var="imagesFilter" value="figure,img,figcaption" />
<c:set var="allImages" value="${wmfn:filterHTMLTags(myContent, imagesFilter)}" />filterHTMLTagsAndAttributes
<wmfn:filterHTMLTagsAndAttributes> - Filters the HTML. Passed tags and attributes are allowed — other tags and attributes are removed from the HTML. Example usage:
Create an overview of only the a links on an html page:
${wmfn:filterHTMLTagsAndAttributes(myHtmlToFilter, 'a', 'href')}
Extract all images from an html page:
${wmfn:filterHTMLTagsAndAttributes(myHtmlWithImages, 'figure,img,figcaption,a', 'src,width,height,href')}
Remove any styling from the forms in content:
${wmfn:filterHTMLTagsAndAttributes(myStyledForms, 'form,input,fieldset,textarea,label,select,option', 'action,method,type,value,name,for')}
formPart
<wm:formPart> - This tag retrieves a form part using its alias as the search criteria. Example usage:
<wm:formPart
var="userNameFormPart" alias="username" />
${userNameFormPart}The fragment above will look up the form part with the alias "username".
Attribute | Description | Required | Expression* |
|---|---|---|---|
| Specifies the alias of the form part to search for. This is the alias that is used in the XSL of the form handlers to identify the form part. | Yes | Yes |
| Specifies the JSP variable in which to store the result. | Yes | No |
*The attribute supports EL (Expression Language) values.
getMediaItems
The getMediaItems tag was deprecated in XperienCentral version R31. Use getMediaItemVersions instead. See below.
<wm:getMediaItems> - This tag retrieves media items from the Content Repository and sorts the results. Example usage:
<wm:getmediaitems var="mediaItems"/>The example above retrieves all media items that match a specified term.
Attribute | Description | Required | Expression* |
|---|---|---|---|
| Specifies a comma separated list of terms the returned media item doesn't have. This includes terms present in other channels (XperienCentral R25 and higher). | No | Yes |
| Specifies a comma separated list of terms the returned media item must have. This includes terms present in other channels (XperienCentral R25 and higher). | No | Yes |
| Specifies the content type of the media item (article, image, etc.). | No | Yes |
| Specifies the date after which the returned media items must have been created. | No | Yes |
| Specifies the returned media item IDs that need to be excluded. | No | Yes |
| Specifies the term(s) that the returned media items must have at least one of. This includes terms present in other channels (XperienCentral R25 and higher). | No | Yes |
| Specifies the beginning of the date range in which the returned media item was published. | No | Yes |
| Specifies the end of the date range in which the returned media item was published. | No | Yes |
| Specifies the database entity the returned media item is linked to. | No | Yes |
| Specifies the resource instance the returned media item is linked to. | No | Yes |
| Specifies the number of returned media items to display. | No | Yes |
| Specifies whether to sort the returned media items in ascending order. | No | Yes |
| Specifies how to sort the returned media items. The options are:
| No | Yes |
| Specifies the media item’s workflow state. | No | Yes |
| Specifies the ID of the website from which the media items are retrieved. | No | Yes |
*The attribute supports EL (Expression Language) values.
getMediaItemVersions
The getMediaItemVersions tag was introduced in XperienCentral version R31.
<wm:getMediaItemVersions> - This tag retrieves media items from the Content Repository and sorts the results. Example usage:
<wm:getmediaitemversions var="mediaItemVersions"/>The example above retrieves all media items that match a specified term.
Attribute | Description | Required | Expression* |
|---|---|---|---|
| Specifies a comma separated list of terms the returned media item doesn't have. This includes terms present in other channels (XperienCentral R25 and higher). | No | Yes |
| Specifies a comma separated list of terms the returned media item must have. This includes terms present in other channels (XperienCentral R25 and higher). | No | Yes |
| Specifies the content type of the media item (article, image, etc.). | No | Yes |
| Specifies the date after which the returned media items must have been created. |