I have searched high and low for an answer on this but have not been able to come up with the solution I am looking for. I am hoping maybe someone here can point me in the right direction.

I have a website that uses a 2column-left nav layout with no top menu. I do however have a set of top.links "My Account" "My Wishlist" "My Cart" etc. It is here I would like to add an additional category menu navigation where a user hovers over something like "Categories" and it drops down through the different levels.

In the file topmenu.phtml I can this by the following code:

<?php $_menu = $this->getHtml('level-top') ?>
<div class="nav-container">
    <ul id="nav">
        <li><a href="<?php echo $this->getUrl() ?>"><?php echo $this->__('Home') ?>    </a></li>
        <li><a href="<?php echo $this->getUrl('') ?>"><?php echo $this->__('Products') ?></a>
        <?php if($_menu): ?>
                <?php echo $_menu ?>
        <?php endif ?>
        <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('menu')->toHtml(); ?>

However, I cant seem to get this to work in the top.links section "links.phtml", it looks like $_menu is not getting populated. Thanks for the help.

  • links.phtml is responsible for links like My Account, Login/Logout. Topmenu is responsible for showing up categories in horizontal menu - which you have to turn on in configuration. Check your theme for echo: <?php echo $this->getHtml('topMenu') ?> From what you have wrote: <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('menu')->toHtml(); ?> it would check for STATIC BLOCK named with code 'menu'.
    – versedi
    Feb 20 '15 at 5:35
  • Hi, yes I understand that part. This is a customization I am looking to make to the theme. My theme doesnt use a horizontal menu so I am trying to add the categories menu item to the top.links area. Is there an extension or a simple way to do this?
    – Ron
    Feb 20 '15 at 11:28
  • Has anyone done this before?
    – Ron
    Feb 24 '15 at 2:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.