onlyfordigitalworld
onlyfordigitalworld

Reputation: 129

How do i get category name, description and image in magento?

I want to display the current category name as heading with also name and description about it. I have mentioned my categories in navigation, so whenever I click any navigation category I want to get that as my page heading, description and image.

My code:

$baseUrl = $this->getBaseUrl();
$skinUrl = $this->getSkinUrl();
$_category_detail=Mage::registry('current_category');

?>


<div class="catalog-header">
    <div class="catalog-header_image">

    </div>
    <div class="catalog-header_text">
        <div class="catalog-header_text-content">
            <h1>
                <?php echo $_category_detail->getName(); ?>
            </h1>
            <div class="catalog-header_description">
                <p>
                </p>
            </div>
        </div>
    </div>
</div>

Upvotes: 0

Views: 2594

Answers (1)

OBAID
OBAID

Reputation: 1539

$Category=Mage::getModel('catalog/category')->load($cat);

or

$Category=Mage::registry('current_category');

than you can get details

$name=$Category->getName();
$url=$Category->getUrl();
$image=$Category->getImageUrl()

Upvotes: 2

Related Questions