cancel
Showing results for 
Search instead for 
Did you mean: 

How to expand / unfold category list by default

   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

How to expand / unfold category list by default

Hi,

currently , my theme looks like this on a -mobile- device:

 

mobile.jpg

 

But I want it to look like this:

 

expanded.jpg

 

 

Meaning: I want the category list to be unfolded by dedault; without the user having to select it.

I think this can be done in: 

 

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

But I just can't get it to work.

Source code of 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->escapeHtml($_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; ?>

 

Many thanks in advance ,

Pelle