In earlier versions of Magento, there was a category thumbnail attribute that Magento provided so you could add a thumbnail image to a category in the Catalog -> Manage Categories
section.
However, as of Magento CE 1.9.1.0, the thumbnail attribute has disappeared. So where have the category thumbnails in Magento gone?
Looking closer at the code, we can see that the thumbnail attribute is added as part of the Mage_XmlConnect
module in Magento. This module’s <active>
node is set to true
in version 1.9.0.1 but false
in 1.9.1.0.
A thumbnail
attribute is added within the Mage_XmlConnect
‘s install script.
// app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-install-1.4.0.8.php
<?php
$installer = $this;
....
$installer->addAttribute('catalog_category', 'thumbnail', array(
'type' => 'varchar',
'backend' => 'catalog/category_attribute_backend_image',
'frontend' => '',
'label' => 'Thumbnail Image',
'input' => 'image',
'class' => '',
'source' => '',
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
'visible' => true,
'required' => false,
'user_defined' => false,
'default' => '',
'searchable' => false,
'filterable' => false,
'comparable' => false,
'visible_on_front' => false,
'unique' => false,
));
....
$installer->endSetup();
There are a couple of methods to re-add the attribute back into Magento.
The first method is to re-enable Mage_XmlConnect
, clear the cache and refresh any page on your Magento store to allow Magento to run the setup script, and therefore add the thumbnail
attribute to the database.
Then disable the extension straight afterwards, and the category thumbnail attribute will remain as an attribute on the Manage Categories page in the admin.
Even though it is a temporary change to the core code, if you do not wish to do this method then you can add a category attribute using a custom module.
If you choose to add a thumbnail attribute using a custom module, it is probably worth using a different attribute_code
, such as custom_thumbnail
, to the one Magento uses for the thumbnail (thumbnail
). This is so that if Magento were to reintroduce the Mage_XmlConnect
module, any issues with using duplicate attribute codes would be avoided.
It is not known why the category attribute was included within the Mage_XmlConnect
module. The module was initially created for connecting Magento with mobile application using XML requests and responses, so it’s possible that the thumbnail images were intended to be used as logos within mobile applications.
Note: This article is based on Magento CE version 1.9.