cancel
Showing results for 
Search instead for 
Did you mean: 

How to move category description ?

How to move category description ?

Hey

i need some help to get category  description to the bottom of the category.

in my

app/design/frontend/YOURTHEME/default/template/catalog/product/list.phtml

i have add this line of code 

echo Mage::getModel('catalog/layer')->getCurrentCategory()->getDescription();

at the bottom. 

and yes my text is moving down to bottom. 

but its also on my top. 

what can i do to remove it from the top ? 

3 REPLIES

Re: How to move category description ?

Hi Compit

 

The category description is in another template filer, more specifically catalog/category/view.phtml on line 56 through 60. This file might not be in your template, but it will be in base/default, but to overwrite it you should make a copy of it and move it to your template. If you don't you won't be able to upgrade your store.

 

You will possibly get an error using this method since catalog/product/list.phtml is now depended on Mage::getModel('catalog/layer')->getCurrentCategory(), to be an object.

 

The simple way to avoid this is to a small if statement arond your currently code:

 

<?php if(Mage::getSingleton('catalog/layer')->getCurrentCategory()) : ?>

    <div class="std>

         <?php echo Mage::getSingleton('catalog/layer')->getCurrentCategory()->getDescription(); ?>

    </div>

<?php endif; ?>

 

Also note that i changed the Mage::getModel to Mage:getSingleton to avoid loading more content then what is needed.

 

To make this a bit more proper you might want to take a look at the following link to learn how Magento's Layout work.

 

http://www.magentocommerce.com/knowledge-base/entry/magento-for-dev-part-4-magento-layouts-blocks-an...

Re: How to move category description ?

Hey 

Thanks for your answer

I dont have catalog/category/view.phtml  its just catalog/view.phtml

Re: How to move category description ?

What theme are you using? It looks like someone accidentally copied a file to the wrong place. If your theme doesn't have catalog/category/view.phtml than copy it over from app/code/design/frontend/base/default/catalog/category/view.phtml

Chris / Placement Edge