Link
The
Link type creates a field with a link wizard. It is possible to link
to pages, files or even records (if configured). This field is resolved to an
object of type
\TYPO3\.
Settings
| Name | Type | Default | Required |
|---|---|---|---|
| string | '' | ||
| boolean | false | ||
| boolean | true | ||
| boolean | false | ||
| array | '[*]' | ||
| array | |||
| array | |||
| string | |||
| boolean | true | ||
| boolean | |||
| boolean | false | ||
| object | |||
| object | |||
| object | |||
| string | |||
| string | |||
| boolean | false | ||
| integer | 30 | ||
| object |
default
-
- Type
- string
- Default
- ''
Default value set if a new record is created.
required
-
- Type
- boolean
- Default
- false
If set, the field becomes mandatory.
searchable
-
- Type
- boolean
- Default
- true
If set to false, the field will not be considered in backend search.
nullable
-
- Type
- boolean
- Default
- false
If set, the field value will resolve to
nullif no link is provided. Useful, if field is optional.
allowedTypes
-
- Type
- array
- Default
- '[*]'
Allow list of link types. Possible values are
page,url,file,folder,email,telephoneandrecord.
appearance.allowedOptions
-
- Type
- array
Controls which options are displayed in the link browser. Omit to allow all options. Set to an empty array
[]to deny all. Possible values:class,params,target,title,rel,body,cc,bcc,subject.
appearance.allowedFileExtensions
-
- Type
- array
List of file extensions shown in the file browser. If empty, all extensions are allowed.
appearance.browserTitle
-
- Type
- string
Custom title attribute for the link browser icon. Defaults to
Link.
appearance.enableBrowser
-
- Type
- boolean
- Default
- true
Set to
falseto disable the link browser icon.
autocomplete
-
- Type
- boolean
Enables or disables browser autocomplete for the field.
behaviour.allowLanguageSynchronization
-
- Type
- boolean
- Default
- false
Allows to select if localization uses custom or default language value.
fieldControl
-
- Type
- object
See TCA fieldControl.
fieldInformation
-
- Type
- object
See TCA fieldInformation.
fieldWizard
-
- Type
- object
See TCA fieldWizard.
mode
-
- Type
- string
When set to
use, a checkbox appears above the field allowing the user to override the placeholder value.Or Override Placeholder
placeholder
-
- Type
- string
Placeholder text displayed inside the field when it is empty.
readOnly
-
- Type
- boolean
- Default
- false
Renders the field in a way that the user can see the value but cannot edit it.
size
-
- Type
- integer
- Default
- 30
Abstract width of the input field. Minimum
10, maximum50.
valuePicker
-
- Type
- object
Renders a select box next to the field from which predefined values can be inserted. Requires an
itemsarray of objects withlabelandvaluekeys.Example:
valuePicker: items: - label: 'TYPO3 CMS' value: 'https://www.typo3.org' - label: 'TYPO3 GmbH' value: 'https://www.typo3.com'Copied!
Example
Minimal
name: example/link
fields:
- identifier: url
type: Link
Advanced / use case
name: example/link
fields:
- identifier: url
type: Link
autocomplete: true
default: 'https://typo3.org'
allowedTypes:
- page
- url
- file
required: true
valuePicker:
items:
- label: 'TYPO3 CMS'
value: 'https://www.typo3.org'
- label: 'TYPO3 GmbH'
value: 'https://www.typo3.com'
Usage in Fluid
As this field is an object of type
\TYPO3\
you have to check for the property
url to determine whether the field is
set or not.
Note
Alternatively, you can set the field
nullable: true. In this case
the value will resolve to null if not set.
<f:if condition="{data.link_field.url}">
<f:link.typolink parameter="{data.link_field}">Link</f:link.typolink>
</f:if>