Output of links
Output of a link template
In order for the editorial contents of input components to be visible in the respective output channel the output must be defined within the templates. The same applies to the input components for entering and maintaining links. The contents entered by the editor in the relevant fields of the screen form are output via the link templates.
If a link template is selected in the tree view an edit window appears in the right-hand part of the window with one or several tabs for each available output channel.
For each output channel of the link template the template developer must define the corresponding Instructions .
The field contents are output either via the instruction $CMS_VALUE(...)$ or via the instruction $CMS_REF(...)$ , depending on which input component is involved.
For text fields and selection lists (e.g. for the "comment", "text" and "language" fields):
$CMS_VALUE(#link.Feldname)$
applies and for the resolution of References (e.g. for the fields "ref", "sitestoreref" and "mediaref"):
$CMS_REF(#link.Feldname)$ applies.
The corresponding remote attributes must be given for the resolution of references which originate from a remote project:
$CMS_REF(#link.Feldname, remote:#link.Feldname_remote)$
System object #link
Instead of a variable the link object #link is used when working with links. The values or contents of the input fields can be invoked using the following syntax (Bean syntax):
#link.Feldname
i.e. for example:
#link.mediaref
When resolving the links (for the generation of a page) the parameters are linked and output with the corresponding getter methods (e.g. #link.getMediaref()).
Which fields or field names are available depends on the link type selected.
All field names are explained in detail in the following chapters:
- for internal links: List of all "name" attributes for links within the project.
- for external links: List of all "name" attributes for links outside the project.
- for content links: List of all "name" attributes for links to a data record of a data source (content).
Analogous to this the JAVA syntax can also be used (cf. Chap. FirstSpiritâ„¢ API), i.e. for example:
#link.getMediaref()