Conditional message

Categories

Component ID

2840490

Component name

Conditional message

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Downloads

786

Component created

Component changed

Component body

Display a custom message on certain conditions. The goal of this module is to be easy to set up and flexible enough to cover most use cases.

At this time the module provides the following conditions out of the box:

  • Display once per session
  • Until the user closes the message
  • Display to certain user roles
  • Display on certain paths
  • Display on certain content types
  • Display on certain multi-sites (requires configuration of conditional_message_client)

Features

Easy: offers predefined options for extra easy configuration (no dependencies!).
Configurable: customizable message, position and color.
Performant: conditions are checked via AJAX allowing it to work with any kind of cache (drupal cache, memcache, varnish).

Use cases

The typical use case scenario for this module is to show a small piece of information to a targeted audience like:

  • user is logged out, invite him to log in
  • display a promotion highlight on products content type
  • inform about an on-going event (e.g. sales, live video, site maintenance...)
  • disclaimer about using cookies on the site following EU regulations
  • ask if user wants to subscribe to your newsletter or something

How to use

  1. enable the module as you normally would
  2. go to the configuration page at admin/config/user-interface/conditional-message
  3. configure the conditions, message and eventually color/position for the message to blend in your site

The message will appear when the conditions are met!

If you want one site to control the message on other multi-sites, enable conditional_message_client module on all other multi-sites and configure them to point to the site you configured on the steps above.

Versions

At this time the drupal 7 version is still the most mature. Drupal 8 version will catch up over time.

If you find bugs or have feature requests, open a ticket and I'll fix or consider adding requests, like all software, this is a work in progress.