In Edit Mode, the Content Details Panel shows information about Content Type, internal ID, roles and languages. It could be useful for administrators, but sometimes we would like to hide it for editors. Below I will describe how can we control the visibility of those elements. There are two versions of code. First shows how to hide elements for all users and second how to hide elements only for editors.

Hide elements for all users

If we want to hide Content Details panel elements for both editors and admins we can use custom CSS styles registered in module.config.

To add custom CSS file to Edit Mode I included it in main module.config file. Below is the updated module.config from Alloy project. There is a new entry for customStyles.css.

Displaying elements only for admins

If we want to hide some elements for editors, but keep them for admins we need to extend ContentDetails widget. ContentDetails has “Manage roles” link that is displayed only for the admins, so we could reuse this logic. The link visibility is controlled by _setManageAccessRightsVisibleAttr function. I added _hideElementContainer function which set the visibility on nodes. To hide specific elements we need to uncomment one of the function call.

The “epi-cms/contentediting/ContentDetails” is used by SettingsPanel, so we need to extend the settings panel and replace detailsWidgetIdentifier property with “ExtendedContentDetails”.

Finally we have to use extended SettingsPanel. I prepared new MetadataExtender registered in the InitializationModule. The extender replace SettingsPanel with ExtendedSettingsPanel.

For example, we can hide “Roles management” information.