Hi,
If you don't set the display options somewhere in your initialization module, then options should not appear in ContentArea.
In Alloy solution there is DisplayRegistryInitialization initialization module. There is a code:
var options = ServiceLocator.Current.GetInstance<DisplayOptions>(); options .Add("full", "/displayoptions/full", Global.ContentAreaTags.FullWidth, "", "epi-icon__layout--full") .Add("wide", "/displayoptions/wide", Global.ContentAreaTags.TwoThirdsWidth, "", "epi-icon__layout--two-thirds") .Add("narrow", "/displayoptions/narrow", Global.ContentAreaTags.OneThirdWidth, "", "epi-icon__layout--one-third");
I tried to remove this. The Display Options menu dissapeared. Is this what you need?
No not really, I still want my display options for most content areas, but disable them for a select few.
In other words, something like this would be best
[DisableDisplayOptions] public virtual ContentArea Pages { get; set; }
The Display Options list is global and used across all ContentAreas.
I prepared a solution for disabling Display Options for specific ContentAreas, but it's few files and need explanation.
First of all you need to turn off Display Options on property in Forms Editing view and in On Page view.
That's why you need to prepare EditorDescriptor.
To turn it off in Forms Editing you need to inherit from original editor and and skip SelectDisplayOption menu command. This one file change.
To change the overlay you need to inherit from original overlay, then in your overlay use custom block overlay. And in block overlay skip SelectDisplayOption menu command.
I used public EPIServer client side API, so those are not hack.
I paste this solution on gist
In few days I'll prepare a blog post about this solving this issue.
This blog post may contiain the answers you need: http://geta.no/blogg/filtered-display-option-menu-based-on-content-type-in-episerver/
Here is my post: https://gregwiechec.com/2015/09/how-to-hide-display-options-for-specific-contentarea/. It a solution for hiding all display options on ContentAreas.
Is there any way to disable all display options for a content area property so that the content is rendered with the pre-defined tag (Automatic).
To clarify, I am not talking about restricting certain display options to a type of content.
A property rendered with @Html.PropertyFor(m => m.CurrentPage.Pages, new { Tag = "Link" }) sets the "Automatic" display option to Link but still enables the editor to switch to another display option.
We simply want to turn off the option to "Display as" for a single content area.