You are here: Administrators Reference > Site Administration > Elements & Forms > Elements > Defining Render Handlers > Generic Render Handlers Overview

Generic Render Handlers Overview

Prior to Commonspot 10.0 each render handler was written specific to the fields of the element to which the render handler was bound. There was no easy way to share renderings across element types, without writing additional code. With release 10.0, CommonSpot includes the ability to create and distribute “generic” render handlers, which are render handlers that are designed to be used by multiple elements, with different fields. The render handler basically announces the fields it takes as input (either required or optional) and CommonSpot presents a user interface that allows the administrator to “map” the fields of the source element to the fields the render handler uses.

As an example,a jQuery Carousel widget might render one or more the following fields:

If your site stored Profiles in a local custom element, and Blog entries in a global custom element, or images in an image gallery, you might want to use the same Carousel to render these different objects.

With CommonSpot 10.0 you can now write a “Generic Render Handler” and use it to render this carousel for all three element types in our example above.

Our sample carousel “Generic” Render Handler would simply implement a function that returns an array of structures, describing the fields it takes and renders:

Then for each element type (Profile Global Custom element, Blog Local Custom Element, or Image Index element), an administrator could register our Sample Carousel Render Handler and map the fields appropriately.

For example the Profile element might map the following fields:

And the Blog element, might map these fields:



Related Links

Export Generic Custom Render Handler Step 1 of 2

Export Generic Custom Render Handler Step 2 of 2

Edit Field Mappings

Add Render Handler

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: