Studio Developer Manual / Version 2107
Table Of ContentsThe 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 content types that should not be shown to the list of excluded content types
using the IEditorContext
. The methods getExcludedDocumentTypes()
and
getContentTypesExcludedFromSearch()
return an array holding the names of all
content types excluded from the create document dropdown and search filter dropdown,
respectively. Using the array's push
method, you can add additional content
types you wish to hide:
editorContext.getExcludedDocumentTypes().push('<DocType1>', ...)
editorContext.getExcludedDocumentTypes().push('Dictionary', 'Preferences', 'Query', 'CMDynamicList', 'CMVisual', 'EditorPreferences');
Example 7.20. 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 MXML for your plugin, you can also write the above exclusion instructions declaratively in your main Plugin MXML file:
<editor:configuration> <editor:ConfigureDocumentTypes names="Dictionary,Preferences,Query,CMDynamicList,CMVisual,EditorPreferences" exclude="true" excludeFromSearch="true"/> </editor:configuration>
Example 7.21. Defining excluded document types in MXML