Magento 1.9 – Add Block in Footer Reference

layoutmagento-1.9

I cannot add my custom block to "footer" reference in contact page

why this works?

     <contacts_index_index>
        <reference name="bottom.container">
            <block type="core/template" name="myname" before="-" template="contacts/myname.phtml"/>
        </reference>
    </contacts_index_index>

but this does not works?

    <contacts_index_index>
        <reference name="footer">
            <block type="core/template" name="myname" before="-" template="contacts/myname.phtml"/>
        </reference>
    </contacts_index_index>

Best Answer

If you are using Magento 1.9.x then you have following block references

For Magento 2 For M2

For reference check page.xml of your active theme or the fallback theme.

  1. footer.before
  2. bottom.container (this section is the starting point of footer)
  3. before_body_end
  4. footer.before to call before footer section i.e bottom of main container and above of footer

You can call your static block using widgets as well

reference default

In Block reference of widget page footer will call your static block in bottom.container section i.e starting of footer section ( you can arrange by priority as well)

....................
     <reference name="footer">
                <block type="core/template" name="contactFormcustom" template="contacts/custom.phtml"/>
            </reference>

            <reference name="bottom.container">
                <block type="core/template" name="contactFormcustom" template="contacts/custom2.phtml"/>
            </reference>

        </contacts_index_index>
    </layout>

footer-reference

......
      <reference name="footer.before">
                <block type="core/template" name="contactFormcustom" template="contacts/custom.phtml"/>
            </reference>
........

footerBefore

Related Topic