Magento 1.9 – How to Change Header on Another Page

htmllayoutmagento-1.9

I would like to change my header when I went to another page, but I am not able to put my html file. I searched before coming here to ask, I tried this way, but just remove the header, I can not add another.

ultimo/default/layout/local.xml

<checkout_cart_index><!-- Custom static blocks -->
    <reference name="checkout.cart">
        <remove name="header" />
        <block type="page/html_header" name="header" template="page/html/header_checkout.phtml"/> 
        <block type="cms/block" name="block_cart_below_table">
            <action method="setBlockId"><block_id>block_cart_below_table</block_id></action>
        </block>
        <block type="cms/block" name="block_cart_below_totals">
            <action method="setBlockId"><block_id>block_cart_below_totals</block_id></action>
        </block>
    </reference>
</checkout_cart_index>

ultimo/default/template/page/html/header_checkout.phtml

<div>
    <h1>test</h1>
</div>

Best Answer

  1. Go to app/design/frontend/ultimo/default/template/page/html/header/new-header.phtml then put inside your header content.

  2. Go to app/design/frontend/ultimo/default/layout/local.xml then add this:

    <your_layout_handle> // here the page where you want to change the header. Exemple : <catalog_category_view> = The catogory page.
        <reference name="header">
            <action method="setTemplate">
                <template>page/html/header/new-header.phtml</template>
            </action>
        </reference>
    </your_layout_handle>
    
  3. Clear your cache.

With this solution your header will only be changed in the page that you wanted.

Related Topic