Allow to use placeholders in derivative entity actions

Created on 20 June 2018, almost 7 years ago
Updated 24 February 2023, about 2 years ago

Problem/Motivation

Derivative entity actions label is created by appending the singular label of the entity to the action label.
It would be nice to be able to use a "special" placeholder for improving their UX.

E.g. Creating my action "Upload to Lingotek" I get a label "Upload to Lingotek content item". It would be much nicer if it would be "Upload content item to Lingotek".

Proposed resolution

Add a "magic" @entity_type_label. Then in your action you can do:

/**
 * @Action(
 *   id = "entity:lingotek_upload_action",
 *   action_label = @Translation("Upload @entity_type_label to Lingotek"),
 *   deriver = "Drupal\lingotek\Plugin\Action\Derivative\ContentEntityLingotekActionDeriver",
 * )
 **/

Remaining tasks

Agree on this solution and implement.

User interface changes

None out of the box.

API changes

None.

Data model changes

None

Feature request
Status

Active

Version

10.1

Component
System 

Last updated about 1 hour ago

No maintainer
Created by

🇪🇸Spain penyaskito Seville 💃, Spain 🇪🇸, UTC+2 🇪🇺

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024