Account created on 24 February 2007, over 17 years ago
#

Recent comments

I made a really simple but working solution. please test it.

Can you please re-roll this patch to the latest 4.x version?

You are a Hero! Never give up! Thanks for your work! :)

@Snater

i've edited my last comment, the error came up on saving the text format, but on a fresh install not, so i think something was stucked during the update from CKE4 to 5.

Dear Snater,

I'm testing the latest committed version, and i think i found an error.

If Ckeditor 5 image plugin is active, you got an error of double declaration of < img src width height alt > in the ckeditor5_sourceEditing field.

It's a bad solution, but if i comment out these attributes in the module at line 815, it works perfectly.

  $attributes = [
    'img' => [
      'class' => NULL,
      'data-insert-attach' => NULL,
      'data-insert-type' => NULL,
      //'src' => NULL,
      //'width' => NULL,
      //'height' => NULL,
      //'alt' => NULL,
      'title' => NULL,
    ],

I have made it very simple:

<p class="text-align-center">
<a href="{{ url_link }}" class="colorbox insert-colorbox" data-insert-type="{{ field_type }}"{% if gallery_id != '' %} data-colorbox-gallery="{{ gallery_id }}"{% endif %}>
  <img src="{{ url }}"{{ attributes }} {% if width and height %}width="{{ width }}" height="{{ height }}" {% endif %}{% if classes|length %} class="{{ classes|join(' ') }}"{% endif %} data-insert-type="{{ field_type }}" data-entity-type="{{ entity_type }}" data-entity-uuid="{{ uuid }}" data-insert-attach='{"id": "{{ id }}", "attributes": {"alt": ["alt", "description"], "title": ["title"]{% if insert_caption %}, "data-caption": ["title"]{% endif %}}}' />
</a>
{% if ['alt'] %}{% if ['alt'] %}<br/><span data-insert-attach='{"content": ["alt"]}'></span>{% endif %}
</p>

I don't use orientation, so i added a p tag around the link, and if alt is present:

{% if ['alt'] %}<br/><span data-insert-attach='{"content": ["alt"]}'></span>{% endif %}

That's it. :)

Tested and confirming that the Drupal Rector patch in #2 works. Please commit it. Thanks.

Thanks for the patch.

I tested it too on D10.0.7 with CKE4 and Colorbox, and it seems working fine!

Once is missing, the submodules version requirement need to be updated too.

looks definitely not ok to me.

insert widget is configurable, but not showing on any field upon a form.

core_version_requirement: ^8 || ^9 also misses version 10, so can't install it via Composer.

Please make a working, installable version to d10. (cke5 is another question, and issue, but it would be also great)

Production build 0.71.5 2024