Hello friedms我开发了一个magento网站,我创建了一个页面,我想将该页面链接到导航菜单栏中
http://www.magentocommerce.com/knowledge-base/entry/adding-page-links-in-the-navigation-bar
从Magento CE 1.7开始,有一个事件可以让您在顶部菜单中添加任何内容
事件为page_block_html_topmenu_gethtml_before
。在默认主题中,它用于在菜单中添加类别。查看方法Mage_Catalog_Model_Observer::addCatalogToTopmenuItems()
。你也可以这么做
如果您正在使用1.7之前的版本,只需编辑文件app/design/frontend/{interface}/{theme}/template/catalog/navigation/top.phtml
并在ul
元素中添加链接:
<ul id="nav">
<?php echo $_menu ?>
<li><a href="<?php echo $this->getUrl('', array('_direct'=>'page_identifier_here'))?>"><?php echo $this->__('Text here')?></a></li>
</ul>
或者像这个
<ul id="nav">
<?php echo $_menu ?>
<li><a href="<?php echo $this->getUrl('page_identifier_here')?>"><?php echo $this->__('Text here')?></a></li>
</ul>
1.6版本的方法也适用于1.7版本,但不是那么干净。