Link¶
Description¶
The link content type allows to select different type of links, including links to internal entities like
pages and external URLs.
The content type can be limited to allow only specific link types and configured to show an anchor
and
a target
field.
The link content type can be extended with additional link types by implementing a custom LinkProvider service.
Parameters¶
Parameter |
Type |
Description |
---|---|---|
enable_target |
bool |
Enables the |
enable_anchor |
bool |
Enables the |
enable_title |
bool |
Enables the |
types |
collection |
List of available types in the dropdown. Default: All registered link types |
Example¶
<property name="link" type="link">
<meta>
<title lang="en">Link</title>
<title lang="de">Link</title>
</meta>
</property>
Twig¶
<a href="{{ content.link }}">Click me</a>
Complex Example¶
<property name="link" type="link">
<meta>
<title lang="en">Link</title>
<title lang="de">Link</title>
</meta>
<params>
<param name="enable_target" value="true"/>
<param name="enable_anchor" value="true"/>
<param name="enable_title" value="true"/>
<param name="types" type="collection">
<param name="page"/>
<param name="external"/>
<param name="media"/>
</param>
</params>
</property>
Complex Twig¶
<a href="{{ content.link }}" target="{{ view.link.target }}">
{{ view.link.title }}
</a>