CMS_INPUT_CONTENTAREALIST
Contents |
for example |
to the methods: SectionList<Section> |
CMS_INPUT_CONTENTAREALIST
The input component CMS_INPUT_CONTENTAREALIST is used to give the editor the opportunity of integrating any number of section templates. This input component was originally developed for use in database templates, but it can also be used within the Page Store (see Figure).
When using this input component it is imperative to ensure that the sections integrated by editor are selected language-independent. This means that the same number and type of sections always exist in all languages. The content of these sections can however differ from language to language.
Access-API example use case
The exemplary implementation ContentAreaListValueExample shows some simple examples of use for the reading, writing and creating access to the data object (ContentAreaListValue) and its inner data container (SectionList) of the input component by means of the FirstSpirit Access-API.
- Example of use: ContentAreaListValueExample
- Data object: ContentAreaListValue
- Container type: SectionList
The input component CMS_INPUT_CONTENTAREALIST is supported by the WebClient. For restrictions see chapter Restrictions in WebEdit. |
Mandatory
Optional parameter
Optional parameter
Optional parameter
Optional parameter
Optional parameter
Optional parameter
Mandatory
Optional parameter
Optional parameter
Mandatory
Mandatory
Parameter
The following table gives the parameters of the CONTENTAREALIST input component.
name
The attribute "name" is the variable name of an input component with which the the result object of the input component can be used in the templates - with the help of $CMS_VALUE()$ - or the content can be output.
Parameter | Mandatory | Since | Type | Default value |
---|---|---|---|---|
name* | Yes | 3.1 | Designator | None |
allowEmpty
The "allowEmpty" parameter is used to specify whether a value has to be entered for an input value or not.
If allowEmpty="YES" input is not mandatory; however, it is if allowEmpty="NO".
Input components with allowEmpty="NO" are also called mandatory input components.
The default value for allowEmpty is YES.
Parameter | Mandatory | Since | Type | Default value |
---|---|---|---|---|
allowEmpty | No | 3.0 | YesNo | YES |
hFill
An input component is always displayed with a pre-defined width.
However, if the input component is to use the full available display width the parameter hFill must be given with the value YES .
Parameter | Mandatory | Since | Type | Default value |
---|---|---|---|---|
hFill | No | 2.0 | YesNo | NO |
hidden
With the "hidden" parameter an input component can be hidden from the editor.
If hidden="YES" the input component is not visible for the editor, if hidden="NO" it is visible.
The default value for hidden is NO.
Parameter | Mandatory | Since | Type | Default value |
---|---|---|---|---|
hidden | No | 4.0.44 | YesNo | NO |
maxEntries
The parameter "maxEntries" defines how many entries can be selected or added at most. The parameter expects an integer value.
Parameter | Mandatory | Since | Type | Default value |
---|---|---|---|---|
maxEntries | No | 4.0.58 | PositiveInteger | None |
preset
Using the preset attribute the handling of default values in an input component can defined (see also chapter Default values). If preset="default" is set, the retrieval value defined in the form is used. If this value in the form is changed later on, these changes will be affect all usages of this default value in the input components maintained by the editor, as long as a value will be set manually in the input component. This is the default setting. If preset="copy" is set, the value entered by the editor is copied directly into the input component. Subsequent changes to the default value in the form do not have any effect on the usages of this default value in the input components maintained by the editor.
Parameter | Mandatory | Since | Type | Default value |
---|---|---|---|---|
preset | No | 4.0 | Preset | DEFAULT |
rows
The rows parameter is used to define the display height of the input component in rows.
The parameter expects an integer value.
If the input component is used within a group (CMS_GROUP), the height will comply with the height of the highest input component of the group.
Parameter | Mandatory | Since | Type | Default value |
---|---|---|---|---|
rows | No | 3.0 | PositiveInteger | 5 |
LANGINFOS
Using the tag LANGINFOS language-dependent information can be defined for each input component, e.g. which title is to be used for the input component in the different project languages (parameter label), which tooltip is to be displayed (parameter description) etc. For reasons of clarity, definitions which are identical in multiple languages will be merged. For example,
<LANGINFOS>
<LANGINFO lang="*" label="Datum"/>
<LANGINFO lang="DE" label="Datum"/>
<LANGINFO lang="EN" label="Datum"/>
</LANGINFOS>
will be merged to
<LANGINFOS>
<LANGINFO lang="*" label="Datum"/>
</LANGINFOS>
after saving.
Up to and including FirstSpirit version 4.2R2 language definitions will be deleted only in the case if the values are identical in all languages (as in example above). Furthermore, only the parameters lang, description and label are taken into account when merging.
Since FirstSpirit version 4.2R4 all parameters are taken into account (e.g. format and length). Furthermore, language definitions are also merged within LANGINFOS tags, if they are identical in at least two languages. For example,
<LANGINFOS>
<LANGINFO lang="*" label="Date" format="dd.MM.yy"/>
<LANGINFO lang="DE" label="Date" format="dd.MM.yy"/>
<LANGINFO lang="EN" label="Date" format="MM/dd/yy"/>
</LANGINFOS>
will become
<LANGINFOS>
<LANGINFO lang="*" label="Date" format="dd.MM.yy"/>
<LANGINFO lang="EN" label="Date" format="MM/dd/yy"/>
</LANGINFOS>
after saving.
The definition for the fallback value (*) will not be deleted in any case. If there are two or more language definitions with identical values the first one will be maintained, the other will be deleted.
IMPORTANT: Up to and including FirstSpirit version 4.2R2 at least one definition for the fallback labelling ("*") must be given:
<LANGINFOS>
<LANGINFO lang="*" label="TEXT"/>
</LANGINFOS>
From FirstSpirit version 4.2R4 the fallback definition can be omitted. In this case, the language which is defined first will be used automatically as fallback value. For example,
<LANGINFOS>
<LANGINFO lang="EN" label="Date"/>
<LANGINFO lang="DE" label="Datum"/>
</LANGINFOS>
will become
<LANGINFOS>
<LANGINFO lang="*" label="Date"/>
<LANGINFO lang="DE" label="Datum"/>
</LANGINFOS>
after saving.
LANGINFO
The LANGINFO tag is used to give values or attributes for a language as well for use as fallback values.
In order to state values or attributes for a language it is necessary to give the abbreviation of the project language in the lang parameter:
...
<LANGINFO lang="DE".../>
...
Fallback values are given with the special language abbreviation * ("for all languages"):
...
<LANGINFO lang="*".../>
...
The lang parameter is a mandatory parameter.
Parameter | Mandatory | Since | Type | Default value |
---|---|---|---|---|
lang* | Yes | 3.1 | LanguageAbbreviation | None |
description | No | 3.1 | String | None |
label | No | 3.1 | 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 | 3.1 | LanguageAbbreviation | None |
description
The description parameter can be used to give a description which is used to display a tool tip (mouse-over).
Parameter | Mandatory | Since | Type | Default value |
---|---|---|---|---|
description | No | 3.1 | String | None |
label
The label parameter is used to give the surface labelling for input and visualisation components.
Parameter | Mandatory | Since | Type | Default value |
---|---|---|---|---|
label | No | 3.1 | String | None |
SOURCES
The SOURCES tag can be used to limit the selection or display to defined templates (e.g. section templates).
SOURCES is a positive list, i.e. only the given templates are allowed.
To allow a template, a TEMPLATE tag must be specified for each.
TEMPLATE
The TEMPLATE tag is used to specify a template which is to be taken into account.
For each desired template one TEMPLATE tag must be defined.
Parameter | Mandatory | Since | Type | Default value |
---|---|---|---|---|
name* | Yes | 3.0 | ReferenceName | None |
name
A valid name of a template must be given for the parameter name.
Parameter | Mandatory | Since | Type | Default value |
---|---|---|---|---|
name* | Yes | 3.0 | ReferenceName | None |
VARIABLES
Variables from sections can be output in the list of sections using the tag VARIABLES. Thus, the content of the respective section can be visualised clearer in the list. This can be, for example, identifiers from input components of the respective section.
To output a variable from a section in the list one VARIABLE tag must be specified for each.
VARIABLE
Use the tag VARIABLE-Tag to specify an input component which you want to be taken into account.
One VARIABLE tag is defined for each desired template.
Parameter | Mandatory | Since | Type | Default value |
---|---|---|---|---|
name* | Yes | 3.0 | String | None |
name
The name parameter in the VARIABLE tag can be used to give the variable name of an input component of a section whose value is to be displayed in the input component.
Parameter | Mandatory | Since | Type | Default value |
---|---|---|---|---|
name* | Yes | 3.0 | String | None |
Example
An example of the input component "CMS_INPUT_CONTENTAREALIST":
<CMS_INPUT_CONTENTAREALIST rows="25" hFill="YES" name="IDENTIFIER">
<LANGINFOS>
<LANGINFO lang="*" label="TEXT" description="TEXT"/>
<LANGINFO lang="DE" label="TEXT" description="TEXT"/>
<LANGINFO lang="EN" label="TEXT" description="TEXT"/>
</LANGINFOS>
<SOURCES>
<TEMPLATE name="IDENTIFIER"/>
</SOURCES>
</CMS_INPUT_CONTENTAREALIST>
For the output of the CONTENTAREALIST a $CMS_FOR(...)$ instruction can be used which outputs the Section objects contained in the list.
<pre>
$CMS_FOR(section,st_cal)$
Section name in CAL: $CMS_VALUE(section.name)$
$CMS_VALUE(section)$
$CMS_END_FOR$
</pre>
The sections are rendered with their section templates in the output.