Skip to main content

Optimizely

ContentReference Rendering in Optimizely With TemplateTags

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

Daved Artemik

More from this Author

Categories
Follow Us