How do I customize the HTML for the global messages block? it's called in most templates:

<?php echo $this->getChildHtml('global_messages') ?>

But I can't find reference to what is generating the HTML anywhere - enabling template paths does not show if it is using a template or not.

  • Which message specifically are you looking to customize? – dchayka Nov 13 '15 at 0:27

The block responsible for generating messages as well as HTML format is under core/Mage/Core/Block/Messages.php which extends Mage_Core_Block_Template class.

All functions are within that class as well as HTML tags that are used to generate messages.

| improve this answer | |
  • I wound up copying that file to app/code/local/Mage/Core/Block & modifying the html output. Work fine enough for my purposes. but question, can I strip out all the other functions from my updated file or will Magento not 'inherit' them? – Sean Kimball Nov 13 '15 at 3:08
  • Yes, you can strip out all other functions but make your class extends Messages block then you end up overriding only one function and the rest functions will work as intended. – dchayka Nov 13 '15 at 4:35
  • Also, if this answer helps please accept it. Thank you. – dchayka Nov 13 '15 at 4:45

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.