This is a better approach to creating a more solid block in your Drupal Website than copying and pasting the script into your website. However, both ways are solid and usable.
How to create a module for Drupal to add WhatsApp
First you need to create a module. To do that you need to go to > Go to the control panel of your site, and go to the menu Structure — Next Block layout. In the section that appears, go to the tab “Custom blocks library”.
Next, in the Custom Blocks section, add a new block press the “+ Add custom Block” button.
In the window that appears, note for reliability that it is better to observe the following sequence:
- First we translate the drop-down menu “Text Format” into Full HTML. This is important to have a full code block you can use.
- Then, click the Source button on top of the text field and only after that paste the code from WidgetWhats.
Next, the contents of the blocks:
- Block description: WhatsApp.
- Content: Paste the code from your account.
- Text format: Full HTML.
And of course we click Save.
Then, we return to the Block Layout, where we were at the beginning of this procedure. There, find the Header, click on the button Place Block
In the pop-up that appears, we find our previously created WhatsApp block, and click on the Place Block button.
In the window that appears, remove the checkbox “Display title” and save the block. After that, scroll down to save the changes by clicking on the “Save blocks” button.