The WhatsApp Button module allows you to add a configurable block anywhere on your site, enabling quick and direct access to WhatsApp. With just one click, users can instantly start a conversation.
Key Features
- Customizable contact number: Set the WhatsApp number where conversations will be directed.
- Predefined message customization: Configure an automatic message that loads upon opening the chat, so users only need to send it.
- Icon customization: Replace the default icon with a custom image to match your site's design.
- Flexible positioning with CSS and media queries: Adjust the button’s position on different screen sizes to fit your layout needs.
Installation
- Run the following command to install the module:
composer require 'drupal/whatsapp_button:^1.0'
- Go to
/admin/structure/block in your site's address bar.
- Locate and place the WhatsApp Button block in your desired region.
- In the block settings, disable the "Display title" option and click "Save Block."
Customization
The WhatsApp Button functions like any other block. To edit it, hover over the contextual link and click "Edit."
On the block configuration page, you can modify multiple settings:
- Text Information
- Customize the message displayed on the WhatsApp page, add text next to the icon, and define a tooltip.
- Image Settings
- Replace the default icon with a custom image.
- Define the image width using px (recommended), em, %, or any other CSS unit.
- Set different image widths for tablets and desktops (mobile uses the default size).
- Position Settings
- Adjust the button’s position from the bottom and right of the screen.
- Media Queries
- Customize media query breakpoints to control how the button behaves across different devices.
Project link
https://www.drupal.org/project/whatsapp_button
Comments
Comment #2
vishal.kadamThank you for applying!
Please read Review process for security advisory coverage: What to expect for more details and Security advisory coverage application checklist to understand what reviewers look for. Tips for ensuring a smooth review gives some hints for a smoother review.
The important notes are the following.
phpcs --standard=Drupal,DrupalPracticeon the project, which alone fixes most of what reviewers would report.To the reviewers
Please read How to review security advisory coverage applications, Application workflow, What to cover in an application review, and Tools to use for reviews.
The important notes are the following.
For new reviewers, I would also suggest to first read In which way the issue queue for coverage applications is different from other project queues.
Comment #3
vishal.kadamComment #4
vishal.kadam1. Fix phpcs issues.
2. FILE: README.txt
README file should follow the content and formatting described in README.md template.
3. FILE: whatsapp_button.info.yml
package: CustomThis line is used by custom modules created for specific sites. It is not a package name used for projects hosted on drupal.org.
4. FILE: whatsapp_button.module
Drupal does not have primary and secondary hooks. Instead of that, it is preferable to use the usual description: “Hook implementations for the [module name] module”, where [module name] is the name of the module given in its .info.yml file.
The description for this hook should also say for which hook it is implemented.
5. FILE: templates/whatsapp-button-template.html.twig
Twig code needs to be correctly indented. Drupal uses two spaces for indentation, not four spaces or tabs.
6. FILE: src/Plugin/Block/WhatsappButtonBlock.php
The documentation comment for constructors is not mandatory anymore. If it is given, the description should be “Constructs a new [class name] object”, where [class name] includes the class namespace.
Comment #5
avpadernoAs a side note, please check Git has been set to use the same email associated to your drupal.org account, or the commits you do will not be associated to your account.
Comment #6
cadence96I have implemented the requested changes:
The updated code has been committed under tag 1.0.3.
Additionally, I have verified that Git is set to use the same email associated with my Drupal.org account.
Please review and let me know if any further adjustments are needed.
Comment #7
vishal.kadamFILE: templates/whatsapp-button-template.html.twig
Twig code needs to be correctly indented. Drupal uses two spaces for indentation, not four spaces or tabs.
Comment #8
cadence96Corrected indentation in twig file.
Created tag v.1.0.4.
Comment #9
vishal.kadamThese applications do not require that new releases are created after reviews.
Comment #10
vishal.kadamRest looks fine to me.
Let’s wait for a Code Review Administrator to take a look and if everything goes fine, you will get the role.
Comment #11
avpadernocorecan only be used togethercore_version_requirement: ^8 || ^9. Drupal core will throw an error, when it used togethercore_version_requirement: ^8 || ^9 || ^10 || ^11.Comment #12
avpadernoThank you for your contribution and for your patience with the review process!
I am going to update your account so you can opt into security advisory coverage any project you create, including the projects you already created.
These are some recommended readings to help you with maintainership:
You can find more contributors chatting on Slack or IRC in #drupal-contribute. So, come hang out and stay involved!
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
I thank the dedicated reviewers as well.
Comment #13
avpadernoComment #14
avpaderno