Collective Spaces - BehaviorConfig.xml
The Collective Spaces user interfaces ship with default rendering and menu behavior for the DITA XML elements, defined in the DITA OASIS and SDL DTDs and schemas. You can customize Collective Spaces by editing the configuration file BehaviorConfig.xml, which is applied on top of the default behavior. In BehaviorConfig.xml, you define how DITA XML elements should be rendered for an XML document, which contextual menu items to show and which menu items to show in the Custom top menu tab.
You can find BehaviorConfig.xml on the file system of the Content Manager server in the Web\InfoShareCS\custom\ folder. This configuration file only affects the Collective Spaces user interfaces.
Out of the box, it only contains a root element and a reference to its schema file, BehaviorConfig.xsd, which you can use to validate the file as you edit it. Never change BehaviorConfig.xsd itself.
- Rendering configuration
-
The rendering configuration can:
- change the out-of-the-box rendering of existing DITA XML elements
- add rendering for specialized DITA XML elements specified in a custom DITA DTD or schema
- Context menu configuration
- The context menu configuration specifies which context menu items to show when you are positioned in the configured DITA XML element.
- Top menu configuration
-
The top menu configuration specifies which additional custom menu items to show in top menu bar. You cannot change any of the existing top menu items. You can either:
- Build your own additional custom menu structure, by using a
menuconfigurationelement. - Let the system generate an extra Custom top menu tab, which will show all the
menuitemelements alphabetically
- Build your own additional custom menu structure, by using a
- Sidebar configuration
-
The sidebar configuration specifies an additional sidebar to show in the menu on the right. You cannot change any of the existing sidebars. You can:
- Build your own additional sidebar by using a
sidebarconfigurationelement. - Specify the position of your custom sidebar on the sidebar menu panel.
- Build your own additional sidebar by using a
- Conref configuration
-
The conref configuration specifies which specialized XML elements a user is able to conref. Note that the out-of-the-box elements can always be conrefed, but that an element in an XML document can only be conrefed if it has its
idattribute set. You can:- Define the list of elements the user can conref by using a
conrefconfigurationelement.
- Define the list of elements the user can conref by using a
Overview of the XML elements in BehaviorConfig.xml
behaviorconfig- This is the root element of the file.
behaviorscopegroup-
Use this element to group together
behaviorgroupelements. You can then use ascopetoschemaschild element to ensure that the behaviors defined in thosebehaviorgroupchild elements are only applied if the schema of the loaded XML document is one of the schemas listed underscopetoschemas. scopetoschemas(optional)-
The list of schemas to which the behaviors defined in this
behaviorscopegroupshould be restricted. If you omit this element, the behaviors are applied to all schemas, so for every opened XML document. schema-
This element specifies, in its
locationattribute, the file location of a schema to which the behaviors defined in thisbehaviorscopegroupare applied. Set the value to the file location of the schema relative to theDocTypes\folder; that is, the value should match one of the schema location attributes configured in the SchemaLocationConfig.xml file. behaviorgroup- This element groups one or more rendering behavior elements, contextual menu items or (top) menu items together.
- Rendering behavior elements
-
Use the following elements to specify how to render a DITA XML element that matches the XPath specified in its
xpathattribute:mapsheetstructureviewitemsheetsheetbodytitleblockinlinehighlightinglistimageblockgenericiconinlinegenericicondefinitiontablereadonlynarrowtable
contextualmenuitems-
Use this element to specify which contextual menu items to show when the user is positioned in an element matching the
xpathattribute. menuitems-
Use this element to specify which menu items to show in the top menu. When you set an id attribute value for a
menuitemelement, the same value can be set in therefattribute of themenuitemrefelement inside themenuconfigurationelement to reference the menu item and build a custom menu structure. menuconfiguration(optional)-
Use this element to specify which menu items to show in the top menu. Every
extramenuchild element in themenuconfigurationis rendered as an extra tab in the top menu bar with the given label. When you set an (optional)xpathattribute value on theextramenuelement, the extra tab is only shown when you are positioned in a document that matches thexpath. Theextramenuelement groups one or more of the menu structure elements. - Menu structure elements
-
Use the following elements in the
menuconfigurationextramenuelements to specify how the custom menus will look:- The
menuitemrefrefattribute value should match with the value of anidattribute of amenuitemelement defined in one of the behavior elements. It renders as a menu item with the label of the referencedmenuitemelement. - The
menuseparatorrenders as a horizontal or vertical separator between menu items. - The
menuexpandgroupgroups one or more of the menu structure elements. It renders as a drop-down or expand menu with the given label and its child elements as sub-menu items.
- The
- Sidebar attributes
-
Use the following attributes for the
sidebarconfigurationextrasidebarto specify the looks of your custom sidebar:- The
urlattribute to specify the application URL. This URL will be used to render the custom application in the iFrame. This is a mandatory attribute. - The
positionattribute to specify the position of the custom sidebar on the sidebar menu panel. Value1means first from the top. - The
iconattribute to specify the sidebar icon that will be visible next to the label. Use one of the FontAwesome icons. - The
sizeattribute to specify the width of the sidebar while the tab is opened. You can choose froms,m(default), orlwhich translate to small, medium, and large.
APIendpoint to show whichJSONcontent gets sent from Draft Space. - The
- Conref configuration
-
Use the following elements in the
conrefconfigurationto specify the list of elements the user is able to conref:- The
elementhas 2 attributes:- The required
nameattribute contains the name of the XML element in the XML document that the user can conref. - The optional
baseelementattribute is rarely needed. It's value should only be set totopicwhen the configured XML element is specialized from the DITAtopicelement or any of its specializations.
- The required
- The