Gurumoorthi
March 19, 2015
This blog describes how to hide and override drupal status messages while creating and editing nodes.
When you create or edit the nodes, drupal displays status messages like 'node has been created' and 'node has been updated'. Some may not be interested to view these messages. You can hide these messages using drupal_get_messages(). It returns all messages that have been set using drupal_set_message(). You need to add it to a custom submit handler for the corresponding form. You can add custom submit handler using either hook_form_alter() or hook_form_form_id_alter() in drupal.
To hide drupal status messages, use the code below. For example, I have hidden the status messages only for the article node form.
Similarly, you can override these status messages. For that, you need to add messages after drupal_get_messages() in the custom submit handler.
Now you can get drupal status messages. Similarly, you can hide and override the drupal status messages for other node forms as well.
Just like how your fellow techies do.
We'd love to talk about how we can work together
Take control of your AWS cloud costs that enables you to grow!