<PROPERTY/> Defining properties for a form element
The <PROPERTY/> tag can be used in all areas of a rule definition. Depending what context it is used in, it serves to either determine a value or a different property of a form (element), for example:
- “Get the value of input component A.”
- “Does input component A have the focus?”
- “Was the form opened in the Page Store?”
It is also used to carry out an action for a specific form (element), for example:
- “Check whether the determined value matches the default value.”
- “Write the determined value in input component B.”
- “Display input component B in the form.”
Two attributes have to be specified in a <PROPERTY/> tag:
- a form element is specified using the “source” attribute
- a property is specified using the “name” attribute
Example: “Visibility of the input component 'st_text' in the form”:
<PROPERTY source='st_text' name='VISIBLE'/>
"Source" attribute
A single component or the entire form can be referenced using the “source” attribute.
The following specifications are possible:
- Access to an input component <PROPERTY source='gadget' .../>
The name of an input component is specified.
This input enables access to certain properties of input components, such as the value saved in the input component. - Access to a design component <PROPERTY source='#form.gadget'.../>
The system object #form and the name of the design component are specified in dot notation.
This information enables access to a design component. This is a form element does not take on any value, instead it is used to group form elements (CMS_GROUP) or to display notice text (CMS_LABEL). - Access to a form's general information <PROPERTY source='#global'.../>
The system object #globalis specified.
This information enables access to the form's general information, such as the store type or the language setting in which the form is called.
"Name" attribute
The name of a property is passed using the “name” attribute. The following table specifies which property can be used in which context:
Precondition | Value determination | Handling | Validation | |
---|---|---|---|---|
Input component | ADD | ADD | ||
Design component | ||||
General form information | BODY | BODY | ||
Custom input components (added using FirstSpirit Modules) may specify additional properties. Availability of these properties in different rule contexts may vary; for more information, please see documentation of the module which provides the input component.
The following properties are possible:
Property | Description | Example |
---|---|---|
Deactivating option “Add”
| <PROPERTY ... name="ADD"/> | |
Returns the content area in which the form has been opened (only for section templates). | <PROPERTY ... name="BODY"/> | |
Checks whether an input component was preassigned a default value. | <PROPERTY ... name="DEFAULT"/> | |
Manipulates the selection of
| <PROPERTY ... name="DESELECT"/> | |
Deactivating option “Edit”
| <PROPERTY ... name="EDIT"/> | |
Defines editability (only for input components) | <PROPERTY ... name="EDITABLE"/> | |
Returns the node type (only input components). | <PROPERTY ... name="ELEMENTTYPE"/> | |
Returns a Boolean value (the input components does (true) or does not (false) contain a empty value) or | <PROPERTY ... name="EMPTY"/> | |
Returns the textual version of a selected value from a selection list. | <PROPERTY ... name="ENTRY"/> | |
Returns a Boolean value: The input component does (true) or does not (false) have the focus. | <PROPERTY ... name="FOCUS"/> | |
Returns the GID (global ID) of the current FirstSpirit element | <PROPERTY ... name="GID"/> | |
Returns the ID of the current FirstSpirit element | <PROPERTY ... name="ID"/> | |
Checks whether the setting “include this section in the output” is activated | <PROPERTY ... name="INCLUDED"/> | |
Evaluating user interface labeling of an input or design component | <PROPERTY ... name="LABEL"/> | |
Returns the project language in which the form is being edited. | <PROPERTY ... name="LANG"/> | |
Returns the length of an entry in an input component. | <PROPERTY ... name="LENGTH"/> | |
Returns the master language of the project. | <PROPERTY ... name="MASTER"/> | |
Deactivating option “New”
| <PROPERTY ... name="NEW"/> | |
Checks if the user is currently editing in the dialog “Edit form defaults” | <PROPERTY name="PRESET" source="#global"/> | |
Deactivating option “Delete” / “Remove”
| <PROPERTY ... name="REMOVE"/> | |
Checks if a section has been selected in FS_REFERENCE | <PROPERTY ... name="SECTION"/>: | |
Manipulates the selection of
| <PROPERTY ... name="SELECT"/> | |
Returns the number of elements from input components of the type
| <PROPERTY ... name="SIZE"/> | |
Returns the store type in which the form is opened. | <PROPERTY ... name="STORETYPE"/> | |
Returns the template of the current FirstSpirit element | <PROPERTY ... name="TEMPLATE"/> | |
Checks whether the setting “Page is completely translated to this language” is activated. | <PROPERTY ... name="TRANSLATED"/> | |
Returns the UID / reference name of the current FirstSpirit element | <PROPERTY ... name="UID"/> | |
Defines validity (only input components) | <PROPERTY ... name="VALID"/> | |
Returns the value of an input component | <PROPERTY ... name="VALUE"/> | |
Defines visibility (for input components and design components) | <PROPERTY ... name="VISIBLE"/> | |
Returns a Boolean value: The form is opened in FirstSpirit ContentCreator (true) or not (false). | <PROPERTY ... name="WEB"/> | |
Negation
If the result of the value determination is a Boolean value, a negation for <PROPERTY/> can be achieved using the <NOT/> tag.
Example:
In this example, the template contains three text fields:
- text field 1: “st_text_1”
- text field 2: “st_text_2”
- text field 3: “st_text_3”
Text field 1 is always displayed, text field 2 is displayed if text field 1 is empty, and text field 3 is displayed if text field 1 is not empty.
<RULES>
<RULE>
<WITH>
<PROPERTY name="EMPTY" source="st_text_1"/>
</WITH>
<DO>
<PROPERTY name="VISIBLE" source="st_text_2"/>
<NOT>
<PROPERTY name="VISIBLE" source="st_text_3"/>
</NOT>
</DO>
</RULE>
<RULES>