Posted By

luxmedia on 06/26/12


Tagged

navigation magento frontend


Versions (?)

Magento - Print out a category navi with hiding specific categories


 / Published in: PHP
 

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

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.

  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 ?>

Report this snippet  

You need to login to post a comment.