Issue Feature Closed

#107081Add options to predefine link target and class in LinkBrowser

Michael Staatz 07/13/25, 03:23 updated 12/02/25, 13:57

Description

*Problem*
Currently, editors must manually select link attributes like target (_blank, _self) and CSS classes for each link they create in the LinkBrowser. This becomes repetitive and time-consuming, especially when following consistent linking policies (e.g., always opening external links in new tabs or applying specific styling classes).

*Proposed Solution*
Add the ability to preconfigure default link target and class attributes via TSconfig. The configuration supports both global defaults (applying to all link types) and handler-specific overrides for fine-grained control.

Configuration Example

# Global defaults for all link types
TCEMAIN.linkHandler.properties.target.default = _self
TCEMAIN.linkHandler.properties.class.default = default-link

# Handler-specific overrides
TCEMAIN.linkHandler.url.target.default = _blank
TCEMAIN.linkHandler.url.class.default = external-link
TCEMAIN.linkHandler.file.class.default = file-download
Benefits
  • Improved editor workflow and user experience
  • Reduced repetitive tasks for editors
  • Consistent link behavior and styling across the site
  • Hierarchical configuration: global defaults with specific overrides
  • Maintains flexibility for manual override when needed
  • Follows TYPO3’s configuration patterns
Affected Components
  • LinkBrowser functionality
  • TSconfig processing
  • Link handlers: page, file, url
  • Link attribute handling (target, class)

*Implementation Notes*
This feature extends the existing link handler configuration structure with a hierarchical approach where properties.* serves as global fallback and handler-specific settings provide overrides.

I would add an Patch for this.

Reviews 1

History 59

  1. Garvin Hicking commented <span data-processor="relativetime" data-value="2025-07-13T09:55:54+00:00" > 07/13/25, 09:55 </span>

    Never mind, I misread that this affects the “regular” LinkBrowser, not the RTE one. Nice to bring parity to configuring this via Page TSConfig! :)

  2. Michael Staatz changed subject Add an option to predefine link target in LinkBrowser Add options to predefine link target and class in LinkBrowser description <span data-processor="relativetime" data-value="2025-07-13T14:47:28+00:00" > 07/13/25, 14:47 </span>

  3. Michael Staatz commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2025-09-18T21:10:08+00:00" > 09/18/25, 21:10 </span>

    Applied in changeset commit:59d9da236370abb75caed959b439b81d39afaa99.