Add attributes on the formatter level

Created on 12 November 2024, about 1 month ago

Problem/Motivation

Link Attributes adds attributes on the field widget level, so each link in an entity can have additional attributes, classes, etc. That's super helpful!

But additionally, there's also often the need to set attributes (starting with simple classes) on the formatter level! So they will be same for the link field display and won't change per entity. These attributes can not be changed in entities, as they are set when rendering the field.

Link attributes already has a lot of related functionality and core is missing this feature, so that currently you have to override the link in theme or twig, which is okay, but not what you want from Drupal in many cases.

So we'd like to help implementing this (maybe in a submodule)? link_attributes_formatter?

https://www.drupal.org/project/link_class β†’ does similar things, but seems not very well maintainted and might conflict with link_attributes. Would be much nicer to have all this in link_attributes with known UX. And even by name it fits into "Link Attributes" :)

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024