Generic Render Handlers

With release 10.0, CommonSpot includes the ability to create and distribute “generic” render handlers. Like all render handlers, generic render handlers provide great flexibility and control over how content displays on pages or templates, with these important additional benefits:

Instead of coding HTML and CSS with ColdFusion to create the renderings desired for element data, you can apply generic handlers to standard HTML and allow end users to fine-tune rendering through CSS. Administrators or designers can apply a generic render handler to a standard or custom element, pick the fields to render, and then allow designers or other contributors to apply styles to those fields without the need for developer support. For both custom and standard elements, fields supported by generic render handlers are provided as mapping fields.

For example, to use a single render handler for a Single Image element and a custom image element, you would simply map the defined generic fields (Image Name, Description, ImageURL, LinkURL) to the related fields within each element. For the Single Image element you would map the ImageURL field to "PrimaryImage.ResolvedURL.ServerRelative." For a custom element containing the field "Image Fld" you would map the generic ImageURL field to the custom field. Although the mapped fields are different, CommonSpot uses the generic field name to render the values contained within each of the elements.

Custom elements include fields to resolve URLs, as shown in Edit Field Mappings.

This feature is implemented through the function getGenericFieldMappingsArray(), which returns an array of structures describing the fields it needs to render. See the Developer's Guide for details. Once a render handler containing this function is registered in CommonSpot, editing an element layout using the generic render handler invokes the dialog to map the fields of a standard or custom element to fields in the generic render handler as shown above.

You can write a generic render handler to support the element types used most often at your site. See the sample in \cs\web\commonspot\samples\generic-render-handlers. Once you create a generic render handler, register it in CommonSpot just as you would any other render handler through Add Render Handler.

Users can choose a generic render handlers from Manage Layouts. These layouts are indicated by an edit icon with a dropdown menu .


Related Links

You can download PDF versions of the Content Contributor's, Administrator's, and Elements Reference documents from the support section of (requires login).

For technical support: