`
haohappy2
  • 浏览: 315656 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

How to add new header of Magento page

阅读更多
 

第一步:
找到
/app/design/frontend/default/default/template/page/html
复制header.phtml为另外一个文件,例如header2.html

第二步:
/app/design/frontend/default/default/layout
修改page.xml
你可以直接复制与header有关的Block并且把命题替换成上一步中你设定的
<block type="page/html_header2" name="header2" as="header2">
<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"/>
</block>

第三步:
/app/code/core/Mage/Page/Block/Html
复制Header.php为Header2.php(同第一步)

第四步:
找到Header2.php中的部分代码(在头部),
class Mage_Page_Block_Html_Header extends Mage_Core_Block_Template
{
public function _construct()
{
$this->setTemplate(’page/html/header.phtml’);
}

修改成:
class Mage_Page_Block_Html_Header2 extends Mage_Core_Block_Template
{
public function _construct()
{
$this->setTemplate(’page/html/header2.phtml’);
}

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics