Try our conversational search powered by Generative AI!

Tahir Naveed
Oct 11, 2019
  1778
(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
A day in the life of an Optimizely Developer - Enabling Opti ID within your application

Hello and welcome to another instalment of A Day In The Life Of An Optimizely developer, in this blog post I will provide details on Optimizely's...

Graham Carr | May 9, 2024

How to add a custom property in Optimizely Graph

In the Optimizely CMS content can be synchronized to the Optimizely Graph service for it then to be exposed by the GraphQL API. In some cases, you...

Ynze | May 9, 2024 | Syndicated blog

New Security Improvement released for Optimizely CMS 11

A new security improvement has been released for Optimizely CMS 11. You should update now!

Tomas Hensrud Gulla | May 7, 2024 | Syndicated blog

Azure AI Language – Key Phrase Extraction in Optimizely CMS

In this article, I demonstrate how the key phrase extraction feature, offered by the Azure AI Language service, can be used to generate a list of k...

Anil Patel | May 7, 2024 | Syndicated blog