page.xml
--------------------------------
<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>
<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>
============================================
app\code\core\Mage\Page\Block\Html\Header.php 引入
-------------------------------
public function _construct()
{
$this->setTemplate('page/html/header.phtml');
}
===============================
header.phtml
----------------------------
<div class="header-container">
<div class="header">
<?php if ($this->getIsHomePage()):?>
<h2 class="logo"><strong><?php echo $this->getLogoAlt() ?></strong><a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>" class="logo"><img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" /></a></h2>
<?php else:?>
<a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>" class="logo"><strong><?php echo $this->getLogoAlt() ?></strong><img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" /></a>
<?php endif?>
<div class="quick-access">
<?php echo $this->getChildHtml('topSearch') ?>
<p class="welcome-msg"><?php echo $this->getWelcome()?></p>
<?php echo $this->getChildHtml('topLinks') ?>
<div class="switchers">
<?php echo $this->getChildHtml('store_switcher') ?>
<?php echo $this->getChildHtml('store_language') ?>
</div>
</div>
<?php echo $this->getChildHtml('topContainer'); ?>
</div>
</div>
<?php echo $this->getChildHtml('topMenu') ?>
<div class="home_page_header_block">
<?php echo $this->getChildHtml('home_page_header_block'); ?>
</div>
=========================================
'home_page_header_block' 在哪定义的?
转载于:https://blog.51cto.com/phpmidding/635816