Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Conditional message

Security covered Under active development 134 sites

This module allows you to display custom messages on your website based on specific conditions, such as user roles, page paths, or content types. It's designed to be flexible, allowing HTML in messages, custom colors, and placement anywhere on the page, and it uses AJAX for performance with caching systems. You can use it to show notifications, promotions, disclaimers, or other targeted information to your visitors.

Display a custom message anywhere on the page if the configured conditions are met. The goal is to provide quick messages, notifications or alerts that are easy to set up and flexible enough to cover most use cases.

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

  • user is logged out, invite them to log in or register
  • notify about an on-going event (e.g. sales, live video, site maintenance...)
  • alert users, editors or even administrators about something that requires attention
  • promote a product or highlight a given content type
  • disclaimer about using cookies on the site for compliance with regulations
  • ask if user wants to subscribe to your newsletter or something in a non-invasive manner

Easy: offers predefined options for extra easy configuration (no dependencies!).
Flexible: customize message (allows HTML), configure background color and place it anywhere on the page.
Performant: conditions are checked via AJAX allowing it to work with any kind of cache (drupal cache, memcache or varnish).

Features

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 (D7 only, requires configuration of conditional_message_client)

How to use

On drupal 8/9/10+

  1. install the module as you normally would
  2. create new conditional messages at /admin/content/conditional-message
  3. configure the message, conditions and color/position for the message to blend in your site

On drupal 7

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

The message will appear when the conditions are met!

Drupal 8–10 · not 11

Ask your assistant about Conditional message

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

  • node Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Jan 2024
Latest release
2 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core PHP Release date
2.0.0 Stable 8–10 Jan 10, 2024