I want to add images to top navigation menu, I use this code:
app/code/local/Mage/Catalog/Model/Observer.php
$categoryData = array(
'name' => $category->getName(),
'id' => $nodeId,
'url' => Mage::helper('catalog/category')->getCategoryUrl($category),
'is_active' => $this->_isActiveMenuCategory($category),
'thumbnail' => Mage::getModel('catalog/category')->load($category->getId())->getImage()
);
and this:
app/code/local/Mage/Page/Block/Html/Topmenu.php
$urls = Mage::getBaseUrl('media').'catalog/category/'.$child->getData('thumbnail');
$img = '<img class="img-responsive" src="'.$urls.'" />';
$html .= '<li ' . $this->_getRenderedMenuItemAttributes($child) . '>';
$html .= '<a href="' . $child->getUrl() . '" ' . $outermostClassCode . '><span>'
. $this->escapeHtml($child->getName()) . '</span>'.$img.' </a>';
The images are in the menu and everything work fine but in the frontend I see this error:
"NetworkError: 404 Not Found - http://example.com/media/catalog/category/"
What is wrong?