Toolbar does not load at all after enabling Template

Created on 3 April 2024, 3 months ago
Updated 5 April 2024, 3 months ago

Problem/Motivation

Can anybody please help me? The ckeditor 5 Toolbar does not load anymore when I added the icon in the toolbar and configured the (default) location of the ckeditor5_template.json.example (even tried to rename it to ckeditor5_template.json). You can see screenshot of how it looks: snip1.png shows first no toolbar, just an empty box to type in, and seconds after, the textbox disappears completely (see snip2.png), there is just a line. Attached also my toolbar configuration.

Steps to reproduce

1.Installed the module through the GUI
2. Enabled it
3. Added the Template button into the toolbar
4. Set/double check the location of the template file
5. Try to add content, toolbar doesn't load at all

πŸ’¬ Support request
Status

Closed: works as designed

Version

1.0

Component

User interface

Created by

πŸ‡§πŸ‡ͺBelgium Maglor

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Maglor
  • πŸ‡§πŸ‡ͺBelgium Maglor
  • Status changed to Postponed: needs info 3 months ago
  • Hello Maglor,

    I cannot reproduce the error. The module works by default with the standard file ckeditor5_template.json.example.

    The complete editor is broken. Do you see any errors in the console (accessible via F12)?

    I suspect it is due to your template file or the content.

    In addition, please note that you have various configuration options within the β€œText formats and editors” section (see screenshot attached).

    BR
    Vincent

  • πŸ‡§πŸ‡ͺBelgium Maglor

    Dear Vincent,

    Thank you for verifying. Your F12 tip gives me more insight. It is indeed throwing some errors, and I think I found out why.

    In the F12 console:

    Value:  /modules/contrib/ckeditor5_template/template/ckeditor5_template.json.example
     GET https://gigview.be/modules/contrib/ckeditor5_template/template/ckeditor5_template.json.example 404 (Not Found)
    SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
    Debugging can be done with an unminified version of CKEditor by installing from the source file. Consult documentation at https://www.drupal.org/node/3258901
    TypeError: Cannot read properties of undefined (reading 'forEach')

    I'm however still in testing phase of my website on a subdomain: gigview.be/d10. So the GET should come from https://gigview.be/d10/modules/contrib/ckeditor5_template/template/ckedi...

    When I try to add "/d10" before the Template path in the configuration, it says "template file not found", it only accepts as of /modules
    Any suggestion or workaround to get this working?

  • I think your issue is related to https://www.drupal.org/project/ckeditor5_template/issues/3378191 ✨ Possibility to specify a template file, so that it is not always overwritten during an update Fixed .
    Drupal must be able to access the file, so it must be located under DRUPAL_ROOT.

    You can place your template.json everywhere under DRUPAL_ROOT. Thereafter, you can configure the right file location under "text formats and editors".

  • πŸ‡§πŸ‡ͺBelgium Maglor

    That did the trick! Thank you! Can be closed, works as expected.

  • Status changed to Closed: works as designed 3 months ago
Production build 0.69.0 2024