Start page / Templates (basics) / Composition of templates / Link templates / Examples / External links

Example: form for external links

External links refer to objects outside of the FirstSpirit project, such as pages on other Internet sites.

The following shows an example of a form and the syntax for the corresponding output for a link that leads to the start page of the company website

Display (SiteArchitect)

Dialog external link




Input component in the following code example


Input of the link target in a valid format (e.g.
(Mandatory field, see Introduction)



Input of a link text.
(Mandatory field, see Introduction)



Input of an optional comment, which can be displayed as a tool tip for the link.



Selection of a target window (Should the link target open in the same window, in a new window, or in a defined window specific to the project?). By default, link targets open in the same window. Links to external websites should ideally open in a new window.





<CMS_INPUT_TEXT name="lt_reference" hFill="yes" singleLine="no" useLanguages="no">
<LANGINFO lang="*" label="Target URL"/>
<LANGINFO lang="DE" label="Zieladresse"/>

<CMS_INPUT_TEXT name="lt_text" hFill="yes" singleLine="no" useLanguages="no">
<LANGINFO lang="*" label="Link text"/>
<LANGINFO lang="DE" label="Verweistext"/>

<CMS_INPUT_TEXT name="lt_comment" hFill="yes" singleLine="no" useLanguages="no">
<LANGINFO lang="*" label="Comment"/>
<LANGINFO lang="DE" label="Kommentar"/>

<CMS_INPUT_COMBOBOX name="lt_target" hFill="yes" singleLine="no" useLanguages="no">
<ENTRY value="_blank">
<LANGINFO lang="*" label="in new window"/>
<LANGINFO lang="DE" label="in neuem Fenster"/>
<ENTRY value="_self">
<LANGINFO lang="*" label="in current window"/>
<LANGINFO lang="DE" label="im aktuellen Fenster"/>
<LANGINFO lang="*" label="Target window"/>
<LANGINFO lang="DE" label="Zielfenster"/>



Important The following shows examples of only the minimum amount of code that is needed for suitable adaptation in a production project. Thus, for instance, a Not Empty check (e.g. $CMS_IF(!lt_reference.isEmpty)$ is not performed. Without this check, however, generation errors could occur in the production project.

Links are generally output in HTML using the following syntax:

<a href="[Linktarget]">[Linktext]</a>

The value of lt_reference is used for the link target in the HTML output via the link template. The value of lt_text is used for the link text:

<a href="$CMS_VALUE(lt_reference)$">$CMS_VALUE(lt_text)$</a>

Dynamic forms are used to check whether the format of the editor's link target input is valid.

Comments from the lt_comment field can be output as a tool tip for the link using the title HTML attribute.

As the final step, the link time window selected by the editor using lt_target can be output and taking into account. The getKey method is used to do this (for more information, see option data type). The determined value is used for the target HTML attribute. This attributes expects _blank (to open the link in a new window) or _self (to open the link in the same window), for instance, as the value. The editor selects values using the relevant combo box in the form.

A simple example of the link output could ultimately look like the following:

<a href="$CMS_VALUE(lt_reference)$"



External link input and output

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