0

I would like to add a new content type with a field which supports some HTML tags. So far, I added a text editor format and there I chose CKEditor as the editor and edited the list of allowed tags according to what I want to achieve. Then I added a new content type with a field of type formatted text. If I now add new content, CKEditor shows up where I expect it, but when I edit the source code and enter, for instance, an <h2> tag, it becomes a <p> tag after saving. The specific problem I'm facing is that I can't figure out how to "connect" an editor format to a field and make it selectable for the one who adds a field to a content type (for example inside the drop down menu where one can select the field type). Do you know any good documentation or tutorial which deals with this topic? Thanks in advance for your help!

3

I can't figure out how to "connect" an editor format to a field and make it selectable for the one who adds a field to a content type.

The text formats are shown in order here:

/admin/config/content/formats

The format at the top of the list is the default format. To change the order of the formats, drag the arrow icon on the leftmost side and then press save.

Users can only see formats for which they have permission. The roles with permission are listed in the Roles column of the table at /admin/config/content/formats. To change the permissions, click "Configure" for the relevant format and add the correct roles.

1
  • Yes, this is what is in core now. If you want to connect an editor format directly to a field you need this core patch or the Allowed Formats module.
    – 4k4
    Oct 7 '20 at 13:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.