The “Display Options” is a global settings list defined in DisplayOptions service. It’s used together with ContentArea property to set the layout for the content items. Sometimes editor should not be able to set options on each ContentArea because in some cases they might not be used in the template implementation. Last week I prepared a code for hiding Display Options for specific ContentAreas.

ContentArea Display Options

First we need to implement new EditorDescriptor and set out custom ClientEditingClass and Overlay. Then we need to implement Dojo widgets.

All properties view

The ClientEditingClass is used to define “All properties” view widget. Final class will inherits from standard ContentAreaEditor. In the postMixInProperties method we need to skip SelectDisplayOption command, but keep all other commands.

From now the “All properties” ContentArea doesn’t contain Select Options menu item.

ContentArea without Diplay Options Forms

On-page edit Overlay

Content item commands are not set on the ContentArea overlay level. They are assigned for each block in the Block overlay. That’s why we need to prepare new Block overlay and set context menu commands similar like we did with “All properties” editor. Then we need to create custom ContentArea overlay and use previously prepared custom block overlay.

The ContentArea overlay:

… and the Block overlay

ContentArea without Display Options

To use new implementation, the model property have to be declared with correct UIHint.

The full source code is available in Gist

ContentArea DisplayOptions