/catalogue/navigation/top.phtml 中的顶部导航模板文件仅包含以下简短功能:
<?php $_menu = $this->renderCategoriesMenuHtml(0,'level-top') ?>
<?php if($_menu): ?>
<div class="nav-container">
<ul id="nav">
<?php echo $_menu ?>
</ul>
</div>
<?php endif ?>
我试图找到 renderCategoriesMenuHtml 函数,以便我可以进入并编辑在 top.phtml 中调用的 $_menu 结果的结构。
目的是我想稍微编辑菜单的结构。它目前在 HTML 中的 ul > li > a > ul > li > a > span 中出现,我想稍微编辑一下。
最佳答案
命令
$ grep -i -r 'function renderCategoriesMenuHtml' *
返回
app/code/core/Mage/Catalog/Block/Navigation.php
其中包含
public function renderCategoriesMenuHtml($level = 0, $outermostItemClass = '', $childrenWrapClass = '')
...
关于Magento:在 top.phtml 中找到的函数 renderCategoriesMenuHtml 的位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11752827/