Allow to use placeholders in derivative entity actions

Created on 20 June 2018, almost 6 years ago
Updated 24 February 2023, over 1 year 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 1 day 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.69.0 2024