itk-dev/drupal_admin_message

Drupal admin message

1.2.0 2025-05-28 10:40 UTC

This package is auto-updated.

Last update: 2025-05-28 10:46:45 UTC


README

Show message on admin routes.

Admin message

Installation

composer require itk-dev/drupal_admin_message
vendor/bin/drush pm:install drupal_admin_message

Exclude the module from the configuration synchronization (cf. https://www.drupal.org/node/3079028):

# settings.local.php
$settings['config_exclude_modules'][] = 'drupal_admin_message';

Configuration

# settings.local.php

# Define one or more message blocks:
$settings['drupal_admin_message']['blocks'][] = 'This is a message';
$settings['drupal_admin_message']['blocks'][] = 'Some more info';

# Optionally override style (CSS)
$settings['drupal_admin_message']['css']['background-color'] = 'orange';
$settings['drupal_admin_message']['css']['color'] = 'white;';

The message can optionally be shown on all pages:

# settings.local.php
$settings['drupal_admin_message']['show_on_all_pages'] = TRUE;

Coding standards

docker compose run --rm phpfpm composer install
docker compose run --rm phpfpm vendor/bin/phpcbf
docker compose run --rm phpfpm vendor/bin/phpcs
docker compose run --rm markdownlint markdownlint '**/*.md'

Code analysis

Running static analyses on a Drupal module (may) require a full Drupal installation. Therefore we run code analysis using the official Drupal docker image (see scripts/base for details).

./scripts/phpstan
./scripts/rector