Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

Notifications widget

257 sites Security covered
View on drupal.org

This module provides a customizable notification widget that displays in a bell icon. Users can mark notifications as read, unread, delete them individually, or clear all. It supports token replacement for personalized messages and can be integrated with Views to display notifications based on user roles or specific entities.

Notification widget allows you to configure the site notification on bell with feature of :
- Read
- Unread
- Delete
- Clear all

It allows to configure the notifications widget block for displaying the content based on Admin or logged-in user.

It allows to customise the notification message with token replacement like :
[user:name], [node:title], [comment:entity:title] etc.
It provides a block which contains notifications based on settings.

It provides the feature to extend the logs for additional provided entities like
profile_type, paragraphs and more.

It Provide integration with Views for node, comment, term, profile and message.

Service provided to add custom items in notification list :

  /**
   * Creates a notification in the database.
   *
   * @param array $message .
   *   An array containing all the message information.
   *   Needs to respect the following format:
   *   $message = [
   *     'id' => '12334',
   *     'bundle' => 'article',
   *     'content' => 'Lorem ipsum read data by [user:name]',
   *     'content_link' => 'users-list',
   *   ];
   *
   * @param string $userAction
   *   The action that led to the creation of the notification.
   *   One of the following: create, update, delete
   * @param object $entity
   *   The entity that led to the notification being triggered.
   *   Used to replace tokens in the message content.
   * @param int|null $uid
   *   (optional): The user id to which the notification should be sent.
   */
  public function logNotification(array $message, string $userAction, object $entity, int $uid = NULL): void;

Example usage:

  $notificationService = \Drupal::service('notifications_widget.logger');
  $message = [
    'id' => '1234',
    'bundle' => 'article',
    'content' => 'Lorem ipsum read data by [user:name]',
    'content_link' => 'users-list',
  ];

  $notificationService->logNotification($message, 'create', $entity);

IMPORTANT NOTES :

1. Notifications widget configuration must be saved once module installed.
2. Bootstrap theme or CSS should be included into your project.

Activity

Total releases
3
First release
Jun 2025
Latest release
4 months ago
Releases (12 mo)
2 ▲ from 1
Maintenance
Active

Release Timeline

Releases

Version Type Release date
2.0.0-alpha9 Pre-release Mar 11, 2026
2.0.0-alpha8 Pre-release Feb 24, 2026
2.0.0-alpha7 Pre-release Jun 10, 2025