Your shopping cart is empty. Browse our Store

Magento

Open Source eCommerce Evolved

Fix: Disabled Top Menu items messing up the layout and other issues

Last modified by buddhi on Thu, May 29, 2008 11:34
Source|Old Revisions  
  • When we disable a menu item from admin interface even though it doesn’t show up in the menu, it can take one character’s space and mess up the consistent space between menu items.
  • Even though the menu items is not visible whole tree will be accessible from source and can bring up information that we want to hide from the outside world.
  1. Locate the top.phtml
    app\design\frontend\your_interface_name\default\template\catalog\navigation
  1. change the code
  1.         <ul id="nav">
  2.         <?php foreach ($this->getStoreCategories() as $_category): ?>
  3.                 <?php echo $this->drawItem($_category) ?>
  4.         <?php endforeach ?>
  5.         </ul>

to

  1.         <ul id="nav">
  2.         <?php foreach ($this->getStoreCategories() as $_category): ?>
  3.             <?php if($this->htmlEscape($_category->getName())): ?>
  4.                 <?php echo $this->drawItem($_category) ?>
  5.             <?php endif; ?>
  6.         <?php endforeach ?>
  7.         </ul>
  1. Fixed.
    1. <?php if($this->htmlEscape($_category->getName())): ?>

    This checks the category name. If the category is disabled it seems the function returns nothing.

There may be better fixes for this. Lack of documentation on functions, we have to use quick and dirty fixes like these.

Related Tags:  navigation



 

Popular Wiki Tags  |  View all

Professional Services from the Magento Team

Professional Installation from the Magento Team

Magento Job Board - Some sort of tag line goes here

Latest Posts| View all Jobs
Sales: Call 877.832.5289 (North America) 310.295.4144 (International) to request a call-back.
© Copyright 2008 Varien. Magento is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
30668 users|471 users currently online|69192 forum posts