Magento - Print out a category navi with hiding specific categories


/ Published in: PHP
Save to your folder(s)

Manually print out a category-navigation in a magento frontend template. within "stristr" you can enter an array of category-ids that should be hidden from display.


Copy this code and paste it in your HTML
  1. <?php $_menu = $this->renderCategoriesMenuHtml(0,'level-top') ?>
  2. <?php if($_menu): ?>
  3. <div class="nav-container">
  4. <ul id="nav">
  5. <?php foreach ($this->getStoreCategories() as $_category): ?>
  6. <?php if(stristr('YOURID1,YOURID2,YOURID3', $_category->getId()) === FALSE) : ?>
  7. <?php echo $this->drawItem($_category) ?>
  8. <?php endif ?>
  9. <?php endforeach ?>
  10.  
  11. <?php// echo $_menu ?>
  12. </ul>
  13. </div>
  14. <?php endif ?>

URL: http://www.magentocommerce.com/boards/viewthread/55533/#t175320

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.