Skip to main content
Version: 2023.1

Link Editable

General

The link editable is used for dynamic link creation in documents.

Configuration

You can pass nearly every valid attribute an <a>-tag can have (w3.org - Link), such as: class, target, id, style, accesskey, name, title, data-*, aria-* and additionally the following:

NameTypeDescription
reloadbooleanSet to true to reload the page in editmode after changing the state.
textPrefixstringAdd an icon or something else before Text.
textSuffixstringAdd an icon or something else after Text.
noTextbooleanIf you need only the <a> tag without text (or only with an textSuffix/textPrefix).
requiredboolean/string(default: false) set to true to make link and text required for publish, set to linkonly to make only the link required for publish.
allowedTypesarrayYou can limit the available types for this editable by passing the allowed types explicitly. If this option is not used, all types are available. Valid types are: asset, document, object
allowedTargetsarrayYou can limit the available targets for this editable by passing the allowed targets explicitly. If this option is not used, all targets are available. Valid targets are: (empty string), _blank, _self, _top, _parent
disabledFieldsarrayYou can limit the available fields for this editable by passing the allowed fields explicitly. If this option is not used, all fields are available. Valid Fields are: text, target, parameters, anchor, title, accesskey, rel, tabindex, class, attributes

For security reasons we created an For security reasons we created an allow list to filter harmfull html attributes. For example all on* attributes will be filtered out!

Methods

NameReturnDescription
getHref()stringGet the path of this link
getText()stringGet the text of the link
getTarget()stringGet the target of the link
getParameters()stringGet the query params of the link
getAnchor()stringGet the anchor text of the link
getTitle()stringGet the title of the link
getRel()stringGet the rel text of the link
getTabindex()stringGet the tabindex of the link
getClass()stringGet the class of the link
getAccessKey()stringGet the access key of the link
isEmpty()stringWhether the editable is empty or not

Examples

Basic Usage

<p>
{{ "Visit our" | trans }}
{{ pimcore_link('blogLink') }}
</p>

You could see the backend preview in the picture, below.

Link editable - adminitration panelLink editable - adminitration panelLink editable - adminitration panel

And the frontend:

Link editable - frontendLink editable - frontendLink editable - frontend

Let's see how to make a list of links with Block.

<h3>{{ "Useful links" | trans }}</h3>
<ul>
{% for i in pimcore_block('linkblock').iterator %}
<li>{{ pimcore_link('myLink', {'class': "special-link-class"}) }}</li>
{% endfor %}
</ul>

The above example renders a list of links: The links list in the backendThe links list in the backendThe links list in the backend

Please also see the section about Link Generators