Start page
Start page

Start page / Template development / Forms / Data elements / CONTENT

CMS_INCLUDE_CONTENTAvailable from FirstSpirit Version 4.0Available up to FirstSpirit Version 5.0

Contents
for example

In the Content Store it is possible to fill input components, which can display a quantity or set of values, e.g. CMS_INPUT_CHECKBOX and CMS_INPUT_COMBOBOX, with the help of an external table.

This is done with the tag: CMS_INCLUDE_CONTENT.

This tag has two mandatory parameters type and table and an optional parameter key.

The type parameter is used to define the type of data to be inserted. When filling with an external table the value is ENTRIES.

The table from which the data is to be obtained is defined with the table parameter. The table parameter expects the reference name of the table template as the value.

<CMS_INCLUDE_CONTENT type="ENTRIES" table="MySchema.MyTable">
<LABEL lang="*">#row.city + ", " + #row.country</LABEL>
<LABEL lang="DE">#row.city_DE + ", " + #row.country_DE</LABEL>
<LABEL lang="EN">#row.city_EN + ", " + #row.country_EN</LABEL>
</CMS_INCLUDE_CONTENT>

There is an additional optional parameter key

This parameter can be used to indicate the column that should be used to save the value.

If this attribute is omitted the primary key is used (default).

Important This parameter should only be used if the users themselves can guarantee the uniqueness of the data when maintaining the column given for key!

Within the CMS_INCLUDE_CONTENT tag the LABEL tag can be used to define language-dependent labelling of the individual values.

The wildcard #row is available within the tag. #row represents the database row to be currently displayed. It is therefore possible to give a database row for the labelling separated by a full stop, as e.g. in the example #row.city_EN.

Further, the expression mechanism is used to automatically set language-specific extensions should they be available, i.e. the following definition is possible:

<CMS_INCLUDE_CONTENT type="ENTRIES" table="MySchema.MyTable">
<LABEL lang="*">#row.city + ", " + #row.country</LABEL>
</CMS_INCLUDE_CONTENT>

Depending on the language to be generated, attributes with a language extension is looked for first for the individual attributes (e.g.#row.city_DE for the language DE), and, if this is not available, then the search is for an attribute with the given name.

Important CMS_INCLUDE_OPTIONS enhances the scope of CMS_INCLUDE_CONTENT and will replace it in FirstSpirit Version 5.0. You can find a comparison between the use of CMS_INCLUDE_CONTENT and CMS_INCLUDE_OPTIONS in the example section of CMS_INCLUDE_OPTIONS.

table
TableTemplateReference
Mandatory
type
Type
Mandatory
key
String
Optional parameter
lang
String
Mandatory

Parameter

The CMS_INCLUDE_CONTENT tag is a container with which configurations can be specified to automatically insert entries from the content store in an input component.

ParameterMandatorySinceTypeDefault value
table*Yes4.0TableTemplateReferenceNone
type*Yes4.0TypeNone
keyNo4.0StringNone

table

The table parameter is used to give the reference to the table template.

The value given must be the unique identifier of the table template.

The reference is required to specify from which table selections can be made and which input components are to be displayed.

ParameterMandatorySinceTypeDefault value
table*Yes4.0TableTemplateReferenceNone

type

The mandatory parameter type is used to give the type of value or content inclusion.

At present the only type supported is ENTRIES .

This type is used to insert content store data from an external key table as an entry list.

ParameterMandatorySinceTypeDefault value
type*Yes4.0TypeNone

key

As a default, the primary key of a table is used to store the selected value in an input component.

However, if this is not wanted the key parameter of another column in the table (in the schemata) can be given, which is to be used for storage and visualisation of the selected value.

ParameterMandatorySinceTypeDefault value
keyNo4.0StringNone

LABELAvailable from FirstSpirit Version 4.0

Using the tag LABEL a language-dependent labelling for the individual values can be defined.

For defining the labelling for a language, the abbreviation of the respective project language must be given with the parameter lang:

...
<LABEL lang="DE">...</LABEL>
<LABEL lang="EN">...</LABEL>
...

Return values are specified by using the special language abbreviation * ("for all languages"):

...
<LABEL lang="*">...</LABEL>
...

The Parameter lang is a mandatory parameter.
The labelling text is given within an opening and closing <LABEL> tag (see place holder TEXT).

ParameterMandatorySinceTypeDefault value
lang*Yes4.0StringNone

lang

The lang parameter is used to give the language abbreviation which is entered in the server properties see View document FirstSpirit Manual for Administrators, Chapter "Language templates") to specify for which project languages the definitions are to apply, e.g. DE for German, EN for English, FR for French etc. The following characters can be used as often as required: -, _, 0-9 and A-Z. Lower case letters are transformed automatically into upper case letters after having saved the template. In addition * can be used for fallback values.

ParameterMandatorySinceTypeDefault value
lang*Yes4.0StringNone

TEXTAvailable from FirstSpirit Version 4.0

The labeling text of the values to be selected is defined here.

For details of the configuration options, see the introduction above.

Key

TableTemplateReference

The unique name of a table template, may only contain the characters "A-Z", "a-z", "0-9" and "_", e.g. "fr_st_varName"

String

A random character string

Type

Supported inclusion types

ENTRIESAvailable from FirstSpirit Version 4.0

Insert as entry list

Example

An example of use of "CMS_INCLUDE_CONTENT":

<CMS_INPUT_CHECKBOX gridWidth="2" name="IDENTIFIER" useLanguages="NO">
<CMS_INCLUDE_CONTENT table="TABLE TEMPLATE" type="ENTRIES">
<LABEL lang="*">#row.SPALTE</LABEL>
<LABEL lang="DE">#row.SPALTE_DE</LABEL>
<LABEL lang="EN">#row.SPALTE_EN</LABEL>
</CMS_INCLUDE_CONTENT>
<LANGINFOS>
<LANGINFO lang="*" label="TEXT" description="TEXT"/>
<LANGINFO lang="DE" label="TEXT" description="TEXT"/>
<LANGINFO lang="EN" label="TEXT" description="TEXT"/>
</LANGINFOS>
</CMS_INPUT_CHECKBOX>

© 2005 - 2014 e-Spirit AG | All rights reserved. | Last change: 2011-05-18