Skip to content

Instantly share code, notes, and snippets.

@tim-reynolds
Created March 27, 2012 14:26
Show Gist options
  • Save tim-reynolds/2216374 to your computer and use it in GitHub Desktop.
Save tim-reynolds/2216374 to your computer and use it in GitHub Desktop.
Magento: Change company logo for specific CMS page
<!--
--Tim Reynolds (@razialx) 2012 - Do whatever you want license -
--
--If you need to change the company logo on a specific page you can do this easily using
--Layout Update XML. On the CMS page editor in the Magento Admin, go to the Design tab
--on the left. There will be a large text area labeled 'Layout Update XML'
--
--Insert the following XML into it.
--
--This is using Layout actions to call the method setLogo(src,alt) on the Block class
--Mage_Page_Block_Html_Header (/app/code/code/Mage/Page/Block/Html/Header.php)
--
--This can also be used in your layout XML files. If you wanted a different logo on
--Product View pages for example, wrap the code below with:
-- <catalog_product_view> ... </catalog_product_view>
--in your Layout XML file.
--
--Special thanks to Nicole for asking me about this.
-->
<reference name="header">
<action name="setLogo">
<src>{path to image file under your Skin directory. Example: images/alt-logo.jpg}</src>
<alt>{Alt text for the logo}</alt>
</action>
</reference>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment