The contextual menu when you right click on an entity embed reads "Edit Entity" and uses the generic icon. It would be more appropriate if this can be specific to the embed button.

Comments

oknate created an issue. See original summary.

oknate’s picture

This patch creates a separate contextual menu item for each embed, so that the label, instead of being "Edit Entity" is the label of the embed "Edit Gallery" for example.

more specific contextual link

oknate’s picture

Issue summary: View changes
oknate’s picture

Issue summary: View changes
oknate’s picture

Status: Active » Needs review
oknate’s picture

I was able to fix one of the failing tests here: https://www.drupal.org/project/entity_embed/issues/2993391

wim leers’s picture

Title: Contextual Menu Item should be more specific. » CKEditor Contextual Menu Item should be more specific
Status: Needs review » Needs work
Issue tags: +Usability, +JavaScript

This seems like a nice UX improvement 👍

  1. +++ b/js/plugins/drupalentity/plugin.js
    @@ -144,19 +144,27 @@
    -          icon: this.path + 'entity.png',
    ...
    +            icon: button.image,
    

    Nice!

  2. +++ b/js/plugins/drupalentity/plugin.js
    @@ -144,19 +144,27 @@
    +          editor.addMenuGroup('drupalentity');
    

    This can be moved out of the loop.

  3. +++ b/js/plugins/drupalentity/plugin.js
    @@ -144,19 +144,27 @@
    +            label: Drupal.t('Edit ') + button.label,
    

    But this is not correct use of the translation system — this will only work in certain languages :)

oknate’s picture

StatusFileSize
new1.5 KB

Thanks for the feedback. I have updated the patch based on it.

oknate’s picture

Status: Needs work » Needs review
wim leers’s picture

Status: Needs review » Reviewed & tested by the community

Manually tested, works great!

Thanks, @oknate! 👌

  • Wim Leers committed ce1c823 on 8.x-1.x authored by oknate
    Issue #2993323 by oknate: CKEditor Contextual Menu Item should be more...
wim leers’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.