Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8337579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:20:26+00:00 2026-06-09T04:20:26+00:00

Is there a way to display a category image by it’s category id in

  • 0

Is there a way to display a category image by it’s category id in a CMS page?

You can display a category link by id with:

{{widget type="catalog/category_widget_link" anchor_text="Displayed Text" title="Title attribute text" template="catalog/category/widget/link/link_block.phtml" id_path="category/22"}}

Or display category products by it’s id.

{{block type="catalog/product_list" category_id="14" template="catalog/product/list.phtml"}}

But I can’t figure out hwo to display a specific categories image in a CMS page just by calling it’s id.

Any idea?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T04:20:28+00:00Added an answer on June 9, 2026 at 4:20 am

    In stock magento you cant.

    There are essentially 3 ways of achieving this, in order of preference (good to bad imo):

    1. Create and use a widget
    2. Embed directly in cms page and use a custom block type for initialising the category
    3. Embed directly in a cms page, use core/template block type and initialise category inside the template directly

    1. Use a widget

    I have previously answered a similar question and provided a complete example on how to build such a widget specific to a category:

    magento – category name and image in static block?


    2. Custom module

    You nned to create a module with a block to support this. You can then just include the block in cms pages using the following syntax:

    {{block type="yourmodule/category_image" category_id="14" template="yourmodule/category/image.phtml"}}
    

    Your block class is going to look like this:

    <?php
    
        class Yourcompany_Yourmodule_Block_Category_Image extends Mage_Core_Block_Template
        {
            public function getCategory()
            {
                if (! $this->hasData('category')) {
                    $category = Mage::getModel('catalog/category')->load($this->getData('category_id'));
                    $this->setData('category', $category);
                }
                return $this->getData('category');
            }
        }
    

    and your template class is going to look like this:

    <?php
    
    $_helper    = $this->helper('catalog/output');
    $_category  = $this->getCategory();
    $_imgHtml   = '';
    if ($_imgUrl = $_category->getImageUrl()) {
        $_imgHtml = '<p class="category-image"><img src="'.$_imgUrl.'" alt="'.$this->htmlEscape($_category->getName()).'" title="'.$this->htmlEscape($_category->getName()).'" /></p>';
        $_imgHtml = $_helper->categoryAttribute($_category, $_imgHtml, 'image');
    }
    
    ?>
    
    <?php if($_imgUrl): ?>
        <?php echo $_imgHtml ?>
    <?php endif; ?>
    

    3. Use core/template block type

    Include on the cms page like so..

    {{block type="core/template" category_id="14" template="category/image.phtml"}}
    

    Create your template – catalog/category/image.phtml

    <?php
    $_helper   = $this->helper('catalog/output');
    $category  =  Mage::getModel('catalog/category')->load($this->getData('category_id'));
    $_imgHtml  = '';
    if ($_imgUrl = $_category->getImageUrl()) {
        $_imgHtml = '<p class="category-image"><img src="'.$_imgUrl.'" alt="'.$this->htmlEscape($_category->getName()).'" title="'.$this->htmlEscape($_category->getName()).'" /></p>';
        $_imgHtml = $_helper->categoryAttribute($_category, $_imgHtml, 'image');
    }
    
    ?>
    
    <?php if($_imgUrl): ?>
        <?php echo $_imgHtml ?>
    <?php endif; ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to display an image in the reminder notification page for
Is there a way to display a node label centered inside the node such
Is there a way to display flash applications using Gnash renderer (I'm not averse
is there a way to display the animated spinning wheel while the main thread
Is there a way to display and edit values in the PropertyGrid (and his
Is there a way to display an action-specific authorisation message for when an [Authorize]
Is there a way to display the dropdown menu shown on sitepoint by mouse
I just wonder there a way to display the files in document directory with
When viewing submitted changelists in p4v, is there a way to display a particular
Is there any way to output/display information from a MATLAB program without an ending

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.