Elements Of The "config.xml.cfm" File
At the top level, a config.xml.cfm document should contain the mandatory <mura> element. There are no attributes available for this element, unless being used with a display object.
The following table describes available attributes, only if used with a display object.
| Attribute | Req/Opt | Default | Description |
|---|---|---|---|
| name | Required | This is the actual name or title of the display object. | |
| contenttypes | Optional | empty string | If blank, it will never display as a draggable option. You may use the asterisk (*) to indicate the display object may be used on all content types. Or, you may pass in a comma-delimited list of content types the display object may be used on. For example, contenttypes="{Type | Type/Subtype},Folder/Blog,Folder/News". |
| omitcontenttypes | Optional | empty string | You may use the asterisk (*) to indicate the display object should not be used on any content types. Or, you may pass in a comma-delimited list of content types the display object should not be used on. For example, contenttypes="{Type | Type/Subtype},Folder/Blog,Folder/News". |
| condition | Optional | true | You may pass in a condition to be evaluated at runtime as to whether the display object should be available. For example, condition="(m.content('title') == 'News')". |
| iconclass | Optional | mi-cog | You may use a Fontawesome icon class, prefixed with "mi-" instead of "fa-" to avoid potential conflicts. For example, iconclass="mi-book". The icon specified here will be used to identify the display object. |
| cacheoutput | Optional | true | If false, output will not be cached, when Site Caching is enabled. |
Example <mura>
This attributes will only be used with a display object.
<mura name="My Display Object" contenttypes="*" iconclass="mi-book"> ... </mura>
Subordinate to the <mura> element is an <imagesizes> element, which may contain one or more custom image sizes, and an <extensions> element, which may contain one or more custom class extension definitions.
<mura> <imagesizes> </imagsizes> <extensions> </extensions> </mura>
Note: Plugins have additional elements, and will be covered in the Plugin Development section.
<imagesize> is a sub-element of <imagesizes>
The following table describes the available attributes.
| Attribute | Req/Opt | Description |
|---|---|---|
| name | Required | Treat the value of this attribute as a variable name. In other words, do not include any spaces or special characters. |
| width | Required | Specify the numeric width in pixels. |
| height | Required | Specify the numeric height in pixels. |
Example <imagesize>
<imagesize name="yourimagesizename" width="600" height="100"/>
<extension> is a sub-element of <extensions>
The following table describes the available attributes.
| Attribute | Req/Opt | Description |
|---|---|---|
| type | Required |
The Base Type to apply the class extension to. Valid options are:
|
| subtype | Required | Use "default" to apply the class extension to all, or enter a custom subtype. Does not apply to the Site type. |
| availablesubtypes | Optional | Answers the question; "Allow users to add only specific subtypes?". Leave blank to allow all content types. Or, you may pass in a comma-delimited list of content types. For example, availablesubtypes="{Type | Type/Subtype},Folder/Blog,Folder/News". |
| description | Optional | May enter a description for the class extension. |
| hasassocfile | Optional | Answers the question; "Show 'Associated Image' field when editing?". Valid options are: 1 (yes/true), 0 (no/false). Default is "1". |
| hasbody | Optional | Answers the question; "Show 'Body' field when editing?". Valid options are: 1 (yes/true), 0 (no/false). Default is "1". Applies to Page, Folder, and Calendar. |
| hasconfigurator | Optional | Answers the question; "Show 'List Display Options' field when editing?". Valid options are: 1 (yes/true), 0 (no/false). Default is "1". Applies to Folder only. |
| hassummary | Optional | Answers the question; "Show 'Summary' field when editing?". Valid options are: 1 (yes/true), 0 (no/false). Default is "1". Applies to Page, Folder, File, Calendar, and Link. |
| iconclass | Optional | You may use a Fontawesome icon class, prefixed with "mi-" instead of "fa-" to avoid potential conflicts. For example, iconclass="mi-book". The icon specified here will be used to identify the display object. |
| isactive | Optional | Answers the question; "Status". Valid options are: 1 (yes/true), 0 (no/false). Default is "1". |
Example <extension>
<extension type="Page" subType="Product" hasSummary="1" hasBody="1" isActive="1"> ... </extension>
<attributeset> is a sub-element of <extension>
An attribute set is similar to creating a <fieldset> element in HTML.
The following table describes the available attributes.
| Attribute | Req/Opt | Description |
|---|---|---|
| name | Required | This will display on the content edit screen as the title or label above the grouping of associated attributes, similar to a fieldset's legend. |
| container | Required | This is the "tab" container which the grouping of associated attributes will be displayed on. Valid options depend on the content Type. See the Available Container Options table. |
| orderno | Optional | Specify the numeric |
Available Container/Tab Options
| Option | Description |
|---|---|
| Basic | Displays the attribute set on the Basic tab. |
| Default | Displays the attribute set on the Extended Attributes tab. This is the default setting. |
| Custom | Will not display the attribute set by default. This allows for a developer to create a custom user interface to collect the data. |
| List Display Options | DIsplays the attribute set on the List Display Options tab. |
| Layout & Objects | Displays the attribute set on the Layout & Objects tab. |
| Categorization | Displays the attribute set on the Categorization tab. |
| Tags | Displays the attribute set on the Tags tab. |
| Related Content | Displays the attribute set on the Related Content tab. |
| Advanced | Displays the attribute set on the Advanced tab. |
| Publishing | Displays the attribute set on the Publishing tab. |
| Usage Report | Displays the attribute set on the Usage Report tab. |
Valid Container/Tab Options
The following table describes available options to use as the value for each Base Type.
| Base Type | Container/Tab Options |
|---|---|
| 1 (User Groups), 2 (Users), & Site |
|
| Pages, Folders, Links, Files, and Calendars |
|
| Address, Custom, and Base |
|
| Component |
|
Example <attributeset>
<attributeset name="Mobile Options" container="Basic" orderno="1"> ... </attributeset>
<attribute> is a sub-element of <attributeset>
An attribute describes a data container (form field) and its validation rules.
The following table describes required and optional attributes of the <attribute> element:
| Attribute | Description |
|---|---|
| name | The variable name. This will also become the form fields "name" attribute. |
| label | The label that will be displayed on the form |
| hint | A tooltip hint for the form field |
| type | Valid options: TextBox (default), TextArea, HTMLEditor, SelectBox, MultiSelectBox, RadioGroup, File, Hidden |
| required | Valid options: true, false (default) |
| validation | Leave blank if not using validation. Otherwise, valid options are: Date, DateTime, Numeric, Email, Regex, Color, and URL. |
| regex | If validation is set to Regex, then you can enter a JavaScript regular expression to execute when the form is submitted. |
| message | The error message that displays when validation fails. |
| defaultvalue | Optional. The default value for the form field. |
| optionlist | A carat "^" delimited list of option values. Used when type is set to SelectBox, MultiSelectBox or RadioGroup. |
| optionlabellist | A carat "^" delimited list of option labels. Used when type is set to SelectBox, MultiSelectBox or RadioGroup. |
| adminonly | Valid options: 0 for false (default), 1 for true. Whether the attribute is for administrator use only, and will not be displayed. |
Note: To enable a color picker for a form field, set type="TextBox" and validation="Color"
Example config.xml.cfm
<?xml version="1.0" encoding="UTF-8"?> <mura> <!-- Image Sizes --> <imagesizes> <imagesize name="locationimage" width="600" height="400"/> </imagesizes> <!-- Class Extensions --> <extensions> <extension adminonly="0" availablesubtypes="Page/Location" description="" hasassocfile="0" hasbody="0" hasconfigurator="0" hassummary="0" iconclass="mi-map-o" subtype="Locations" type="Folder"/> <extension availablesubtypes="" description="" hasassocfile="1" hasbody="0" hasconfigurator="0" hassummary="1" iconclass="mi-map-pin" subtype="Location" type="Page"> <attributeset container="Basic" name="Location Options" orderno="1"> <attribute adminonly="0" defaultvalue="" hint="" label="Location Street" message="Please enter a Location Street" name="locationstreet" optionlabellist="" optionlist="" orderno="1" regex="" required="true" type="TextBox" validation=""/> <attribute adminonly="0" defaultvalue="" hint="" label="Location City" message="Please enter a Location City" name="locationcity" optionlabellist="" optionlist="" orderno="2" regex="" required="true" type="TextBox" validation=""/> <attribute adminonly="0" defaultvalue="" hint="" label="Location State" message="Please enter a Location State" name="locationstate" optionlabellist="" optionlist="" orderno="3" regex="" required="true" type="TextBox" validation=""/> <attribute adminonly="0" defaultvalue="" hint="" label="Location Postal Code" message="" name="locationpostalcode" optionlabellist="" optionlist="" orderno="4" regex="" required="false" type="TextBox" validation=""/> </attributeset> </extension> </extensions> </mura>