Cms:contentload

(Difference between revisions)
Jump to: navigation, search
(it's %())
m
Line 5: Line 5:
 
Here is an example where an asterisk is used for pattern matching in the param section:
 
Here is an example where an asterisk is used for pattern matching in the param section:
  
<pre>
+
<code lang="html4strict">
 
   <cms:contentload collector="allInFolderPriorityDateDesc" param="${opencms.folder}news${*}.html|news|15" editable="true">
 
   <cms:contentload collector="allInFolderPriorityDateDesc" param="${opencms.folder}news${*}.html|news|15" editable="true">
 
     <%-- create a date object from date value --%>
 
     <%-- create a date object from date value --%>
Line 13: Line 13:
 
     </li>
 
     </li>
 
   </cms:contentload>
 
   </cms:contentload>
</pre>
+
</code>
  
 
Important note, if you are running OpenCms 7 or newer, use <tt>%(opencms.folder)</tt>, <tt>%(opencms.filename)</tt>, etc, since the macro syntax is now "%()".
 
Important note, if you are running OpenCms 7 or newer, use <tt>%(opencms.folder)</tt>, <tt>%(opencms.filename)</tt>, etc, since the macro syntax is now "%()".

Revision as of 00:36, 27 September 2008

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 --%>	
    <li>
      <a href="<cms:link><cms:contentshow element="${opencms.filename}" /></cms:link>" title="<cms:contentshow element="Title" />"></a>
      <p><cms:contentshow element="Teaser" /></p>
    </li>
  </cms:contentload>

Important note, if you are running OpenCms 7 or newer, use %(opencms.folder), %(opencms.filename), etc, since the macro syntax is now "%()".

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox