Skip to main content
drupalreleases
Release: Cms 2.2.3 — Update released for Drupal core (2.2.3)! Release: Easy Breadcrumb 2.0.11 — Minor update available for module easy_breadcrumb (2.0.11). Release: Bootstrap 8.x-3.42 — Minor update available for theme bootstrap (8.x-3.42). Release: Editoria11y Accessibility Checker 3.0.10 — Minor update available for module editoria11y (3.0.10). Release: Editoria11y Accessibility Checker 2.2.24 — Minor update available for module editoria11y (2.2.24). Release: Leaflet 10.4.13 — Minor update available for module leaflet (10.4.13). Release: Flag 5.1.1 — Minor update available for module flag (5.1.1). Release: MCP Sentinel 2.33.0 — Minor update available for module mcp_sentinel (2.33.0). Module Revived: Bootstrap 8.x-3.41 — Theme bootstrap updated after 6 months of inactivity (8.x-3.41). Security Coverage: Component Library — Module component_library now has official Drupal security advisory coverage.

iGrowl

56 sites Security covered Drupal 10–11
View on drupal.org

This module makes the iGrowl alert library available for use within Drupal. It allows you to create custom JavaScript alerts or trigger alerts through AJAX responses.

This module makes the iGrowl library available for use from within Drupal, enabling you to create iGrowl alerts from either your own custom javascript code or by using an included AJAX command function to spawn an alert.

See a demo here!

Dependencies

Drupal 8

Installation

- Download the animate.css zip file and unzip to /libraries/animate
- Download the iGrowl zip file and unzip to /libraries/igrowl
- Enable the iGrowl module
- Clear all cache, the status report page should indicate both libraries are included successfully

The libraries path is in your Drupal root, outside of /core. Do not place it in /core.

Usage

In a custom theme or module, you can spawn an iGrowl alert within your javascript by invoking it directly and providing it whatever options you want to use:

$.iGrowl({
 message: "Your message here",
})

This module also defines a custom AJAX command, so you can leverage iGrowl from an AJAX response like so:

use Drupal\igrowl\Ajax\GrowlCommand;

// controller or form code here...

$options = GrowlCommand::defaultOptions();
$options['title'] = 'Excellent!';
$options['message'] = 'We have added ' . $foo . ' ' . $bar .' to your order!';
$options['type'] = 'success';
$options['icon'] = 'feather-circle-check';

$response = new AjaxResponse();
$response->addCommand(new GrowlCommand($options));
return $response;

GrowlCommand::defaultOptions() returns an array of overrideable iGrowl options, like type, icon, message, title and more.

You can do this from either the #ajax property of a form item (the callback can return an AjaxResponse), or you can create routes in your module. The router.yml may look like this as a basic example:

mymodule.growl:
  path: '/mymodule/growl'
  defaults:
    _controller: '\Drupal\mymodule\Controller\MyModuleController::growl'
  requirements:
    _permission: 'access content'

And the corresponding controller:

namespace Drupal\mymodule\Controller;

use Drupal\Core\Ajax\AjaxResponse;
use Drupal\Core\Controller\ControllerBase;
use Drupal\igrowl\Ajax\GrowlCommand;

class MyModuleController extends ControllerBase {
  public function growl() {
    $options = GrowlCommand::defaultOptions();
    $options['message'] = 'This is a message.';
    $options['title'] = 'Hello';
    $options['icon'] = 'feather-check';
    $options['type'] = 'success';

    $response = new AjaxResponse();
    $response->addCommand(new GrowlCommand($options));
    return $response;
  }
}

Depending on your use case, you may have specific growls, or you may make a flexible generic one. It's up to you.

You will also need to attach the libraries to your theme or module. You will likely want it attached in hook_preprocess_page:

$variables['#attached']['library'][] = 'igrowl/command';
$variables['#attached']['library'][] = 'igrowl/icons.feather';

The second library is the icon set. You have 4 options to pick from:

  • icons.feather
  • icons.lineicons
  • icons.steadysets
  • icons.vicons

You can preview all option and icon types on the iGrowl demo page at http://catc.github.io/iGrowl.

Where would I use this?

If you're looking to implement AJAX in your site, for example, a Drupal Commerce site - you can leverage iGrowl to report back action status after submitting forms or clicking buttons (i.e. add to cart, remove from cart, update billing info, etc).

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Jul 2023
Latest release
1 month ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
2.0.1 Stable 10–11 Aug 20, 2026
2.0.0 Stable Jul 11, 2023
2.0.x-dev Dev Jul 10, 2023