Start page / Template development / Rules / Form properties <PROPERTY/>

<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
<IF/>

Value determination
<WITH/>

Handling
instruction
<DO/>

Validation
<VALIDATION/>

Input component
<PROPERTY source='name'.../>

ADD
CONTAINERTYPE
DEFAULT
EDIT
EDITABLE
EMPTY
ENTRY
FOCUS
LABEL
LENGTH
NEW
QUERY.*
REMOVE
SECTION
SIZE
VALUE
VISIBLE
VALID

ADD
CONTAINERTYPE
DEFAULT
EDIT
EDITABLE
EMPTY
ENTRY
FOCUS
LABEL
LENGTH
NEW
QUERY.*
REMOVE
SECTION
SIZE
VALUE
VISIBLE
VALID

ADD
DESELECT
EDIT
EDITABLE
EMPTY
NEW
REMOVE
SELECT
VALUE
VISIBLE

VALID

Design component
<PROPERTY source='#form.name'.../>

FOCUS (the return value is always FALSE)
LABEL
VISIBLE

FOCUS (the return value is always FALSE)
LABEL
VISIBLE

VISIBLE

 

General form information
<PROPERTY source='#global'.../>

BODY
ELEMENTTYPE
GID
ID
INCLUDED
LANG
MASTER
PRESET
STORETYPE
TEMPLATE
TRANSLATED
UID
WEB

BODY
ELEMENTTYPE
GID
ID
INCLUDED
LANG
MASTER
PRESET
STORETYPE
TEMPLATE
TRANSLATED
UID
WEB

  
     

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

ADD

Deactivating option “Add” icon_add_green

<PROPERTY ... name="ADD"/>

BODY

Returns the content area in which the form has been opened (only for section templates).

<PROPERTY ... name="BODY"/>

DEFAULT

Checks whether an input component was preassigned a default value.

<PROPERTY ... name="DEFAULT"/>

DESELECT

Manipulates the selection of

<PROPERTY ... name="DESELECT"/>

EDIT

Deactivating option “Edit” icon_edit_green

<PROPERTY ... name="EDIT"/>

EDITABLE

Defines editability (only for input components)

<PROPERTY ... name="EDITABLE"/>

ELEMENTTYPE

Returns the node type (only input components).

<PROPERTY ... name="ELEMENTTYPE"/>

EMPTY

Returns a Boolean value (the input components does (true) or does not (false) contain a empty value) or
sets a blank value.

<PROPERTY ... name="EMPTY"/>

ENTRY

Returns the textual version of a selected value from a selection list.

<PROPERTY ... name="ENTRY"/>

FOCUS

Returns a Boolean value: The input component does (true) or does not (false) have the focus.

<PROPERTY ... name="FOCUS"/>

GID

Returns the GID (global ID) of the current FirstSpirit element

<PROPERTY ... name="GID"/>

ID

Returns the ID of the current FirstSpirit element

<PROPERTY ... name="ID"/>

INCLUDED

Checks whether the setting “include this section in the output” is activated

<PROPERTY ... name="INCLUDED"/>

LABEL

Evaluating user interface labeling of an input or design component

<PROPERTY ... name="LABEL"/>

LANG

Returns the project language in which the form is being edited.

<PROPERTY ... name="LANG"/>

LENGTH

Returns the length of an entry in an input component.

<PROPERTY ... name="LENGTH"/>

MASTER

Returns the master language of the project.

<PROPERTY ... name="MASTER"/>

NEW

Deactivating option “New” icon_new_green

<PROPERTY ... name="NEW"/>

PRESET

Checks if the user is currently editing in the dialog “Edit form defaults”

<PROPERTY name="PRESET" source="#global"/>

REMOVE

Deactivating option “Delete” / “Remove” icon_remove_green

<PROPERTY ... name="REMOVE"/>

SECTION

Checks if a section has been selected in FS_REFERENCE

<PROPERTY ... name="SECTION"/>:

SELECT

Manipulates the selection of

<PROPERTY ... name="SELECT"/>

SIZE

Returns the number of elements from input components of the type

<PROPERTY ... name="SIZE"/>

STORETYPE

Returns the store type in which the form is opened.

<PROPERTY ... name="STORETYPE"/>

TEMPLATE

Returns the template of the current FirstSpirit element

<PROPERTY ... name="TEMPLATE"/>

TRANSLATED

Checks whether the setting “Page is completely translated to this language” is activated.

<PROPERTY ... name="TRANSLATED"/>

UID

Returns the UID / reference name of the current FirstSpirit element
(exception: for sections, the display name is returned)

<PROPERTY ... name="UID"/>

VALID

Defines validity (only input components)

<PROPERTY ... name="VALID"/>

VALUE

Returns the value of an input component
or sets a value.

<PROPERTY ... name="VALUE"/>

VISIBLE

Defines visibility (for input components and design components)

<PROPERTY ... name="VISIBLE"/>

WEB

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:

Rules negation of boolean values

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>

© 2005 - 2024 Crownpeak Technology GmbH | All rights reserved. | FirstSpirit 2024.10 | Data privacy