How do i use a different header for each page












0















I'm new to Magento i have a bit of a problem i have 4 pages e.g home about etc... all these pages use the same header, i have created another header and updated in the page.xml file, from what i gathered the header and all the other stuff are being called from 1column.phtml. How do i do this so when you click a different page it can change header.



basically i want this code underneath to change when a different page is loaded.



<head>
<?php echo $this->getChildHtml('head') ?>
</head>


to



<head>
<?php echo $this->getChildHtml('head-about') ?>
</head>


this is the part of the page.xml file which i have modified.



 <block type="page/html_header" name="header" as="header">
<block type="page/template_links" name="top.links" as="topLinks"/>
<block type="page/switch" name="store_language" as="store_language" template="page/switch/languages.phtml"/>
<block type="core/text_list" name="top.menu" as="topMenu" translate="label">
<label>Navigation Bar</label>
<block type="page/html_topmenu" name="catalog.topnav" template="page/html/topmenu.phtml"/>
</block>
<block type="page/html_wrapper" name="top.container" as="topContainer" translate="label">
<label>Page Header</label>
<action method="setElementClass"><value>top-container</value></action>
</block>
<block type="page/html_welcome" name="welcome" as="welcome"/>
</block>


<block type="page/html_header" name="header-about" as="header-about">
<block type="page/template_links" name="top.links" as="topLinks"/>
<block type="page/switch" name="store_language" as="store_language" template="page/switch/languages.phtml"/>
<block type="core/text_list" name="top.menu" as="topMenu" translate="label">
<label>Navigation Bar</label>
<block type="page/html_topmenu" name="catalog.topnav" template="page/html/topmenu.phtml"/>
</block>
<block type="page/html_wrapper" name="top.container" as="topContainer" translate="label">
<label>Page Header</label>
<action method="setElementClass"><value>top-container</value></action>
</block>
<block type="page/html_welcome" name="welcome" as="welcome"/>
</block>









share|improve this question
















bumped to the homepage by Community 2 days ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Better if you can share the page.xml - the modified section

    – Nidheesh
    Oct 4 '16 at 10:54
















0















I'm new to Magento i have a bit of a problem i have 4 pages e.g home about etc... all these pages use the same header, i have created another header and updated in the page.xml file, from what i gathered the header and all the other stuff are being called from 1column.phtml. How do i do this so when you click a different page it can change header.



basically i want this code underneath to change when a different page is loaded.



<head>
<?php echo $this->getChildHtml('head') ?>
</head>


to



<head>
<?php echo $this->getChildHtml('head-about') ?>
</head>


this is the part of the page.xml file which i have modified.



 <block type="page/html_header" name="header" as="header">
<block type="page/template_links" name="top.links" as="topLinks"/>
<block type="page/switch" name="store_language" as="store_language" template="page/switch/languages.phtml"/>
<block type="core/text_list" name="top.menu" as="topMenu" translate="label">
<label>Navigation Bar</label>
<block type="page/html_topmenu" name="catalog.topnav" template="page/html/topmenu.phtml"/>
</block>
<block type="page/html_wrapper" name="top.container" as="topContainer" translate="label">
<label>Page Header</label>
<action method="setElementClass"><value>top-container</value></action>
</block>
<block type="page/html_welcome" name="welcome" as="welcome"/>
</block>


<block type="page/html_header" name="header-about" as="header-about">
<block type="page/template_links" name="top.links" as="topLinks"/>
<block type="page/switch" name="store_language" as="store_language" template="page/switch/languages.phtml"/>
<block type="core/text_list" name="top.menu" as="topMenu" translate="label">
<label>Navigation Bar</label>
<block type="page/html_topmenu" name="catalog.topnav" template="page/html/topmenu.phtml"/>
</block>
<block type="page/html_wrapper" name="top.container" as="topContainer" translate="label">
<label>Page Header</label>
<action method="setElementClass"><value>top-container</value></action>
</block>
<block type="page/html_welcome" name="welcome" as="welcome"/>
</block>









share|improve this question
















bumped to the homepage by Community 2 days ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Better if you can share the page.xml - the modified section

    – Nidheesh
    Oct 4 '16 at 10:54














0












0








0








I'm new to Magento i have a bit of a problem i have 4 pages e.g home about etc... all these pages use the same header, i have created another header and updated in the page.xml file, from what i gathered the header and all the other stuff are being called from 1column.phtml. How do i do this so when you click a different page it can change header.



basically i want this code underneath to change when a different page is loaded.



<head>
<?php echo $this->getChildHtml('head') ?>
</head>


to



<head>
<?php echo $this->getChildHtml('head-about') ?>
</head>


this is the part of the page.xml file which i have modified.



 <block type="page/html_header" name="header" as="header">
<block type="page/template_links" name="top.links" as="topLinks"/>
<block type="page/switch" name="store_language" as="store_language" template="page/switch/languages.phtml"/>
<block type="core/text_list" name="top.menu" as="topMenu" translate="label">
<label>Navigation Bar</label>
<block type="page/html_topmenu" name="catalog.topnav" template="page/html/topmenu.phtml"/>
</block>
<block type="page/html_wrapper" name="top.container" as="topContainer" translate="label">
<label>Page Header</label>
<action method="setElementClass"><value>top-container</value></action>
</block>
<block type="page/html_welcome" name="welcome" as="welcome"/>
</block>


