Different template for different categories in Magento
I want to display subcategories under artist category in one layout and design an开发者_开发问答d other categories in another layout and design in Magento 1.4.1.1.
In the web admin, under Manage Categories, select the categories you want to be different and navigate to the Custom Design tab. You can enter layout updates or select alternative skin/themes.
The best way to do this is to use static blocks.
1) Create phtml file in /template/catalog/navigation
<?php $_categories = $this->getCurrentChildCategories(); ?>
<ul>
<?php foreach ($_categories as $_category): ?>
<?php if($_category->getIsActive()): ?>
<li>
<a href="<?php echo $_category->getURL() ?>" title="<?php echo $this->htmlEscape($_category->getName()) ?>"><?php echo $this->htmlEscape($_category->getName()) ?></a>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
2) Create static block "Subcategories"
{{block type="catalog/navigation" template="catalog/navigation/subcategory.phtml"}}
3) Assign static block for needed category ("Display Settings" tab -> Display Mode = Static block only and select CMS Block "Subcategories")
精彩评论