Image entities/fields embedded using Entity Embed cannot be linked in CKEditor

Created on 24 June 2015, about 9 years ago
Updated 15 December 2023, 6 months ago

Problem/Motivation

We wanted to add a link to an image so that the image points to another page.
When we tried it by adding the image, selecting the image and adding the link (all via WYSIWYG editor) the link appeared above the image as a text link.
It seems that there is no option to add a link to an image via WYSIWYG editor at the moment. It needs to be added to the source code manually.

Proposed resolution

Please add the possibility to add a link to an image via WYSIWYG editor

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Fixed

Version

1.0

Component

CKEditor integration

Created by

πŸ‡¨πŸ‡­Switzerland jzech

Live updates comments and jobs are added and updated live.
  • Needs backport to D7

    After being applied to the 8.x branch, it should be considered for backport to the 7.x branch. Note: This tag should generally remain even after the backport has been written, approved, and committed.

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 rschwab

    Is it possible this is still broken in 2023? I'm using what seems to be a pretty straightforward configuration of CKeditor link with the entity embed. Adding a link to a drupal-media tag doesn't work, the link is placed above the media in the html. Am I doing something wrong or is this really still not working?

  • πŸ‡¦πŸ‡ΊAustralia acbramley

    @rschwab are you using CKE5? It seems to no longer work with that :(

  • πŸ‡ΊπŸ‡ΈUnited States Daniel Korte Brooklyn, NY

    Backwards compatibility patch for 8.x-1.5

  • πŸ‡³πŸ‡±Netherlands SpadXIII

    Found a small bug where it would set an error on the values array from the form_state; fixed it by pointing the error to the form field instead

    old:
    $form_state->setError($entity_element, $this->t('Link to is deprecated. Remove its value and use WYSIWYG Link button functionality over embedded entity.'));

    new:
    $form_state->setError($form['attributes']['data-entity-embed-display-settings']['link_url'], $this->t('Link to is deprecated. Remove its value and use WYSIWYG Link button functionality over embedded entity.'));

  • πŸ‡³πŸ‡±Netherlands SpadXIII

    Attached the wrong patch file, oops!

Production build 0.69.0 2024