Open Source Content Management System

Using midcom.helper.datamanager schemas

  1. Set schema for one topic
  2. Set a site-wide schema for component

MidCOM provides the Datamanager system for customizing content fields in the authoring interface. All content editors in datamanager are defined by schema documents.

Once you have created your own schema, there are two ways to configure a component to utilize it:

Set schema for one topic

Most components support defining a schema in the Component configuration interface of a topic. To use your own schema there, place it in a snippet and write the path to the schema definition field.

Set a site-wide schema for component

In addition to per-topic schema definitions, components can also be configured to use same schema everywhere in the sitegroup.

What schema to use is defined in the snippet /sitegroup-config/<componentname>/config.

Here's an example of this file taken from taviewer :

"schemadb"       => "/sitegroup-config/de.linkm.taviewer/schema",  
"schemadbs"      => Array (  
 "/sitegroup-config/de.linkm.taviewer/schema" => "Our schemadb",  
),  
"default_schema" => "default",  
"visible"        => TRUE,  
"only_approved"  => TRUE,  
"autoindex"      => 0,

This file is formatted as a PHP Array and is evaluated by MidCOM. So be careful when you edit it as it is easy to make mistakes. If there are any errors in the file, this will show up your MidCOM debug log.

As you see in this file, a custom schema defined in another snippet is used. Let's take a look at the schema.

Designed by Nemein, hosted by Anykey