I have some custom functionality running in hook_block_view such that when a user loads a page, different status messages may need to be displayed from multiple blocks in the page. At present I am outputting the messages via drupal_set_message so that they appear at the top of the page.

It would be more elegant if I could display the messages within the individual blocks. I could hack this and output the messages in divs with the relevant Drupal classes attached, but that seems like a bad idea. Is there some Drupal functionality I could call to achieve what I want? (a nice Drupal style message in each block, complete with coloured background and tick/cross icon as appropriate).

Thanks in advance,



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.