Try our conversational search powered by Generative AI!

Tahir Naveed
Oct 11, 2019
  1770
(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
Why C# Developers Should Embrace Node.js

Explore why C# developers should embrace Node.js especially with Optimizely's SaaS CMS on the horizon. Understand the shift towards agile web...

Andy Blyth | May 2, 2024 | Syndicated blog

Is Optimizely CMS PaaS the Preferred Choice?

As always, it depends. With it's comprehensive and proven support for complex business needs across various deployment scenarios, it fits very well...

Andy Blyth | May 2, 2024 | Syndicated blog

Adding market segment for Customized Commerce 14

Since v.14 of commerce, the old solution  for adding market segment to the url is not working anymore due to techinal changes of .NET Core. There i...

Oskar Zetterberg | May 2, 2024

Blazor components in Optimizely CMS admin/edit interface

Lab: Integrating Blazor Components into Various Aspects of Optimizely CMS admin/edit interface

Ove Lartelius | May 2, 2024 | Syndicated blog

Anonymous Tracking Across Devices with Optimizely ODP

An article by Lead Integration Developer, Daniel Copping In this article, I’ll describe how you can use the Optimizely Data Platform (ODP) to...

Daniel Copping | Apr 30, 2024 | Syndicated blog

Optimizely Forms - How to add extra data automatically into submission

Some words about Optimizely Forms Optimizely Forms is a built-in add-on by Optimizely development team that enables to create forms dynamically via...

Binh Nguyen Thi | Apr 29, 2024