TYPO3 Logo
TYPO3 Content Blocks
Options
Give feedback View source How to edit Edit on GitHub Full documentation (single file)

TYPO3 Content Blocks

  • Introduction
  • Installation
  • Definition
    • config.yaml
    • assets
    • templates
    • language
  • Registration
  • Commands
    • Kickstart command
    • List command
    • Language Generate command
  • YAML reference
    • Common root options
    • ContentElements
    • PageTypes
    • RecordTypes
    • FileTypes
    • Field Types
      • Basic
      • Category
      • Checkbox
      • Collection
      • Color
      • DateTime
      • Email
      • File
      • FlexForm
        • Sheet
        • Section
      • Folder
      • Json
      • Language
      • Linebreak
      • Link
      • Number
      • Palette
      • Pass
      • Password
      • Radio
      • Relation
      • Select
      • SelectNumber
      • Slug
      • Tab
      • Text
      • Textarea
      • Uuid
  • Templating
  • API
    • Language Key Convention
    • Backend Preview
    • Basics (Mixins)
    • Content Elements
    • File Types
    • Nested Content Elements
    • Page Types
    • Field Prefixing
    • Record Types
    • Reuse Existing Fields
    • Type Overrides
  • Guides
    • Adding new groups
    • Extend TCA
    • Extend TypoScript
    • Fluid Styled Content Layouts
    • Installation without Fluid Styled Content
    • Page Types frontend template
    • Shared Partials
  • Developer corner
    • Data Processing
    • Extending Field Types
  • Changelog
    • 1.0
    • 1.1
    • 1.2
  • Migrations
    • Content Blocks for v12
    • Mask
  • FAQ
  • Known Problems
  • Appendix
    • Core Content Types
    • TCA type mapping
    • History
  • Sitemap
  1. TYPO3 Content Blocks
  2. YAML reference
  3. Field Types
  4. Link
Give feedback Edit on GitHub

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\CMS\Core\LinkHandling\TypolinkParameter .

Settings

Name Type Default Required
default
string ''
required
boolean false
nullable
boolean false
allowedTypes
array '[*]'

default

default
Type
string
Default
''

Default value set if a new record is created.

required

required
Type
boolean
Default
false

If set, the field becomes mandatory.

nullable

nullable
Type
boolean
Default
false

If set, the field value will resolve to null if no link is provided. Useful, if field is optional.

allowedTypes

allowedTypes
Type
array
Default
'[*]'

Allow list of link types. Possible values are page, url, file, folder, email, telephone and record.

Example

Minimal

name: example/link
fields:
  - identifier: url
    type: Link
Copied!

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:
        - [ 'TYPO3 CMS', 'https://www.typo3.org' ]
        - [ 'TYPO3 GmbH', 'https://www.typo3.com' ]
Copied!

Usage in Fluid

As this field is an object of type \TYPO3\CMS\Core\LinkHandling\TypolinkParameter 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>
Copied!
  • Previous
  • Next
Reference to the headline

Copy and freely share the link

This link target has no permanent anchor assigned. You can make a pull request on GitHub to suggest an anchor. The link below can be used, but is prone to change if the page gets moved.

Copy this link into your TYPO3 manual.

  • Home
  • Contact
  • Issues
  • Repository

Last rendered: May 09, 2025 18:18

© since 2023 by TYPO3 contributors
  • Legal Notice
  • Privacy Policy