Optimizely

ContentReference Rendering in Optimizely With TemplateTags

Lightbulb for idea

I recently wrote an article about Rendering ContentReference Properties in Optimizely. That article explored a basic approach to rendering a ContentReference based on the type of the referenced ContentData. One drawback to that approach is the need for a new DisplayTemplate for each type used for a ContentReference. Thankfully, there is another approach that works with a single DisplayTemplate for most content types. By creating a single partial DisplayTemplate, and adding support for a TemplateTag parameter you can handle most of your ContentReference rendering needs.

To check out this approach and view the code, read my post Rendering ContentReference with Shared Views Using a TemplateTag. Leave any feedback and comments below.

About the Author

More from this Author

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Subscribe to the Weekly Blog Digest:

Sign Up
Categories