CMS_INCLUDE_CONTENT
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).
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.
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. |
Mandatory
Mandatory
Optional parameter
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.
Parameter | Mandatory | Since | Type | Default value |
---|---|---|---|---|
table* | Yes | 4.0 | TableTemplateReference | None |
type* | Yes | 4.0 | Type | None |
key | No | 4.0 | String | None |
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.
Parameter | Mandatory | Since | Type | Default value |
---|---|---|---|---|
table* | Yes | 4.0 | TableTemplateReference | None |
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.
Parameter | Mandatory | Since | Type | Default value |
---|---|---|---|---|
type* | Yes | 4.0 | Type | None |
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.
Parameter | Mandatory | Since | Type | Default value |
---|---|---|---|---|
key | No | 4.0 | String | None |
LABEL
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).
Parameter | Mandatory | Since | Type | Default value |
---|---|---|---|---|
lang* | Yes | 4.0 | String | None |
lang
The lang parameter is used to give the language abbreviation which is entered in the server properties see 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.
Parameter | Mandatory | Since | Type | Default value |
---|---|---|---|---|
lang* | Yes | 4.0 | String | None |
TEXT
The labeling text of the values to be selected is defined here.
For details of the configuration options, see the introduction above.
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>