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?
In stock magento you cant.
There are essentially 3 ways of achieving this, in order of preference (good to bad imo):
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:
Your block class is going to look like this:
and your template class is going to look like this:
3. Use core/template block type
Include on the cms page like so..
Create your template – catalog/category/image.phtml