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

Last modified by kara on Thu, June 24, 2010 17:04
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
  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>


  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.