close

Filter

loading table of contents...

Content Application Developer Manual / Version 2010

Table Of Contents

4.3.5.4 Advanced Metadata Usage

For Studio preview integration, you usually use content and property paths as metadata to specify the source of generated HTML output. As convenience, the metadata macro / tag automatically converts object and string parameters to metadata nodes with a single "default" property named "_" (underscore), containing the given data. You only need to specify this default property explicitly if you want to add custom metadata to the same metadata node.

The Studio preview integration only evaluates content objects and properties in the _ property, the properties cm_preferredWidth and cm_responsiveDevices which are used for the device slider, and additionally the property cm_highlightStrategy to control the highlight border rendering strategy.

All metadata using other property names will be handed through to Studio, but is not interpreted by the built-in preview integration. To take advantage of such custom metadata, you have to implement a Studio plugin that accesses and interprets this metadata. For details, see Chapter 1, Introduction in Studio Developer Manual.

Here is an example of the same combination of preview metadata and custom metadata in both template languages, FreeMarker and JSP.

<@preview.metadata [self.content, {"_": "properties.title",
    "custom-key": "custom-value"}]/>

Example 4.15. Mixed preview and custom metadata in FreeMarker


<cm:metadata>
  <cm:object value="${self.content}"/>
  <cm:object>
    <cm:property name="_" value="properties.title"/>
    <cm:property name="custom-key" value="custom-value"/>
  </cm:object>
</cm:metadata>

Example 4.16. Mixed preview and custom metadata in JSP


Search Results

Table Of Contents