magento 中具有不同 headers 的站点?
Site with different headers in magento?
我是 magento CMS 的新手。我的问题是在我的 e-commerce 项目中,我有两个 headers:
1.主页Header只为主页。
2。其余页面正常 header。
我正在从头开发一个主题,但我很困惑在哪里可以将第二个 header 添加到我的其余页面。谁能帮我这个?提前致谢!
我们有几种方法可以通过编辑 header.phtml(将此方法复制到您的主题并编辑)来对所有页面执行 this:First 所有设置 header。然后覆盖主页的header(按照下面的步骤)
1. Enter to the admin and open the editor of the CMS pages:
2. Open for editing the page “Home page”:
3.Go to the tab “Design”:
4. Add the following text in the section “Layout Update XML”:
<reference name="header">
<block type="page/header" name="header">
<action method="setTemplate"><template>page/html/customheader.phtml</template></action>
</block>
</reference>
或
将此代码添加到您的 local.xml
<cms_index_index translate="label">
<reference name="header">
<block type="page/header" name="header">
<action method="setTemplate"><template>page/html/customheader.phtml</template></action>
</block>
</reference>
</cms_index_index>
别忘了创建 customheader.phtml
我是 magento CMS 的新手。我的问题是在我的 e-commerce 项目中,我有两个 headers:
1.主页Header只为主页。
2。其余页面正常 header。
我正在从头开发一个主题,但我很困惑在哪里可以将第二个 header 添加到我的其余页面。谁能帮我这个?提前致谢!
我们有几种方法可以通过编辑 header.phtml(将此方法复制到您的主题并编辑)来对所有页面执行 this:First 所有设置 header。然后覆盖主页的header(按照下面的步骤)
1. Enter to the admin and open the editor of the CMS pages:
2. Open for editing the page “Home page”:
3.Go to the tab “Design”:
4. Add the following text in the section “Layout Update XML”:
<reference name="header">
<block type="page/header" name="header">
<action method="setTemplate"><template>page/html/customheader.phtml</template></action>
</block>
</reference>
或
将此代码添加到您的 local.xml
<cms_index_index translate="label">
<reference name="header">
<block type="page/header" name="header">
<action method="setTemplate"><template>page/html/customheader.phtml</template></action>
</block>
</reference>
</cms_index_index>
别忘了创建 customheader.phtml