Magento – Show a Category in Left-Side Menu Only

categorymenu

The original post is further down but I would like to rephrase it for clarity:

We use both top & left-side navigation on Magento CE and I want to add the MAIN category to our left-side navigation ONLY.

Now, the way things are currently configured (or customized) is when you create a new Main Category and set Visible in Nav to (Yes) it is added to BOTH top navigation & left-side navigation.

Conversely, if you set Visible in Nav to (No) it is removed from BOTH top navigation & left-side navigation.

So how can I show the Main Category in one BUT not the other? I have looked at left.phtml & top.phtml too. Thank you all again in helping resolve this question.

=> Original Post:

Our Magento CE site is customized to show Categories in both the top & left-side menus. So, how do I show a Category ONLY in the left-side menu? I have looked through left.phtml & top.phtml here: /html/app/design/frontend/default/ourtheme/template/catalog/navigation to no avail as well as dozens of other files. I can't seem to figure this out. Can you help me? Thank You.

Best Answer

I had same problem, after some coding I made this in template/catalog/navigation/left.phtml:

first line:

<?php $ct = Mage::registry('current_category')->getID(); ?>

in the end of the file(before endif;)

<?php elseif( $ct == 92 || $ct == 85 || $ct == 224): ?>
<?php
$currentcategory = Mage::registry('current_category');
$subcategorys = explode(',' , $currentcategory->getChildren());


?>

<div class="block block-layered-nav">
    <div class="block-title">
        <strong><span><?php echo $this->__('Browse By') ?></span></strong>
    </div>
    <div class="block-content">
        <dl id="narrow-by-list2">
            <dt><?php echo $this->__('Category') ?></dt>
            <dd>
                <ol>
                <?php foreach($subcategorys as $cat): ?>
                     <?php $cate =  Mage::getModel('catalog/category')->load($cat); ?>
                    <li>

                        <a href="<?php echo $cate->getUrl()?>" <?php if ($this->isCategoryActive($cate)): ?> class="current"<?php endif; ?>><?php echo $this->escapeHtml($cate->getName()) ?>(<?php echo $cate->getProductCount() ?>) </a>                  
                    </li>
                <?php endforeach; ?>
                </ol>
            </dd>
        </dl>
        <script type="text/javascript">decorateDataList('narrow-by-list2')</script>
    </div>
</div>

<?php endif; ?>
Related Topic