Cms Macros

(Difference between revisions)
Jump to: navigation, search
 
Line 10: Line 10:
 
You can also use build in cms macros, such as:
 
You can also use build in cms macros, such as:
 
*${property.collector} - resolves to a property called collector
 
*${property.collector} - resolves to a property called collector
 +
*${number} - resolves to any number
 +
*${property.xml-content} -
 +
    Will be replaced by the value of the property "xml-content"
 +
*${opencms.uri}  -
 +
    Will be replaced by the current OpenCms VFS URI. Its typical to use this with the singleFile collector a detail view jsp.
 +
*${opencms.filename} -
 +
    Will be replaced by the resource name of the current xml content resource while looping through the single resources.
 +
*${param.resourceType} -
 +
    Will be replaced by the value of the Http reuest parameter "resourceType.

Revision as of 18:26, 23 March 2007

Using Cms Macros

OpenCms has a macro language that you can use parameters to your jsp tags. This is particularly useful for cms:contentload.

The macros are resolved using CmsMacroResolver. This "resolves macros in the form of ${key} in an input String. The macro names that can be resolved depend of the context objects provided to the resolver using the set... methods."

Some examples:

  • ${*} - resolves to any file

You can also use build in cms macros, such as:

  • ${property.collector} - resolves to a property called collector
  • ${number} - resolves to any number
  • ${property.xml-content} -
   Will be replaced by the value of the property "xml-content"
  • ${opencms.uri} -
   Will be replaced by the current OpenCms VFS URI. Its typical to use this with the singleFile collector a detail view jsp.
  • ${opencms.filename} -
   Will be replaced by the resource name of the current xml content resource while looping through the single resources.
  • ${param.resourceType} -
   Will be replaced by the value of the Http reuest parameter "resourceType.
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox