2

On the homepage I am using the following code to display a few products from a specific category:

{{block type="catalog/product_list" category_id="213" column_count="6" template="catalog/product/list.phtml"}}

Is there a block I can use to also render the category description via a CMS page or block?

Francis Kim
  • 4,235
  • 4
  • 36
  • 51

1 Answers1

5

There is no built in functionality for this, but you can add a block yourself. Add this in the homepage content:

{{block type="core/template" template="catalog/category/description.phtml" category_id="213"}}

Now create the file app/design/frontend/{interface}/{theme}/template/catalog/category/description.phtml with the following content

<?php $categoryId = $this->getCategoryId();?>
<?php $category = Mage::getModel('catalog/category')->setStoreId(Mage::app()->getStore()->getId())->load($categoryId);?>
<?php if ($category->getId() && $category->getIsActive() && $_description = $category->getDescription()) : ?>
    <?php echo $this->helper('catalog/output')->categoryAttribute($category, $_description, 'description')?>
<?php endif;?>
Amuk Saxena
  • 1,521
  • 4
  • 18
  • 44
Marius
  • 15,148
  • 9
  • 56
  • 76