0

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>
2
  • You want to add at starting of footer section or bottom of footer section ? – inrsaurabh Nov 19 '17 at 13:06
  • a starting footer section – Altravista Nov 19 '17 at 13:40
1

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

14
  • thanks a lot but reference name is "footer" but doesn't works. I do not want to use widget – Altravista Nov 19 '17 at 13:39
  • Did you correctly add the layout file in your config.xml @Altravista – inrsaurabh Nov 19 '17 at 13:42
  • bottom.container is the starting point and there is no need to use before="_" – inrsaurabh Nov 19 '17 at 13:45
  • but there is no way to create a block before it? in "footer" reference? – Altravista Nov 19 '17 at 13:59
  • i just tried , i posted the result, where exactly you want to call ? above the footer section – inrsaurabh Nov 19 '17 at 14:03

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.