Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295783

"status_messages"-like render element with a preset message

$
0
0

Problem/Motivation

The "status_messages" render element (\Drupal\Core\Render\Element\StatusMessages) comes with nice CSS. We want to reuse its look when we display warning and/or error messages in the middle long forms, like this:
Color extractor library missing message
Unfortunately, "status_messages" is only for displaying messages set by the \drupal_set_message method. That means that it will be displaying all kinds of system messages in a place where we only want our custom message. Instead, we would like an element that displays only the warning/error message that we directly set in its render array.

Proposed resolution

Create a new render element for a such a message box.
e.g., named "message" with properties "#message" and "#style". "#message" is the message that is to be displayed in the box. "#style" can be either "status", "warning", or "error" and determines the appearance.

Or extend "container" with this functionality. (Add optional "#style" property.)

Or make it possible to set "status_messages" to only display messages included in the form array.

Remaining tasks

User interface changes

API changes

Data model changes


Viewing all articles
Browse latest Browse all 295783

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>