The modified message with the progress bar at about 50%

This module hides messages set by drupal_set_message() after a certain time. A progressbar shows when a message will be hidden. When hovering over the message the progress will be paused. Once hidden the corresponding icon is left in place, when clicking the icon, the hidden message reappears. So if you miss a message, you'll still be able to read it.

I got inspired by Timed Notifications with CSS Animations. But I soon figured there is need for more functionality that can't be done with css only.

Drupal 8

We started with a port of the 7.x-2.x branch. Should be quite usable by now.

Features

  • Works with all messages from drupal_set_message().
  • Doesn't move messages, so they stay where they are expected.
  • Hides each message type after a setup time.
  • Animated progress bar, to indicate when the message will be hidden.
  • After timer has finished the corresponding messages will be shrunken down to use less space.
  • After closing a message, a link to show the message is shown.
  • A close button to hide messages independent of the timer.
  • Admin page to edit the timers for each message and test the various messages.

Themes

So far it has been tested with:

  • Seven 8.0.0
  • Bartik 8.0.0
  • Not supported at the moment: Stark (missing classes for JS selector)

Future Features

  • An option to make messages disappear completely as mentioned here.
  • Make messages positioned absolute (as option) so when closing not the whole page moves

Drupal 7

Version 2.x

Big improvements have been made to be better themeable.
While doing that the javascript has been improved as well.
To not break existing installations we started a new branch.
If you install this the first time, you should use the 2.x Version.

Features

  • works with all messages from drupal_set_message()
  • enhanced css for drupal messages
  • doesn't move messages, so they stay where you want them, even when using panels
  • hides status messages after 5s, warnings after 10s and errors after 15s
  • animated progress bar, to indicate when the message will be hidden
  • on hover the timer and progress bar is paused, to keep the message for further reading, if jquery pause is installed
  • after timer has finished the corresponding messages will be hidden
  • after hiding a message, a link to show the message is shown
  • a close button to hide messages
  • admin page to edit the timers for each message and test the various messages
  • message for missing jQuery pause to admin page, so even without jq pause its usable
  • admin page: field to change the classes used for detecting the messages
  • if a krumo output (dpm) is found in the message, it is not hidden by default
  • the theme's message icon that is used in the message's background is used for the reopen button

Themes

I have tested timed messages on the following themes. If you test in on other themes and it it working, let me know, so I can add the theme to this list. If you find a theme it's not working on but you would like it to, post an issue

  • Seven
  • Adminimal
  • AT Admin, AT Core, AT Panels Everywhere
  • Bartik
  • FontFolio
  • Garland
  • Skeleton
  • Stark
  • Aurora
  • Omega
  • Not supported at the moment: Arctica, Bootstrap, Ohm

(Dependencies) Nice to haves, to enhance the messages even more

Installation

  • (optional) make sure Libraries module ist activated
  • (optional) download jQuery Pause and place in libraries folder (e.g. sites/all/libraries/pause/jquery.pause.min.js)
  • activate timed messages and you are ready to go

Possible Future Features

  • admin page: option between progressbar or clock-style ticker, maybe use this plugin or this or this or this or this
  • add a stop button, to stop the progress bar and hiding
  • float closed messages next to each other
  • maybe size settings on admin page for icons
  • timestamp when the message appeared
  • option to leave a minimal "bar" instead of only the icon
  • try to place the message absolute or something, so when hiding not the whole page will be moved

Similar Modules

An awesome list to help you find what you need is found here. I found none of them hides the message without clicking by the user.

Community support

I am always happy about advice from the community. If you find this page needs better documentation, the code quality can be improved, you find bugs or you have ideas for new features, please let me know by opening an issue.

Supporting organizations: 
helped with testing this module.

Project information

Releases