Skip to main content

Drupal Gutenberg editor not working

Membre depuis

1 month 2 weeks
Submitted by maya on
Image
Gutenberg project

Introduction

The Gutenberg editor for Drupal is rather popular. However, an issue may arise when trying to implement it on your Drupal site, particularly if you are working on an established site that has a lot of content and modules on it, rather than a blank site. I could not find a solution for this particular problem, so I had to find my own solution and I would like to share it with you, in hopes of helping anybody else who might face this.

The Issue

For starters, I installed the module:

composer require 'drupal/gutenberg:^3.0'

Then I enabled it inside the "/admin/modules" tab.

After that I followed the installation tutorial: you go to "/admin/structure/types", pick the content type you want to enable Gutenberg for, for example, "basic page". Click on "edit":

edit content type

Scroll down, select the "Gutenberg experience" tab and check the "enable Gutenberg experience" checkbox:

Enable the Gutenberg experience

Once you are done, you go to "/admin/content", click "Add content", pick "basic page" and you should see the Gutenberg editor open.

… except I did not.

If you are like me, you probably saw something like this at the bottom of the page:

Gutenberg experience not working

The page creation form does look different, but where is the Gutenberg editor? Moreover, you'll see that you cannot actually create the page - the form won't get submitted.

Solution

The solution is rather simple, but not easy to find. What you need to do is go to "/admin/structure/types" and click on "manage fields":

Manage content type fields

You want to edit the "content" field:

Edit content type field

You must scroll down and check "Gutenberg Blocks text format" under "allowed text formats":

Allow Gutenberg text

Now all you need to do is go back to "/admin/content", click the "Add content" button, select the "basic page" content type and voila, the Gutenberg editor is now working!

Gutenberg editor is working

Hope you found this post helpful!