<block type="page/html_header" name="header-about" as="header-about">
<block type="page/template_links" name="top.links" as="topLinks"/>
<block type="page/switch" name="store_language" as="store_language" template="page/switch/languages.phtml"/>
<block type="core/text_list" name="top.menu" as="topMenu" translate="label">
<label>Navigation Bar</label>
<block type="page/html_topmenu" name="catalog.topnav" template="page/html/topmenu.phtml"/>
</block>
<block type="page/html_wrapper" name="top.container" as="topContainer" translate="label">
<label>Page Header</label>
<action method="setElementClass"><value>top-container</value></action>
</block>
<block type="page/html_welcome" name="welcome" as="welcome"/>
</block>









share|improve this question
















I'm new to Magento i have a bit of a problem i have 4 pages e.g home about etc... all these pages use the same header, i have created another header and updated in the page.xml file, from what i gathered the header and all the other stuff are being called from 1column.phtml. How do i do this so when you click a different page it can change header.



basically i want this code underneath to change when a different page is loaded.



<head>
<?php echo $this->getChildHtml('head') ?>
</head>


to



<head>
<?php echo $this->getChildHtml('head-about') ?>
</head>


this is the part of the page.xml file which i have modified.



 <block type="page/html_header" name="header" as="header">
<block type="page/template_links" name="top.links" as="topLinks"/>
<block type="page/switch" name="store_language" as="store_language" template="page/switch/languages.phtml"/>
<block type="core/text_list" name="top.menu" as="topMenu" translate="label">
<label>Navigation Bar</label>
<block type="page/html_topmenu" name="catalog.topnav" template="page/html/topmenu.phtml"/>
</block>
<block type="page/html_wrapper" name="top.container" as="topContainer" translate="label">
<label>Page Header</label>
<action method="setElementClass"><value>top-container</value></action>
</block>
<block type="page/html_welcome" name="welcome" as="welcome"/>
</block>


<block type="page/html_header" name="header-about" as="header-about">
<block type="page/template_links" name="top.links" as="topLinks"/>
<block type="page/switch" name="store_language" as="store_language" template="page/switch/languages.phtml"/>
<block type="core/text_list" name="top.menu" as="topMenu" translate="label">
<label>Navigation Bar</label>
<block type="page/html_topmenu" name="catalog.topnav" template="page/html/topmenu.phtml"/>
</block>
<block type="page/html_wrapper" name="top.container" as="topContainer" translate="label">
<label>Page Header</label>
<action method="setElementClass"><value>top-container</value></action>
</block>
<block type="page/html_welcome" name="welcome" as="welcome"/>
</block>






magento-1.9 layout cms-pages






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Oct 4 '16 at 10:55







JkenGJ

















asked Oct 4 '16 at 10:48









JkenGJJkenGJ

112




112





bumped to the homepage by Community 2 days ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 2 days ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Better if you can share the page.xml - the modified section

    – Nidheesh
    Oct 4 '16 at 10:54



















  • Better if you can share the page.xml - the modified section

    – Nidheesh
    Oct 4 '16 at 10:54

















Better if you can share the page.xml - the modified section

– Nidheesh
Oct 4 '16 at 10:54





Better if you can share the page.xml - the modified section

– Nidheesh
Oct 4 '16 at 10:54










1 Answer
1






active

oldest

votes


















0














If you want to different header on CMS page then you can achieve by:



In CMS->Design->Layout Update XML put this code:



   <reference name="header">
<block type="page/header" name="header">
<action method="setTemplate"><template>cms/headers/about_us.phtml</template></action>
</block>
</reference>


And create file about_us.phtml your_theme/template/cms/headers
It's done.



For more see here.






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "479"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f139291%2fhow-do-i-use-a-different-header-for-each-page%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    If you want to different header on CMS page then you can achieve by:



    In CMS->Design->Layout Update XML put this code:



       <reference name="header">
    <block type="page/header" name="header">
    <action method="setTemplate"><template>cms/headers/about_us.phtml</template></action>
    </block>
    </reference>


    And create file about_us.phtml your_theme/template/cms/headers
    It's done.



    For more see here.






    share|improve this answer




























      0














      If you want to different header on CMS page then you can achieve by:



      In CMS->Design->Layout Update XML put this code:



         <reference name="header">
      <block type="page/header" name="header">
      <action method="setTemplate"><template>cms/headers/about_us.phtml</template></action>
      </block>
      </reference>


      And create file about_us.phtml your_theme/template/cms/headers
      It's done.



      For more see here.






      share|improve this answer


























        0












        0








        0







        If you want to different header on CMS page then you can achieve by:



        In CMS->Design->Layout Update XML put this code:



           <reference name="header">
        <block type="page/header" name="header">
        <action method="setTemplate"><template>cms/headers/about_us.phtml</template></action>
        </block>
        </reference>


        And create file about_us.phtml your_theme/template/cms/headers
        It's done.



        For more see here.






        share|improve this answer













        If you want to different header on CMS page then you can achieve by:



        In CMS->Design->Layout Update XML put this code:



           <reference name="header">
        <block type="page/header" name="header">
        <action method="setTemplate"><template>cms/headers/about_us.phtml</template></action>
        </block>
        </reference>


        And create file about_us.phtml your_theme/template/cms/headers
        It's done.



        For more see here.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Oct 4 '16 at 11:00









        ArunendraArunendra

        6,06331642




        6,06331642






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f139291%2fhow-do-i-use-a-different-header-for-each-page%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            1300-talet

            1300-talet

            Has there ever been an instance of an active nuclear power plant within or near a war zone?