Skip to main content

Optimizely

Rendering ContentReference Properties in Optimizely

A commonly used property type in Optimizely CMS (Episerver) is the ContentReference. It allows you to select a single ContentData object and store a reference to it. A common usage for the ContentReference property is an Image selector, created by decorating the property with a UIHint.Image attribute. However, the type of the value saved is not the ImageData, it’s a reference to the ImageData. Because of this using PropertyFor for a ContentReference will render a link for a PageData object, and the name for a Blockdata object. It will not render the view associated with the referenced ContentData. Extra steps are necessary to render the view for the underlying type.

There are several ways to handle this scenario in Optimizely CMS. Check out my article Rendering ContentReference Properties for a basic technique to render ContentReferences in Optimizely using the view for the referenced content type, and leave feedback or questions 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

Follow Us
TwitterLinkedinFacebookYoutubeInstagram