0
<reference name="header">
        <action method="setTemplate">
            <template>page/html/header_b.phtml</template>
        </action>
    </reference>

This code will overwrite the header.phtml with new phtml file,

But i want this rewrite only in my product listing pages.I don't want to overwrite my header html files in product description page

How to achieve this I am adding this as layout updates from my admin panel

2

Try the following

<my_handle> <!-- create custom handle to avoid duplication -->
    <reference name="header">
        <action method="setTemplate">
            <template>page/html/header_b.phtml</template>
        </action>
    </reference>
</my_handle>

<catalog_category_default> <!-- apply handle to default category handle-->
    <update handle="my_handle" />
</catalog_category_default>
<catalog_category_layered> <!-- apply handle to layered category handle-->
    <update handle="my_handle" />
</catalog_category_layered>
<catalogsearch_result_index> <!-- apply handle to quick search handle-->
    <update handle="my_handle" />
</catalogsearch_result_index>
<catalogsearch_advanced_result> <!-- apply handle to advanced search results handle-->
    <update handle="my_handle" />
</catalogsearch_advanced_result>
0
<my_handle> <!-- create custom handle to avoid duplication -->
<reference name="header">
    <action method="setTemplate">
        <template>page/html/header_b.phtml</template>
    </action>
</reference>

make on template and call this new header and assign this template what you want.

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.