2

I am trying to show global message on home page header only but not showing me. I have copied the global message showing script from my home page but no luck....

any help would be highly appreciated..... Thanks in advance..

This is how worked for me... added this into the header section of my local.xml

<block type="core/messages" name="global_messages" as="global_messages"/>

and the PHP call in header.phtml:

<?php echo $this->getChildHtml('global_messages'); ?>
RichardBernards
  • 3,146
  • 1
  • 22
  • 30
Vijay Sankhat
  • 341
  • 3
  • 17
  • You should post your code. Your description is not enough to understand. – Vipul Hadiya Dec 02 '14 at 11:50
  • @VipulHadiya Thanks for replay, "getChildHtml('global_messages') ?>" I hope you have knowledge of this function, I just want to call this in header how can I? – Vijay Sankhat Dec 02 '14 at 11:54
  • 2
    http://stackoverflow.com/questions/19488885/understanding-getchildhtml-in-magento this will help you – Vipul Hadiya Dec 02 '14 at 11:57
  • @VipulHadiya Not related to my qestion – Vijay Sankhat Dec 02 '14 at 12:01
  • 1
    Yes it does... You are probably invoking `$this->getChildHtml()` without knowing how it works. The referenced block/html should be somewhere in the layout files as well... Read the post! – RichardBernards Dec 02 '14 at 12:17
  • @RichardBernards heyyyy every time I post question you gave my answer thanks, I don't know but I wait for your answer....Thanks a lot dear... I wish i have knowledge like you in magento..... :-) – Vijay Sankhat Dec 02 '14 at 12:26
  • Have you read the post? And did you add the XML in the proper place? Copy-paste that code into your question and I'll be able to help you further. – RichardBernards Dec 02 '14 at 12:40
  • 1
    Perfect! That's exactly what I meant =) – RichardBernards Dec 02 '14 at 14:42
  • @RichardBernards Thanks dear I will accept you as my teacher..you have to guide me. it's worked because of you otherwise I was not going to see that reference link....You said it's worked, without thinking I visited that page and go through it and it's worked.. – Vijay Sankhat Dec 03 '14 at 06:31

1 Answers1

0

In the local.xml of your theme file search for the reference name "header" and paste this code

<block type="core/messages" name="global_messages" as="global_messages"/>

now you can use <?php echo $this->getChildHtml('global_messages'); ?> in the header.phtml

Vijay Sankhat
  • 341
  • 3
  • 17