Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This project is not covered by Drupal’s security advisory policy.
This simple module allows you configure to display notifications for menu items. This is useful when you need to indicate new changes for a user on the site.
Features:
- Support tokens and menu_token module (D7);
- Possibility to sum numeric result;
- Adding a prefix;
- Showing several types of notifications. Default available one;
- Create new types of notifications with their own properties.
Defining a new type of notification:
/**
* Implements hook_menu_notifications_info().
*/
function mymodule_menu_notifications_info() {
$info = array();
$info['new_type'] = array(
'#title' => t('My new notification'),
'property1' => array(
'label' => t('My property 1'),
'description' => t('My description for property 1.'),
'default' => '',
),
'property2' => array(
'label' => t('My property 2'),
'description' => t('My description for property 2.'),
'default' => '',
),
// etc...
);
return $info;
}
/**
* Implements hook_menu_notifications_handler().
*/
function mymodule_menu_notifications_handler(&$title, $data) {
// Code.
if ($data['type'] == 'new_type') {
$title .= '<span class="notification-new_type ' . $data['info']['property1'] . '">' . $data['info']['property2'] . '</span>';
}
}
Project information
- Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed. - No further development
No longer developed by its maintainers. - Module categories: Content Display, Site Structure
- Created by m.lebedev on , updated
- This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.