6.2.1Property input field customization

Documents contain properties of types String, Text, Blob, Integer, Date or Link (see the chapter about document type management).

There are standard input fields for those property types available that may be configured or replaced by other input fields storing their results in one of the basic property types.

Each property of each document type can be configured separately. If not there is always a predefined input field for the property active.

Different input field appearances can be managed by selecting the correct "xtype" from the table below.

xtypeTypeDescriptionAdditional actions / options
itwblobBLOBBlob input field (upload)-
itwdatetimeDATEDate input field-
itwtextSTRINGString input field consisting of one lineMay use the horizontal width as an appearance property regulating the length of the input field
itwdocumenttableLINKLinklist of other cmsWorks documents-
itwcategoryLINKSpecialized input field for cmsWorks categories-
itwrichtextTEXTRichtext input fieldMay override the initial configuration of tinyMCE by using 'tinymce: { ... }'
itwdatagridTEXTGrid input fieldThe underlying property type has to be of type "text"
itwintegerINTEGERNumber (integer) input fieldHas a validator for numbers as default validator
itwcheckboxINTEGERCheckbox input fieldIn case the checkbox should be checked by default please set defaultValue = 1
itwselectboxINTEGERSelectbox input fieldThe list of options for the selectbox is declared in an options array property of type [number,value], you may default to an option by using defaultValue = <numberOfOption>
itwcomboSTRINGSelectbox with string inputA special selectbox which additionally allows to enter a string instead of the selections provided

To get a visual of the input type visit in the Document input fields from the cmsWorks user guide.

Example configuration: Creating a simple article

Assuming we have a document type named "article", this document may have the fields

  • articledate (DATE)
  • articletype (INTEGER, because it shall be a selectbox)
  • title (STRING)
  • abstract (TEXT)
  • text (TEXT)
  • related (LINK, because it is a list of other related articles)
  • exportable (INTEGER, because it shall be a checkbox)
  • source (STRING, because it shall be a selectbox with additional string input)
  • parameters (TEXT, this shall be a grid to show the configuration of it)

So the overall document section of the configuration looks like this:

"document": {
"article": {
"articledate_prop": { ... }, // Actually not necessary because dates cannot be tailored
"articletype_prop": { ... },
"title_prop": { ... },
"abstract_prop": { ... },
"text_prop": { ... },
"related_prop": { ... },
"exportable_prop": { ... },
"source_prop": { ... },
"parameters_prop": { ... }
},
"insertnextdocumenttypehere": {
...
}
}

Date input field

The articledate property as date property cannot be tailored and therefore is skipped here.

Selectbox

The articletype property being a selectbox with the values "Background", "Preview", "Standard" exemplary looks like

"articletype_prop": {

// The xtype changes the input field to a SelectBox.
"xtype": "itwselectbox",

/* The options list defines the assignment of the
Integer value to a Label (in this case a type name).
An optional third value should contain a String describing the effects
of the selection and is shown at the info button beside the dropdown input element.
*/
"options": [
[0,"Background","Use as a background article"],
[1,"Preview"],
[2,"Standard"]
],

// In a newly created document the option 'Standard' (2) will be preselected.
"defaultValue": 2

},

String (single line)

The title property is a one-line input field, appearance-width and defaultValue apply.

"title_prop": {

// Setting the width to 250 pixel
"appearance": { "width": 250 },

// Not really reasonable to set a default text here, for demonstration purposes only
"defaultValue": "Some default text"

},

Richtext

Configuring the text properties of the article document is optional. If nothing is configured, the richtext input field will be used for text fields, the linktypes and richtext configuration is used from the richtext property of the customer_modification which are described in detail here.

Setting a configuration will optionally override the linktypes or replace the properties of the richtext configuration.

"abstract_prop": {
"xtype": "itwrichtext",
"tinymce": {
"config": {
"toolbar": "undo redo | styleselect removeformat | bold italic underline | formatselect | bullist numlist | link unlink"
},
}
},

"text_prop": {
"xtype": "itwrichtext",
"tinymce": {
"components": true,
"componenttypes" : {
"m":"centered",
"i":"inline",
"l":"left",
"r":"right"
}
}
},

In this example for the abstract text only the toolbar is adjusted. Code view and table creation is removed. For the text property components (special cmsWorks text components) are beeing enabled and configured.

Linklist

The "related" property is a link list and cannot be tailored any further.

"related_prop": {
"xtype": "itwdocumenttable"
},

Checkbox

The "exportable" property is a checkbox.

"exportable_prop": {

// Define input field CheckBox.
"xtype": "itwcheckbox",

// Set an (optional) alternative Label to explain the effect using the checkbox.
"label": "This article may be exported for further use.",

// Setting the default to "1" automatically checks the box in the beginning, skip this to keep it unselected
"defaultValue": 1

},

Combobox

The source property is a selectbox with the possibility to alternatively enter text, too. This field type is only usable on string input fields.

"source_prop": {

// Define the type as combo
"xtype": "itwcombo",

// The user may enter text
"editable": true,

// Preselections are stored in data
"options": [
["Please select / enter a value"],
["Associated Press (AP)"],
["Agence France Press (AFP)"],
["Thomson Reuters Corporation"],
["IPS"]
],

// Defaulting to this text
"defaultValue": "Please select / enter a value",

}

Grid

The grid property type cannot be tailored any further.

"parameter_prop": {
"xtype": "itwdatagrid"
}