Describe your issue or idea
This is related to #1040, but it is not about validation errors, nor is it about how to move the messages produced by backdrop_set_message()
within the form (which in D7/Backdrop can be achieved by using '#theme' => 'status_messages'
in a form element).
This is to implement something like this respective feature in D8, where this is possible:
$build['status_messages'] = [
'#type' => 'status_message',
];
This would help in situations where we want to either have static warning/info messages closer to the form elements rather than the top of the page, or to inject such messages in AJAXy thingies loaded in a form. Like this for example:
...or this:
In the examples above, if there was a "site in maintenance mode" and/or "security updates available" message, we'd still want those at the top of the page, while having the ability to render the status message right above the respective field it relates to.
Steps to reproduce (if reporting a bug)
We should be able to do something like this:
$form['some_form']['some_message'] = array(
'#type' => 'status_message',
'#message' => t('Something I need to say'),
'#message_type' => 'warning',
);
Actual behavior (if reporting a bug)
The above code does not work ...we need to do tis instead:
$form['some_form']['some_message'] = array(
'#type' => 'container',
'#attributes' => array('class' => array('messages', 'warning')),
);
$form['some_form']['some_message']['message'] = array(
'#markup' => t('Something I need to say'),
);
Expected behavior (if reporting a bug)
The above code should work
Relevant version/system information (if applicable)
- D8 class StatusMessages
- How to move status messages under a multi-step wizard's progress bar: d.org handbook tutorial that shows how to use
'#theme' => 'status_messages'
. Not good enough - moves the messages produced bydrupal_set_message()
to a specific place within the form, whereas the goal is to have messages additionally to the ones produced bydrupal_set_message()
(those should still be kept at the top of the page).
Recent comments
We might want to talk about this issue at the dev meeting (if someone is available to speak to the issue and what needs to be done): Support SVG in Image Library https://github.com/...
Apr 18th Weekly Meetings
I know it's a long and difficult job to make Backdrop known and for people to realize the power (and simplicity) of the product. And I think you do a great job. What I like about Backdrop...
My work and a big thanks to all of you
Looks good. Tres bien! It is definitely worth releasing that. We often have people looking for good simple themes and that is quite a thing of beauty whilst being simple. You're right...
My work and a big thanks to all of you