Add a template for a key value pair

Created on 2 April 2024, 3 months ago

Problem/Motivation

For the styling of the field values, I cannot address the pair key directly because there's no wrapping element to direct to.

Steps to reproduce

  1. Install module
  2. Add field to any entity type
  3. Fill in the field with one or more values
  4. Display the entity
  5. Inspect code
  6. See that the key is just text, with a colon, while the value has a wrapper.

Proposed resolution

  1. Add the required content in hook_theme()
  2. Update the callback in KeyValueFormatter::viewElement()
  3. Add template so it can be altered in theme

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium blacksnipe

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

Comments & Activities

Production build 0.69.0 2024