Sharing is helping.

We offer you this space to share your knowledge about Magento and learn from our experienced customers.

    Home Forums "How do I" questions Set active state navigation menu items

    This topic contains 0 replies, has 0 voices, and was last updated by  Marcel van Hemert 4 years ago.

    Viewing 1 post (of 1 total)
    • Author
    • #19379

      Marcel van Hemert

      In order to display static pages before and after the Products Category in the top navigation menu I added some code to the top.phtml file (appapp/design/frontend/default/hellovieo/template/catalog/navigation/top.phtml).
      Everything is working fine, except for one minor detail. When someone selects (clicks) on the menu-item which shows a static page, the menu item is not highlighted. When you choose a category from the products list, the menu-item will be highlighted. So the active state should change.
      I probably just am missing a piece of code, but I have no clue what it should be. Who can help me?

      The content which is displayed in the navbar_links2 static block is:


      Waarom FrescoPortal?

      The code in the top.phtml is:
      renderCategoriesMenuHtml(0,’level-top’) ?>

      getStoreCategories() as $_category) { $_anyActive = $_anyActive || $this->isCategoryActive($_category); } ?>
      <li class="home “><a href="getUrl(”)?>”>__(‘Home’) ?>

      getLayout()->createBlock(‘cms/block’)->setBlockId(‘navbar_links1′)->toHtml() ?>

      getLayout()->createBlock(‘cms/block’)->setBlockId(‘navbar_links2′)->toHtml() ?>

      Thank you in advance for your help.

      Kind regards,
      Marcel van Hemert

      Magento version:

    Viewing 1 post (of 1 total)
    Reply To: Set active state navigation menu items
    Your information:

    <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">