Start page
Start page
Start page

Start page / Template development / Link templates / Configuration

Configuring a link template Available up to FirstSpirit Version 5.0

The editorial maintenance of links is carried out using screen forms which can be project-specifically adjusted by the template developer. As a default, all input fields or selection lists possible for the respective link type are displayed in the screen forms (example: see Internal Link).

The template developer can configure a link template using the system object #link . A large number of methods can be invoked on the object. The methods available depend on the selected link type (for further information see Chapter Output of links ).

<CMS_LINK_CONFIG>

Configuring a link template

The "Configuration" tab can be used to configure the fields of the input mask for each instance of a link template type. The configuration is defined in the edit window within the opening and closing <CMS_LINK_CONFIG> tags and is valid for all link templates of the selected link template type.

The individual fields or selections lists are configured using the definition of parameters. The parameters are defined within the <CMS_LINK_CONFIG> tags via <CMS_PARAM> tags.

<CMS_PARAM>

A range of attributes are available for the configuration within the <CMS_PARAM> tags:

Attribute: name

The "name" attribute is used to specify which field of the screen form is to be configured. Each input element can be configured via a specific name.
For example, if the input element is to be configured for the link text, the "name" attribute must be passed with the value "text" within the <CMS_PARAM> tag:

<CMS_PARAM name="text"  ..../>

The input elements available in the screen form depend on the link type selected. This means specific "name" attributes are only ever available for configuration of the instances of the individual link types, which are explained in the following chapters for each of the three standard link types:

Attribute: label

If, in addition to the "name" attribute the "label" attribute is also given within the <CMS_PARAM> tag, the parameter is used to configure the language-independent labelling of the input element in the screen form. The configuration:

<CMS_PARAM name="text" label="Verweistext:"/> 

changes, for example, the labelling of the input component with the name "text" from the default value "Link text" to "Verweistext".

Attribute: value

If, in addition to the "name" attribute the "value" attribute is also given within the <CMS_PARAM> tag, the input component is pre-filled with the given default value.

Important The given value is possibly not displayed in the component until combined with the "default" attribute (see description of the "default" attribute).

A default value is useful for example for a selection list. The list can be pre-filled by the template developer with one or several possible values, whereby a separate <CMS_PARAM> tag must be given in the configuration for each value. For example, the configuration for the "target" selection list for selecting a target frame:

<CMS_PARAM name="target" value="popup"/>
<CMS_PARAM name="target" value="new"/>

displays the two values "popup" and "new" for selection. If, in addition, the labelling of the values is to be changed, this can be done by also giving the "label" attribute:

    <CMS_PARAM name="target" label="Pop-Up-Fenster" value="popup"/>
<CMS_PARAM name="target" label="New Window" value="new"/>

Attribute: hidden

If, in addition to the "name" attribute the "hidden" attribute is also given within the <CMS_PARAM> tag, the corresponding input field is "hidden" from the editor. The field is no longer displayed in the screen form and cannot be edited by the editor.

Important If a default value was not previously preassigned for the field by means of "value" and "default" it remains empty (null).

It always makes sense to use hidden if the template developer wants to prevent the editor from changing the values. For example, the following configuration is used to ensure the input component "mediaref" is no longer displayed for selection of an element from the Media Store:

<CMS_PARAM name="mediaref" hidden="1"/> 

Attribute: default

If, in addition to the "name" and "value" attributes the "default" attribute is also given within the <CMS_PARAM> tag, the value given under "value" is displayed as a preselected value in the component. The value can be given the values "0" (no preselection) or "1" (preselection) and can be given both for simple text input fields (e.g. "text") as well as for selection lists (e.g. "target"). If text inptu fields are to be preassigned with a default value, in addition to the "value" the "default" attribute must also be given in the configuration with the value "1". In all other input fields (e.g. "target") an entry is generated in the selection list for each configured parameter:

<CMS_PARAM name="target" label="Pop-Up-Fenster" value="popup"/>
<CMS_PARAM name="target" label="New Window" value="new"/>

If default="1" is not given the input field remains empty but can be filled by selecting an entry.

The configuration:

<CMS_PARAM name="target" label="Pop-Up-Fenster" value="popup"/>
<CMS_PARAM name="target" label="Neues Fenster" value="new" default="1"/>

is used to display the preselected "New Window" (Neues Fenster) value in the selection list. The field only has to be edited by the editor if a value other than the default value is to be selected.

Configuration options

How the individual attributes can be usefully combined depends on the type of input component. The screen forms for the different link types recognise three groups of input elements:

  • simple text fields (e.g. "text", "comment")
  • selection lists (e.g. "target", "language")
  • fields for selecting a reference (e.g. sitestoreref, ref, mediaref)

Attribute selection for text fields:

<CMS_PARAM name="text" label="neue Beschriftung"/>
<CMS_PARAM name="text" hidden="1"/>
<CMS_PARAM name="text" value="mein Verweis" default="1"/>

Attribute selection for selection lists:

<CMS_PARAM name="target" hidden="1"/>
<CMS_PARAM name="target" label="Pop-Up-Fenster" value="popup"/>
<CMS_PARAM name="target" label="Neues Fenster" value="new" default="1"/>

Attribute selection for input element for reference selection:

<CMS_PARAM name="sitestoreref" label="neue Beschriftung"/>
<CMS_PARAM name="sitestoreref" hidden="1"/>
<CMS_PARAM name="sitestoreref" value="showmediastore"/>
<CMS_PARAM name="sitestoreref" value="ref:eineSeitenreferenz" default="1"/>

© 2005 - 2012 e-Spirit AG | All rights reserved. | Last change: 15.12.2010