The settings within this section control the experience of content editing for your users. It's quite a complex area with many options, so we'll go through one step at a time.
Go to Configuration | Text formatters and editors (admin/config/content/formats
).
You will see four text formats listed, the particular JavaScript editor that is assigned to them, and which roles can use them:
CKEditor is the name of the WYSIWYG editor included with Drupal 8.
We first looked at fields back in Chapters 3, Basic concepts, and Chapter 4, Getting Started with the UI. You also touched on the idea of text formats back in Chapter 5, Basic Content when you first looked at creating and editing page content, specifically the Body field, which is a text area rather than simply a single line of text.
Text formats apply whenever there is a text area field in use. It is possible to specify a text formatter on a per-field basis.
The idea of text formatters is that different markup effects can be applied in different scenarios. For example, you may not want people adding links in article comments.
In normal use, the text formats are allocated to a site role (see roles and permissions in Chapter 9, Users and Access Control). Thus, some users can use advanced formatting while others may only have more restricted options.
Let's explore this by looking at the Basic HTML format. Click on the Configure button on the Basic HTML row.
We can decide which roles are permitted to use this text format. You'll see from the checkboxes that this formatter can be accessed by users when they are logged in to the site.
You'll recall how, back in Chapter 5, Basic Content, we were able to demonstrate how the toolbar changes when you switch between Basic HTML and Full HTML.
You can configure the toolbar that is available to the user when editing text areas in this particular text format.
Try dragging some buttons from the available list to the active toolbar now. You'd most likely want to do this if the type of content you are creating calls for addition HTML elements, for example, superscript or subscript if you are creating mathematical content.
As a rule, we want to keep the Basic HTML format simple so that it is easy for all content editors to understand.
Further down the page, we have the CKEditor plugin settings. It is configured so that you can include images within text areas and those images will be automatically uploaded to Drupal.
Not everyone likes this function as it is very easy to break the layout of a page by uploading an image of an inappropriate size directly into an HTML area. We recommend using image fields instead wherever practical, like the one you saw in Chapter 5, Basic Content when you created your first Article.
If you don't want to allow images to be uploaded to text area fields that are using this format, untick the Enable image uploads box.
Note that dragging away the image button also removes the plugin:
In general, adding or removing elements from the toolbar will also adjust the corresponding plugins and their respective settings.
The final three sections of the screen (Enabled filters, Filter processing order, and Filter settings) work in combination.
There are a number of filters that can be set to automatically apply. The filters are actually applied at the time of building the page and do not modify the original content. We'll go through in detail what each one of these does, but you'll see here that you can easily enable and disable the filters using the checkboxes.
Underneath the filter list, you'll see that some filters have a settings panel and the order in which filters are applied can be changed by dragging them up and down the list.
Depending on what you are looking to achieve, the order in which the enabled filters are applied could be important.
Don't forget to save your settings after making alterations.