0

I want to have a stand-alone category without any links to the rest of the shop.

Edit: Trying to add script to topmenu.phtml but not sure where to put it as using MegaMenu.

topmenu.phtml contents:

<div class="row">
<div class="span12">
    <nav>

    <ul class="nav nav-list hidden-desktop">
        <li class="nav-header"><a href="#level1" title="" data-toggle="collapse"><i class="icon-th"></i>&nbsp;&nbsp;
            <?php echo $this->__('MENU') ?> <i class="icon-down pull-right"></i> </a>
            <ul class="collapse in" id="level1">
                <?php echo $this->renderCategoriesMenuHtml(0,0,'','mobile')?>
            </ul>
        </li>
    </ul>




    <?php $class='class="simple"'; if(Mage::getStoreConfig('buyshoplayout/navigation/menutype')=='megamenu'){?>
    <div id="megamenu">
    <?php $class=''; }?>

        <ul id="nav" <?php echo $class?>>
            <?php if(Mage::getStoreConfig('buyshoplayout/navigation/home_button')){?>
            <li class="li-first-home"> <a href="<?php echo $this->getUrl('')?>"><i class="icon-home"></i></a> </li>
            <?php } ?>


            <?php if(Mage::getStoreConfig('buyshoplayout/navigation/menutype')=='simple'){?>
            <?php echo $this->renderCategoriesMenuHtml(0,0) ?>
            <?php } else { ?>
            <?php echo $this->renderCategoriesMenuHtml(0,0,'','megamenu') ?>
            <?php } ?>



            <?php if(Mage::getStoreConfig('buyshoplayout/navigation/custom_block')){?>

            <!--#1 DUPLICATE THIS SECTION IF YOU WANT MORE CUSTOM MENU ITEMS-->
            <li id="menu_custom_block"  class="level0 nav-2 level-top first parent">
               <?php echo Mage::getStoreConfig('buyshoplayout/navigation/custom_menu_url') ?>" class="level-top">
                    <span><?php echo Mage::getStoreConfig('buyshoplayout/navigation/custom_menu_title') ?></span> </a>

                <ul class="level0">
                    <li>
                        <div class="menu_custom_block">
                            <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('buyshop_header_topmenu_custom_block')->toHtml()?>
                        </div>
                    </li>
                </ul>
            </li>
            <!--end #1-->
2
  • You want to remove menu from list page ? Oct 10, 2016 at 12:37
  • Yes, but just for one category.
    – Sophie C
    Oct 10, 2016 at 12:43

1 Answer 1

0

Add below code to template/page/html/topmenu.phtml

<?php $currentCategory = Mage::registry('current_category');
if($currentCategory && $currentCategory->getData('entity_id') == 6) //change your category id 
    return false;
?>

Just above <?php $_menu = $this->getHtml('level-top') ?>

5
  • Great suggestion - thank you. Doesn't seem to be having an effect but I will keep going from there.
    – Sophie C
    Oct 10, 2016 at 14:13
  • Suggestion work for you or any issue ? Oct 11, 2016 at 6:13
  • It didn't work i'm afraid. Though I am using mega-menu so trying to work out where else I could try adding your code.
    – Sophie C
    Oct 11, 2016 at 13:53
  • Code need to be add in mega-menu file which is use for menu. Oct 12, 2016 at 5:44
  • It is within the topmenu.phtml but I can't get it to work (I have edited and added code to the question for you to see)
    – Sophie C
    Oct 12, 2016 at 9:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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