Installing the code through the admin panel. This is a better approach to creating a more solid block in your Drupal Website than copy and paste the script in your website. But 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 button “+ 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.
So, 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 Plase 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.