Code for non-anchor categories:
Use the below code for navigation/left.phtml:
<?php if (!Mage::registry('current_category')) return ?>
<?php $currentCategory = Mage::registry('current_category'); ?>
<?php $_categories = Mage::getModel('catalog/category')->getCollection()->setStoreId(Mage::app()->getStore()->getId());
$_categories->addAttributeToSelect('*')
->addAttributeToFilter('parent_id', $currentCategory->getParentId()) //siblings have the same parent as the current category
->addAttributeToFilter('is_active', 1)//get only active categories
->addAttributeToSort('position'); ?>
<?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 $_category->getUrl() ?>"<?php if ($currentCategory->getId() == $_category->getId()): ?> class="current"<?php endif; ?>><?php echo $this->escapeHtml($_category->getName()) ?></a>
</li>
<?php endif; ?>
<?php endforeach ?>
</ol>
</dd>
</dl>
<script type="text/javascript">decorateDataList('narrow-by-list2')</script>
</div>
</div>
<?php endif; ?>
You need to set bold for current category then add the following css to your css files:
<style type="text/css">
.current{font-weight: bold;}
</style>
Code for anchor categories:
Use the below code for layer/view.phtml:
<?php $currentCategory = Mage::registry('current_category'); ?>
<?php $_categories = Mage::getModel('catalog/category')->getCollection()->setStoreId(Mage::app()->getStore()->getId());
$_categories->addAttributeToSelect('*')
->addAttributeToFilter('parent_id', $currentCategory->getParentId()) //siblings have the same parent as the current category
->addAttributeToFilter('is_active', 1)//get only active categories
->addAttributeToSort('position'); ?>
<?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): ?>
<li>
<a href="<?php echo $_category->getUrl(); ?>"<?php if ($currentCategory->getId() == $_category->getId()): ?> class="current"<?php endif; ?>><?php echo $this->escapeHtml($_category->getName()) ?></a>
</li>
<?php endforeach ?>
</ol>
</dd>
</dl>
<script type="text/javascript">decorateDataList('narrow-by-list2')</script>
</div>
</div>
<?php endif; ?>
<?php if($this->canShowBlock()): ?>
<div class="block block-layered-nav">
<div class="block-title">
<strong><span><?php echo $this->__('Shop By') ?></span></strong>
</div>
<div class="block-content">
<?php echo $this->getStateHtml() ?>
<?php if ($this->getLayer()->getState()->getFilters()): ?>
<div class="actions"><a href="<?php echo $this->getClearUrl() ?>"><?php echo $this->__('Clear All') ?></a></div>
<?php endif; ?>
<?php if($this->canShowOptions()): ?>
<p class="block-subtitle"><?php echo $this->__('Shopping Options') ?></p>
<dl id="narrow-by-list">
<?php $_filters = $this->getFilters() ?>
<?php foreach ($_filters as $_filter): ?>
<?php if($_filter->getItemsCount() && $_filter->getName() != 'Category'): ?>
<dt><?php echo $this->__($_filter->getName()) ?></dt>
<dd><?php echo $_filter->getHtml() ?></dd>
<?php endif; ?>
<?php endforeach; ?>
</dl>
<script type="text/javascript">decorateDataList('narrow-by-list')</script>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
You need to set bold for current category then add the following css to your css files:
<style type="text/css">
.current{font-weight: bold;}
</style>