The top navigation template file at /catalogue/navigation/top.phtml contains just this short function:
<?php $_menu = $this->renderCategoriesMenuHtml(0,'level-top') ?>
<?php if($_menu): ?>
<div class="nav-container">
<ul id="nav">
<?php echo $_menu ?>
</ul>
</div>
<?php endif ?>
I'm trying to find the renderCategoriesMenuHtml function so that I can get in and edit the structure of the $_menu result that is called in top.phtml.
The purpose is that I want to slightly edit the structure the menu. It currently comes out in a ul > li > a > ul > li > a > span in HTML and I want to edit this slightly.
The command
$ grep -i -r 'function renderCategoriesMenuHtml' *
returns
app/code/core/Mage/Catalog/Block/Navigation.php
which contains
public function renderCategoriesMenuHtml($level = 0, $outermostItemClass = '', $childrenWrapClass = '')
...
as an alternative, for those who aren't so familiar with grep
, this file also have a PHPDoc comment:
<?php
/**
* Top menu for store
*
* @see Mage_Catalog_Block_Navigation
*/
?>
As you can see, it says which class $this
is refering to in this file, in which you'll find the method you're looking for.
HTH
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With