當前我想在菜單選項卡上添加一個新的菜單鏈接,但可以在不更改其他模塊模板的情況下完成,但只需在模塊內部添加?我想這樣做的原因是因爲我希望當我禁用我的模塊時,菜單鏈接也將消失。Magento在模塊內添加新的菜單項
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 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>
referral.xml(我的模塊) ??? 我該怎麼辦?
topmenu.phtml
<?php $_menu = $this->getHtml('level-top') ?>
<?php if($_menu): ?>
<div class="nav-container">
<ul id="nav">
<?php $active = is_numeric(stripos($_SERVER['REQUEST_URI'], 'aboutus')) ? 'active' : ''; ?>
<li class="level0 nav-2 last level-top <?php echo $active; ?>">
<a class="level-top" href="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);?>aboutus">
<span>About Us</span>
</a>
</li>
<?php echo $_menu ?>
<?php $active = is_numeric(stripos($_SERVER['REQUEST_URI'], 'redemption/store')) ? 'active' : ''; ?>
<li class="level0 nav-2 last level-top <?php echo $active; ?>">
<a class="level-top" href="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);?>redemption/store">
<span>Redemption Store</span>
</a>
</li>