I have magento 1.9.1 with the theme "trego". On the home page I have black background, there I want to use a logo with white color, the product pages have white background, there I require a logo with black color.
how can I use different logos for different pages?
Example logo code:
<a href="http://example.com/" title="Magento Commerce" class="logo"><img src="http://example.com/skin/frontend/default/trego/images/logo.png" alt="Magento Commerce"></a>
Best Answer
You will deal with templates and the
local.xml
file, which you can create under your theme folder.I will assume some configurations:
app/skin/frontend/rwd/yourtheme/
;local.xml
file insideapp/skin/frontend/rwd/yourtheme/layout
;header.phtml
file inapp/skin/frontend/rwd/default/template/page/html/
;.phtml
files, each one with the HTML for the corresponding logo:whitelogo.phtml
andblacklogo.phtml
;So, first you copy the
header.phtml
from the above dir intoapp/skin/frontend/rwd/yourtheme/template/page/html/
and edit it: put<?php echo $this->getChildHtml("logo"); ?>
in header where you want the logo to appear.Copy the
whitelogo.phtml
andblacklogo.phtml
also in this same directory.Then you edit the
local.xml
file:And this should work. In your homepage you will have the white logo and in the product page the other logo.