TokenManager: Rendering Token

This is a post regarding a specific type of token used in the TokenManager, the Rendering Token.

The rendering token gives content authors the ability to inject entire renderings into their rich text fields.  This will work with any stand alone renderings, or renderings that don’t rely on filling placeholders with child components.  It’s also worth noting that this particular token only works with Sitecore MVC.

What does it do?

Takes a particular rendering item, matches it with a datasource item to render the rendering item and inject it into the rich text.

How is it set up?

The value field of the token is replaced by a “Rendering” internal link field in which you select the rendering to execute.

RenderTokenTree

At which point you can select the token from the Token selector form in the rich text editor.

RenderTokenSelect

At the point in which you select a rendering token a second form will appear in which you select the datasource for this type of token.

RenderTokenDatasource

Once it’s on the page it will look the same as any other token.  However if you look at the HTML you’ll see a query string that has the datasource that you selected.

RenderTokenInRTE

If you have your cursor anywhere in or have any part of the rendering token selected when you click the token selector button it will bring you right to the datasource selection form.

Once the field is rendered the token identifier will be swapped out with the rendering.

RenderTokenOnPage

Becomes this.

RenderTokenRendered

Customization options

The possibilities are tremendous when you have this amount of flexibility in the rich text editor, you can stop thinking of renderings as stand alone chunks of content but think of them as an extension of a users rich text capabilities.  Just remember that with great power comes great responsibility, a proper content management strategy that match the capabilities of your authors is vital.

Sample usage

In the example above we have a video player being injected into the rich text editor.  You could have a product callout you would like to inject inside a rich text editor.  You could have a dynamically rendered table that you need to inject into rich text.  The possibilities go on and on, and honestly this is a new paradigm shift in component based architecture, so go ahead and get creative.