Allow <drupal-entity> elements to be inline CKEditor Widgets

Created on 24 December 2015, over 8 years ago
Updated 11 June 2024, 17 days ago

Original description by @phenaproxima:

I have a use case where it would be helpful for drupal-entity elements to be displayed inline. For instance, I may need to embed a tweet (from Media Entity Twitter) into a paragraph, floated to the left; or a video (through Media Entity Embeddable Video), floated to the right. Or perhaps an image (via Media Entity Image), inline with some text.

Right now the CKEditor DTD will not allow that, so this PR alters the DTD to allow drupal-entity elements as children of elements which can contain img elements.

Feature request
Status

Needs review

Version

1.0

Component

CKEditor integration

Created by

🇸🇮Slovenia slashrsm

Live updates comments and jobs are added and updated live.
  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

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.

  • 🇺🇸United States pbone3b New York, NY

    This is patch is #117 with a small change for D10

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update 11 months ago
    CI aborted
  • 🇺🇸United States pbone3b New York, NY

    This is a copy of #117 with a small change for D10

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 8
    last update 11 months ago
    29 pass, 14 fail
  • 🇺🇸United States cameron prince

    Hello,

    I've been trying to use this patch for some time and haven't really had any luck, so far. My goal is to place images inline with text. These are things like complex formulas or diagrams.

    Here are the steps I've taken:
    1) Added the latest patch from this issue
    2) Created an "Inline" view mode on the image media type
    3) Created an "Inline" image style
    4) Created a new embed button with "Entity Inline" selected as the type
    5) Selected the "Inline" view mode for the "Allowed Entity Embed Display plugins" setting of the button
    6) Added the new button to the toolbar
    7) Enabled the "Inline" view mode for the image media type
    8) Set the "Inline" view mode to display the image using the "Inline" image style
    9) Cleared cache

    The issues I'm seeing are:
    1) When embedding an image, the "Align" selector (None, Center, Left, Right) is still available, which doesn't make sense for an inline image.
    2) After embedding an image, the "Source" button no longer works
    3) The editor window does now show the image after embedding (which it wasn't doing on the previous patch), but when I save the node, the body is emptied.

    I'd like to get this working and glad to help any way I can.

  • 🇺🇸United States pbone3b New York, NY

    Any movement on a CKEditor 5 Plugin for drupalentityinline?
    The patches here (2640398) create the drupalentityinline plugin for CKE4.
    Thank You! :-)

    https://www.drupal.org/project/entity_embed/issues/3272732 Drupal 10 & CKEditor 5 readiness Fixed creates the CKE5 version of drupalentity plugin. So maybe a drupalentityinline version of this patch? I've tried to roll my own but I can't quite get it to work.

  • 🇮🇳India ajay547

    Hi Team,
    any luck here.

    For me the patches are being applied but the link/document not coming inline and everytime it is going to new line.

    https://www.drupal.org/files/issues/entity_embed-inline-widgets-2640398-...

    this worked and I was able to add link of document inline, but it broke the image embed functionality.

    Any help on this is highly appreciated.

    Thanks in Advance.

  • 🇦🇺Australia jannakha Brisbane!

    here's a MR which allows inlining entity embed
    https://git.drupalcode.org/project/entity_embed/-/merge_requests/28

  • 🇺🇦Ukraine edwardsay

    Added support for drupal-entity-inline in CKEditor 5

  • 🇺🇸United States pbone3b New York, NY

    #126 Allow elements to be inline CKEditor Widgets Needs review Working well, Thanks!

  • 🇦🇺Australia darvanen Sydney, Australia

    Couldn't get #126 to apply, #125 is working well for us on a site that required it for a D10 upgrade.

  • 🇧🇷Brazil bember

    #126 works really great for me but there's an issue on the entity edit link (gear icon on hover). Steps to reproduce:
    - Embed entity A
    - Embed entity B
    - Hover on entity A, then click on gear icon to edit entity - a new tab for editing entity A opens
    - Hover on entity B, then click on gear icon to edit entity - a new tab for editing entity A opens

    The expected behavior on last step is editing entity B instead.

    I'm attaching a patch that tweaks #126 to fix this issue.

  • 🇧🇷Brazil bember

    Whoops, I previously attached an incomplete patch. Here's the correct one.

Production build 0.69.0 2024