The CoreMedia document type model is a very powerful concept to tailor CoreMedia CMS to your needs. However, in any typical project, there are at least a couple of document types mainly designed to manage technical metadata, such as site settings. In many cases you want to hide these document types from casual users of CoreMedia Studio, thereby keeping the interface simple and avoiding clutter. To do so, you can remove choices from the dropdown document type selector in the Library's create content menu, and from the dropdown used to restrict search results to certain document types.
You can add the document types that should not be shown to the list of excluded document types
using the IEditorContext
. The methods getExcludedDocumentTypes()
and
getDocumentTypesExcludedFromSearch()
return an array holding the names of all
document types excluded from the create document dropdown and search filter dropdown,
respectively. Using the array's push
method, you can add additional document
types you wish to hide:
editorContext.getExcludedDocumentTypes().push('<DocType1>', ...)
Example
editorContext.getExcludedDocumentTypes().push('Dictionary', 'Preferences', 'Query', 'Folder_', 'CMDynamicList', 'CMVisual', 'EditorPreferences');
Example 7.21. Defining excluded document types
This call gets the array of excluded document types and adds Strings containing the names of the document types to exclude.
If you are using EXML for your plugin, you can also write the above exclusion instructions declaratively in your main Plugin EXML file:
<editor:configuration> <editor:configureDocumentTypes names="Dictionary,Preferences,Query,Folder_,CMDynamicList,CMVisual,EditorPreferences" exclude="true" excludeFromSearch="true"/> </editor:configuration>
Example 7.22. Defining excluded document types in EXML