Knowing the Drupal WYSIWYG standard

Conociendo el WYSIWYG estándar de Drupal

WYSIWYG is an acronym that means "What You See Is What You Get" used for Web document creation systems. They are basically editors that offer users the advantage of creating or adapting content visually without having any programming knowledge. 

Drupal 8 uses CKeditor as its default WYSIWYG plugin, it comes with many useful features for editors, some not enabled by default and many more that can be extended with contributed modules. In this article we will focus on the features that come by default with a standard Drupal installation, in other articles we will cover how we can augment those features with other modules.

 

1. Knowing your text formatting modes

  • We can change the text formats by selecting the indicated options

Body text

                                             

  • Basic HTML has basic functions for text and images.

img help

  • The html images has functions to align text but lacks text style buttons              

 

Body text

 

  • The complete html has almost all the options to display content

body text

  • In restricted html, html code is required to be entered and would only allow some tags 

                   

HTML

 

2.Configure text editors

It is possible to configure or add functions to the editors depending on our needs or also taking into account which roles may require certain configurations.

centered img

 

  • In our case we will use full HTML, and we can configure which roles can be established

Full HTML

  • Below we find the strip to customize the toolbar for the full HTML format

img

 

  • The available buttons are those that are enabled to be added to said toolbar. The following image indicates that we can drag a button to a group of the active toolbar, or if desired, we can add a group and place the buttons chosen 

bar

When adding the group we put the name                                      

Button group names

This would be the result    

Styles

                                                     

The possibility of changing the settings for the images that are inserted in the editor is also provided, depending on the directory in which they will be saved, the maximum size allowed for the images and the dimensions with which they will be displayed.   

   

Image

 

Active filters will be applied when using text formatting, these changes will be reflected     

   

Active filters

              

 

3. Operation of each of the buttons

  • The text is selected with the mouse and we click on the button b  to apply bold          

Body text

 

  • To apply the text in italics, click on the button Yo  and we will see the result

body

 

  • To apply text strikethrough, click the button s and we will see the result   

Body text

  

  • If we need to apply mathematical expressions such as exponents we click on the buttons x and we will see the result                                                                   

 

example

  • Sometimes it is necessary to delete formatting for a text to be pasted, so that it remains with the same font as the editor, press tx   to apply the change

 

  • To add links we select text and click on the button Infinite  and then some link is added to apply change                     

         

Add link

                                 

 

This is the result

Result

If we need to remove the link, press the button Infinitox having selected the same text that we have selected

Text

 

We can add bullets with these buttons Two options and we get the result in the following capture     

         

example

                                     

 

  • We can quote a text by pressing the button Quotation marks

Budget

  • If we need to add images, click this button image  we select an image that we have locally and the alternative text, the alignment of the image is optional                         

Add image

           

This would be the result 

Image and body

                                      

  • To insert a table we click this button Boardthen we insert the features                                                                

Table Properties

We accept the properties and this would be the result

Table result

                                                           

  • If we want to add a separator line we can do it with this button Text lineand this would be the result         

Text

                     

  • For the size of the titles we display this drop-down list Normaland we can choose between 4 options in our case we will choose the largest header                                   

Exempl

  

This would be the result

    

Hello World

               

Displays the regions into which the added content is divided, based on the HTML elements that have been created below.

  • If we want to see the regions into which the added content is divided, depending on the HTML elements that have been created below, click this button Cutout This is how we view the editor   

proof

                                          

  • If we have some knowledge of HTML and you need to make an adjustment by code, you can enter that mode with this button  HTML Sourceand you can now see the code       

           

proof

                                   

  • If we have doubts regarding the tags allowed in the text format, you can go to this button text formatlocated at the bottom right of the editor to open the writing tips page

4. Available buttons

These buttons are not usually enabled on the toolbars in a standard installation but can be enabled by following the directions written in the configuration.

Styles

In our case we add a group to enable all available buttons and save the configuration with the button at the bottom of the configuration                                                       

Evidence

The editor will look something like this with the buttons added

example

  • To underline text just press this button or and this would be the result      

Yeah

 

  • To align text to the left, press Lines although it is usually already by default 
  • To align text to the center we press Centerand this would be the result                                                 

text

  • To align text to the right, press Line to the left  and this would be the result                                                     

body text

  • To align text to justified press lines and this would be the result                                    

body text

  • To undo and redo changes in the editor is with these buttons arrows
  • We can use these buttons to cutto cut, copy and paste content
  • To paste plain text we can use this button listsAlthough it would not work in all browsers in general, clicking on it shows a notice on how to do it with a key combination.

Warning

                                                                      

  • To paste a text from Word we do it with the button aid
  • The button iconIt allows us to insert special characters in the text like those shown in the following image       

alphabet soup

                                                                 

  • This button icon It allows us to set the language of the text, for example if we choose English, in the editor it will be set as follows

More than 100

  • If we want to work in the editor in full screen, click this button arrows
  • The dropdown list StylesIt would be blocked until the style options are added, depending on how it is configured in the current text format from administration. However, knowledge of CSS styles is required to configure this section of CKEditor extensions and put this selection component into operation, and whose objective is to select a style that is already established from CSS

image

 

In this way we have made the tour of the different options that the editor offers us, I hope it has been useful to you.

 

Alejandro_Patiño