Review main Merged

96513[FEATURE] Suggest CSS classes in link browser

Georg Ringer CR +2 V +2 Hard +347 −2 updated 10/09/26, 19:26

Commit message

The CSS class field of the link browser for TCA link fields only
offered a free text input, while the link browser of the RTE offers
a list of configured classes.

The new page TSconfig option cssClass.items defines CSS classes which
are suggested in the class field. It can be set for all link types
or per link handler, next to the existing cssClass.default:

  TCEMAIN.linkHandler.properties.cssClass.items {
    10.value = btn btn-primary
    10.label = Primary button
  }
  TCEMAIN.linkHandler.file.cssClass.items.10.value = link-download

Editors can still enter any other class. Without configuration, the
field stays a plain input.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Oli Bartsch +1
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Benni Mack +2
    • Oli Bartsch +1
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 1

Files 4

Review log 79

  1. Georg Ringer uploaded patch set 1 10/07/26, 21:01

  2. Georg Ringer commented on patch set 1 10/07/26, 21:02

    This change is ready for review.
  3. core-ci voted on patch set 1 V +1 10/07/26, 21:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/110415

  4. Oli Bartsch uploaded patch set 2 V +1 10/07/26, 21:40

  5. core-ci voted on patch set 2 V +1 10/07/26, 21:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/110419

  6. Oli Bartsch commented on patch set 2 CR +1 V +1 10/07/26, 21:53

    Hey, I pushed one fix: handler-specific cssClass.items were resolved in initVariables(), before the displayed handler is known. When an existing link was opened from FormEngine (no act), e.g. an https:// link, the class field showed the page/global list instead of the url list. Resolution now happens in renderLinkAttributeFields(). cssClass.default/target.default have the same timing issue since #107081; I've fixed that separately: https://review.typo3.org/c/Packages/TYPO3.CMS/+/96514
  7. Simon Schaufelberger voted on patch set 2 CR +1 V +1 10/08/26, 00:15

  8. Benni Mack voted on patch set 2 CR +2 V +2 10/09/26, 19:26

  9. Benni Mack merged patch set 3 10/09/26, 19:26