Base field label (title) exposed and commented to print in twig template

Created on 21 October 2024, 6 months ago

The label of an ECK entity with enabled title base field is not documented in code comment block and is not exposed (at least from what I tried) to get printed in the eck-entity.html.twig file in a way how it is common to Drupal content entities and nodes.

In node.html.twig the label is documented in the comment block and printable like expected by using the label tag. Same goes for custom entities created by drush generate content:entity. In the latter the comment block mentions content.label and this is exactly the way to print the label in the respective twig file.

Proposed solution
Assuming that many use cases of ECK entities will use the title base field, make title base field available to print in eck-entity.html.twig and add the correct tag to be used in the comment block.

Assuming that ECK needs to deal with many possibly scenarios including entities without a label base field, it needs a twig logic to check against if label exist before printing it.

🌱 Plan
Status

Active

Version

2.0

Component

Code

Created by

🇫🇷France dqd London | N.Y.C | Paris | Hamburg | Berlin

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