World is now on Opti ID! Learn more

Bartosz Sekula
Jul 24, 2023
  56
(0 votes)

Opt-out from Inline Blocks support in ContentArea properties

WARNING: This post is no longer up to date because from CMS UI 12.23.3 inline blocks are no longer enabled by default.

They have to be turned on manually, more details here: https://world.optimizely.com/blogs/bartosz-sekula/dates/2023/5/inline-blocks-in-contentarea/
Or in the documentation https://docs.developers.optimizely.com/content-management-system/docs/inline-edit-settings

OLD BLOG POST BELOW:

In CMS 12.21.0 we added a way to create inline blocks inside each ContentArea property.

This feature is very powerful and has many advantaged as described in my previous blog post: https://world.optimizely.com/blogs/bartosz-sekula/dates/2023/5/inline-blocks-in-contentarea/

However, this also introduced issues for some clients, mostly non-MVC clients who rely on our API endpoints and always expected that each ContentAreaItem to have a non-null ContentLink.

For such cases in CMS UI 12.22.2 we added a way to opt-out from the ability to create inline blocks inside ContentArea.

This new setting is global and the default value is true

InlineBlocksInContentAreaEnabled is a new boolean property added to UIOptions class. You can set it directly in code or you can also use the appsettings approach as shown below:

"EPiServer": {
    "CmsUI": {
        "UI": {
            "InlineBlocksInContentAreaEnabled": false
        }
    }
}

After turning that flag to false the link to create an inline block in each ContentArea property will no longer be available.

Of course it is still possible to use the Assets pane to create shared blocks within the folder structure or use the `For this page/block` folder as contextual storage.

Important note: It is no longer possible to create shared blocks from Content Area.

12.22.2 also introduces a way to configure the labels for inline blocks.

By default inline blocks labels are just their type names. It is fine if there are just a few but if the list of blocks is long it may be very problematic to find the block you need to edit (because in contrast to the On-Page-Edit here you don't see the view of the block). We added a way to instruct ContentArea to use a specific property from block type as a label.

In order to do it you can use the new InlineBlockNamePropertiesOptions which can be set via appsettings.json in the following way:

"EPiServer": {
    "CmsUI": {
        "InlineBlockNameProperties": {
            "Contact": "Heading",
            "Teaser": "Heading"
        }
    }
}

It is a simple Dictionary<string, string> of BlockTypeName / PropertyName

Of course both options classes can be set in c#:

services.Configure<UIOptions>(o => {
    o.InlineBlocksInContentAreaEnabled = false;
});

services.Configure<InlineBlockNamePropertiesOptions>(options =>
{
    options.Add("Teaser", "Heading");
});

More details available here: https://docs.developers.optimizely.com/content-management-system/docs/inline-edit-settings 

Jul 24, 2023

Comments

Please login to comment.
Latest blogs
Make Global Assets Site- and Language-Aware at Indexing Time

I had a support case the other day with a question around search on global assets on a multisite. This is the result of that investigation. This co...

dada | Jun 26, 2025

The remote server returned an error: (400) Bad Request – when configuring Azure Storage for an older Optimizely CMS site

How to fix a strange issue that occurred when I moved editor-uploaded files for some old Optimizely CMS 11 solutions to Azure Storage.

Tomas Hensrud Gulla | Jun 26, 2025 |

Enable Opal AI for your Optimizely products

Learn how to enable Opal AI, and meet your infinite workforce.

Tomas Hensrud Gulla | Jun 25, 2025 |

Deploying to Optimizely Frontend Hosting: A Practical Guide

Optimizely Frontend Hosting is a cloud-based solution for deploying headless frontend applications - currently supporting only Next.js projects. It...

Szymon Uryga | Jun 25, 2025

World on Opti ID

We're excited to announce that world.optimizely.com is now integrated with Opti ID! What does this mean for you? New Users:  You can now log in wit...

Patrick Lam | Jun 22, 2025

Avoid Scandinavian Letters in File Names in Optimizely CMS

Discover how Scandinavian letters in file names can break media in Optimizely CMS—and learn a simple code fix to automatically sanitize uploads for...

Henning Sjørbotten | Jun 19, 2025 |