Template configuration

A template is defined by the fields in the table below. The config property defines the behaviour of the template:

  • Object plugins to enable for a template
  • Grid columns to display
  • System folders to create as child nodes when an object is created

These are features available in CB platform, but an instance may store any template properties in config JSON.

Property Description Example
id a unique identificator of the template Used in configuring the Menu and the filter in _objects field type.
Name the name of a template
$lang template title in a given language example 'en'. CB will show the template title if the language specified by the user
Type see Template Types Most of the time you'll manage 'object' templates
Active yes/no template can be turned on/off. Notice that you need to specify in which menu the template will appear. See New menu
Icon class what icon to use when displaying the object in the grid Additinal css files can be added to the configuration, thus allowing for custom icons.
Title template The title can be automatically generated from other fields Product N{nr} from {country}
Config a JSON cfg: available object_plugins, grid display columns etc
{
    "object_plugins": [
        "objectProperties",
        "thumb",
        "meta",
        "files",
        "contentItems",
        "comments",
        "systemProperties"
    ],
    "layout": [vertical, horizontal],
    "DC": {
        "type": {},
        "order": {}
    },
    "defaultPid": int,
    "leaf": true/false,
    "acceptChildren": true/false
}

object_plugins: what plugins are available in the preview panel when the record is selected

layout: how the Preview&Edit Window will display the node, with a right panel with plugins, or the plugins displayed below the vGrid.

DC: Display columns for the Grid when navigating inside the record

defaultPid: if parent node is not specified when a record is created, use defaultPid from template

leaf: double clicking the node in Grid will Edit it instead of opening it as a folder. Default = false

acceptChildren: Allow D&D operations over the node, fileUpload for ex. Default = true

Object plugins

The preview window of an object in WebClient is comprised of several blocks. Each block is handled by an ObjectPlugin. Below is the model of the Preview panel.

A screenshot that illustrates the model. In this example the following plugins are configured for the template:

  • obectProperties
  • files
  • tasks
  • comments
  • systemProperties

For a full reference of object plugins see Object Plugins.

Display columns

Custom display columns can be configured to be shown in the Grid. The columns should be defined in templates or custom code. The columns can be specified at the level of:

  • a specific object of the tree in cfg field of the tree mysql table. (all children objects will also display these columns)
  • the config of a template. see Template configuration.
  • custom code, using onGetGridColumns event.

Display columns are specified using the following JSON notation:

{
  "DC": {
    "columnName1": { config },
    "columnName2": { config }
  }
}

In the screenshot above DC is configured in the template of type "Template" to show two columns type and order. It means that browsing any template in CB will show these columns in the grid:

{
  "DC": {
    "type": {},
    "order": {}
  }
}

Here is a screenshot while browsing the Task template:

System folders

When an object of a specific template is created (usually a 'case' template), there is a need to auto-create a series of subfolders inside it. The system folders plugin is even more flexible: you can specify an objectId in the system_folders template config. When an object is created, the whole hierarchical structure of objectId is copied inside the newly created object.

The screenshot illustrates that a case (template: CEJIL_case) has system_folders configured. The case highlighted has 3 subfolders that where created automatically when the case has been created.

Note system_folders plugins performs a Copy&Paste operation of the specified objectId, thus it will recreate all the children objects

Copyright (C) KETSE, HURIDOCS