0
votes

I want do display selected category name and it subcategories on left side.

app\design\frontend\base\default\template\catalog\navigation\left.phtml

in left.phtml

<?php if (!Mage::registry('current_category')) return ?>
<?php $_categories = $this->getCurrentChildCategories() ?>
<?php $_count = is_array($_categories)?count($_categories):$_categories->count(); ?>
<?php if($_count): ?>
<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 ($_categories as $_category): ?>
                <?php if($_category->getIsActive()): ?>
                <li>
                    <a href="<?php echo $this->getCategoryUrl($_category) ?>"<?php if ($this->isCategoryActive($_category)): ?> class="current"<?php endif; ?>><?php echo $this->htmlEscape($_category->getName()) ?></a> (<?php echo $_category->getProductCount() ?>)
                </li>
                <?php endif; ?>
            <?php endforeach ?>
            </ol>
        </dd>
    </dl>
    <script type="text/javascript">decorateDataList('narrow-by-list2')</script>
    </div>
  </div>
  <?php endif; ?>

Using this code category listing can be viewed but instead of category name, 'CATEGORY' is displayed.How can i view current Category instead of just CATEGORY ?

1

1 Answers

0
votes

Here you can get your current category

$_category = Mage::registry('current_category');