1

How does one add links to the RWD theme navigation bar. I went through the debugger mode to see which files are being called and I still can't figure out how to add links to the responsive nav menu. I want to add some of the new cms pages I have included in my footer to the top menu. As well as a simple homepage link next to the account drop down.

enter image description here

enter image description here

<div class="skip-links">
        <a href="#header-nav" class="skip-link skip-nav">
            <span class="icon"></span>
            <span class="label"><?php echo $this->__('Menu'); ?></span>
        </a>

        <a href="#header-search" class="skip-link skip-search">
            <span class="icon"></span>
            <span class="label"><?php echo $this->__('Search'); ?></span>
        </a>

        <div class="account-cart-wrapper">
            <a href="<?php echo $this->helper('customer')->getAccountUrl(); ?>" data-target-element="#header-account" class="skip-link skip-account">
                <span class="icon"></span>
                <span class="label"><?php echo $this->__('Account'); ?></span>
            </a>

In the first link called #header-nav I want to know how/where this object is being called and how I can populate the drop down?

1

Find the following file: app/design/frontend/rwd/default/template/page/html and open topmenu.phtml file. find this code

<?php if($_menu): ?>
    <nav id="nav">
        <ol class="nav-primary">
            <?php echo $_menu ?>
        </ol>
    </nav>
<?php endif ?>

this code will output you the categories in the form of top menu if you don't use any categories hide this code or else paste this code before or after this code.

<ul>
            <li><a href="<?php echo Mage::getBaseUrl(); ?>">HOME</a></li>
            <li><a href="<?php echo Mage::getBaseUrl(); ?>aboutus">ABOUT US</a></li>
            <li><a href="<?php echo Mage::getBaseUrl(); ?>your_page_uri">your_page_name</a></li>
            <li><a href="<?php echo Mage::getBaseUrl(); ?>your_page_uri">your_page_name</a></li>

</ul>

Another way to do it would be to use Observer page_block_html_topmenu_gethtml_before and then you can alter the menu in the way magento is doing it itself. For more information on that, like how to build up a real structure you can take a look here: http://inchoo.net/ecommerce/adding-links-to-the-top-menu-in-magento/

0

The easiest way I've found for adding items to the nav menu is to create categories for them.

  1. Go to Catalog > Manage Categories.
  2. Click on Default Category in the category list.
  3. Click the Add Subcategory button.
  4. Enter the text you want to add as a menu item in the Name box. Let's call it "Test".
  5. Change Is Active to Yes.
  6. Make sure Include in Navigation Menu is set to Yes.
  7. Click the Save Category button.

After refreshing the front end, the new menu item should now appear as 'Test'.

By default, clicking 'Test' will navigate to /test.html. If that page doesn't exist, you'll have to create it in CMS > Pages.

You can add submenu items by clicking on the category you just created and clicking the Add Subcategory button.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.