I've looked around a lot and found lots about pulling in parent Id's and sub cat listings but this is slight different and I don't seem to able to find an answer, I'm not a PHP guru (yet) so go easy on me. I've tried various things but I just end up with errors.
I have created a phtml template to display sub categories of a parent category in an inline link block below my main nav. I'm calling this template with a static block from the admin which is working fine, but the link block disappears when I navigate through to a subcategory page, obviously because this code calls sub cats of a parent but not while you are actually IN a sub cat. here's the code I'm using so far:
<?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="category-products <?php echo Mage::getModel('catalog/layer')->getCurrentCategory()->getName(); ?>">
<dl id="narrow-by-list2">
<dt></dt>
<dd>
<ol class="subcat_list">
<?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>
</li>
<?php endif; ?>
<?php endforeach ?>
</ol>
</dd>
</dl>
<script type="text/javascript">decorateDataList('narrow-by-list2')</script>
</div>
<?php endif; ?>
any ideas as to how I can modify this so the list stays there while I'm actually viewing a sub cat? Many thanks