Take the community feedback survey now.

Tahir Naveed
Oct 11, 2019
  2461
(0 votes)

Set display options for content area item via code

On the subject of “note to self” & “for future reference”, when required to setup display options programmatically for a given content area item

ContentAreaItem newContentAreaItem = new ContentAreaItem() { ContentLink = “ID of your content”};

newContentAreaItem.RenderSettings = new Dictionary<string, object>();
newContentAreaItem.RenderSettings.Add("data-epi-content-display-option",”Id of display option”);

And to get all the registered displayoptions

var options = ServiceLocator.Current.GetInstance<DisplayOptions>();

Hope this might be useful for someone

Oct 11, 2019

Comments

Please login to comment.
Latest blogs
Optimizely CMS - Learning by Doing: EP06 - Create Header, Footer, Menu & Component/View for Blocks

  Episode 6  is Live!! The latest installment of my  Learning by Doing: Build Series  on  Optimizely CMS 12  is now available on YouTube! This vide...

Ratish | Nov 4, 2025 |

Going Headless: 3 Ways to Store Custom Data in Optimizely Graph

Welcome to another installment of my  Going Headless  series. Previously, we covered: Going Headless: Making the Right Architectural Choices Going...

Michał Mitas | Nov 3, 2025

A day in the life of an Optimizely OMVP - What's New in Optimizely CMS: A Comprehensive Recap of 2025 Updates

Hello and welcome to another instalment of a day in the life of an Optimizely OMVP. On the back of the presentation I gave in the October 2025 happ...

Graham Carr | Nov 3, 2025

Optimizely CMS Mixed Auth - Okta + ASP.NET Identity

Configuring mixed authentication and authorization in Optimizely CMS using Okta and ASP.NET Identity.

Damian Smutek | Oct 27, 2025 |