Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento: How can I show the category description in the left sidebar?

Tags:

magento

I want to display the category description in my left sidebar instead of the main column.

I added this to my catalog.xml:

    <reference name="left">
        <block type="catalog/navigation" name="catalog.leftnav" after="currency" template="catalog/navigation/left.phtml"/>
    </reference>
            <reference name="left">
        <block type="catalog/navigation" name="catalog.catdes" after="catalog.leftnav" template="catalog/navigation/description.phtml"/>
    </reference>

And I created this file: catalog/navigation/description.phtml

    <?php
$_helper = $this->helper('catalog/output');
$_category = $this->getCurrentCategory();
   ?>
        <?php if($_description=$this->getCurrentCategory()->getDescription()): ?>
<div class="category-description">
    <?php echo $_helper->categoryAttribute($_category, $_description, 'description') ?>
</div>

There is no result at all. What could I be doing wrong?

like image 629
Benjamin Avatar asked May 06 '13 11:05

Benjamin


People also ask

How do I create a category description in Magento 2?

php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $currentCategory = $objectManager->get('Magento\Framework\Registry')->registry('current_category');//get current category information echo $currentCategory->getId(); echo $currentCategory->getName(); echo $currentCategory->getDescription(); echo ...

How do I change the layout of a category list in Magento 2?

To change the category layout, go to Products -> Categories -> Select your desired Category go to the Design tab and select desired option from the Layout dropdown.


1 Answers

The following solved this issue for me.

echo Mage::getModel('catalog/layer')->getCurrentCategory()->getDescription(); 
like image 184
nickspiel Avatar answered Oct 11 '22 23:10

nickspiel