Once you have got the complicated structure of MAGENTO, you can easily add content blocks within the desired place of the website.For this purpose we have to deal with header and footer files. Here is the brief description of the whole procedure.
MAGENTO is basically a powerful template system that allows us to change almost everything. The template system of MAGENTO basically consists of layout xml file, css file and phtml file.
Firstly we have to find page layout file. This file is named page.xml and comes under app/design folder in themes layout folder.The file contains an element (Hook in terms of MAGENTO) named Default. A hook basically represents a page or page type.
In this case default hook represents the layout of any page because that hasn’t its own hook. The biggest benefit of using hooks is that one need not start from scratch. Everything will be defined here and new content blocks are added and removed by other hooks. Inside this hook element we will find huge number of content blocks. Under these content blocks we have Header and Footer blocks. These blocks have their own templates. Also both of them have both specific block and chained blocks. Following code snippet will show you how blocks are defined:
<default>
<block name=”wrap”>
<block type=”core/template” template=”page/html/header.phtml”>
<block name=”nav” template=”page/html/nav.phtml” />
</block>
<block type=”core/template” template=”page/html/footer.phtml” />
</block>
</default>
<customer_account_register>
<reference name=”wrap”>
<block type=”core/template” name=”custom_hello” template=”customer/helloworld.phtml” />
</reference>
</customer_account_register>
</layout>
This is brief description about header and footer blocks.
Header and footer (phtml) files in Magento :-
You can find the header and footer (phtml) files from the following path
App/design/frontend/THEMENAME/default/template/page/html/
// you need to replace THEMENAME with your theme. Here you can find header and footer phtml files.
Leave a comment