
In these fields the title and body are required. We add the title, description, image and body that our template will contain. To do this, go to configuration > content audit > CKEditor templates.
#CKEDITOR TEMPLATE INSTALL#
The other option we have is to install the CKEditor Templates User Interface module, this module allows us to create templates for the text editor in a more visual way and through the Drupal interface. Option 2: CKEditor Templates User Interface module We can also create an image to guide the user and upload it to the images folder we created earlier. If we want to define our own templates, we just need to go to the ckeditor_templates.js file and write the structure of the HTML snippet we want to implement. These images correspond to example templates provided with the module. Copy the default images found in libraries/templates/templates/images in the path we have defined above: /themes/custom/da_vinci/images/ckeditor/.

This path is used by the module to render the images of each defined template, in the dialog box. Copy the ckeditor_templates.js.example file from the module templates folder to the theme templates folder, rename it without.
#CKEDITOR TEMPLATE CODE#
In the first option we find that the html code of the fragment we want to implement must be inserted in a JS file.

#CKEDITOR TEMPLATE DOWNLOAD#
This module needs to download the CKEditor "Templates" add-on. To satisfy it, we will make use of the CKEditor templates module, which provides a dialogue box to offer predefined content templates.

With the default functionality of CKEditor we could not cover this need. But the user also needs to easily insert predefined HTML snippets. Let's take an example: a user needs to write post entries in Drupal and for this purpose the website has implemented a specific content type, in which we find a formatted text field for the text editor. However, sometimes, the functionalities of this HTML editor are not enough for the user. This text editor allows us to write good content with different options. The drupal core comes with one of the best open source text editors: CKeditor. Have you ever found yourself wanting to get more out of your HTML editor? Do you want to reuse designs from the rest of your web pages? Well, if that is the case, stay and read on.
