Cms:contentload

From OpenCms Wiki
Revision as of 01:13, 23 March 2007 by Pam (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

There is only a little documentation regarding usage of cms:contentload. This document hopes to expand on that.

Contentload is a tag that will let you load a CMS resource as an object, and manipulate it using jsp tags. More detail is available in the documentation included with OpenCms.

Here is an example where an asterisk is used for pattern matching in the param section: <cms:contentload collector="allInFolderPriorityDateDesc" param="${opencms.folder}news${*}.html|news|15" editable="true"> <%-- create a date object from date value --%> <c:set var="dateString"> <cms:contentshow element="Date" /> </c:set> <%

try { long dateLong = (new Long((String)pageContext.getAttribute("dateString"))).longValue(); Date date = new Date(dateLong); pageContext.setAttribute("date", date); } catch (Exception e) {}

%>

  • <a href="<cms:link><cms:contentshow element="${opencms.filename}" /></cms:link>" title="<cms:contentshow element="Title" />"><fmt:formatDate value="${date}" dateStyle="long" /></a>

    <cms:contentshow element="Teaser" />

    </li> </cms:contentload>

  • Personal tools
    Namespaces
    Variants
    Actions
    Navigation
    Toolbox