magento show subcategories from categories in static block

Share:
For showing Subcategory please put this follow those steps
 
<?php
/**
* ** Instructions for Use **
*
* 1. Upload this page to your installation at:
* /app/design/frontend/[INTERFACE]/[THEME]/template/catalog/navigation/custom-category.phtml
*
* 2. Enter the following code in a static block:
* {{block type="catalog/navigation" name="catalog.navigation" template="catalog/navigation/custom-category.phtml"}}
*
* 3. Select the static block as the content source for the categories you require
*
* 4. Create new CSS styles as required
*
**/
?>
 
<?php $_categories=$this->getCurrentChildCategories() ?>
 
<?php if($_categories->count()): ?>
<ul class="category-links">
<?php foreach ($_categories as $_category): ?>
<?php if($_category->getIsActive()): ?>
<li class="<?php echo $this->htmlEscape($_category->getUrlKey()) ?>">
<a href="<?php echo $this->getCategoryUrl($_category) ?>">
<?php echo $this->htmlEscape($_category->getName()) ?>
</a>
</li>
<?php endif; ?>
<?php endforeach ?>
</ul>
<? endif; ?>

No comments

Ads