I'm running magento 1.4 and I'm trying to display an overlayer banner on all the pages in my magento store. In which file should I add the code snippet for the banner so that the it gets displayed on all pages? BTW: the code snippet is actually some a short php if function + an OpenX Javascript Tag
Asked
Active
Viewed 713 times
2 Answers
1
From this search:
- Go to
/admin/cms_block/
and add a block. Remember the identifier. - In your code add
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('identifier')->toHtml() ?>
There you go…

Jonas G. Drange
- 8,749
- 2
- 27
- 38
-
I want this to be show site-wider, so how can I apply the block to the whole site? – Bogdan Sep 12 '11 at 09:40
-
`page/html/header.phtml` in the template package you use. – Jonas G. Drange Sep 12 '11 at 13:25
-
unfortunately I don't have access to the ftp where our magento core is installed, is there a way to do this only via magento's backend? – Bogdan Sep 15 '11 at 06:09
-
1You normally do not have to touch the Magento core so I'm assuming you mean the themes and template files. What theme are you using? The theme may already support this, you just have to know what identifier to use. – Jonas G. Drange Sep 15 '11 at 11:31
-
unfortunately it's a very customized template, and it doesn't support this.. but thanks for the help! – Bogdan Sep 19 '11 at 08:55
0
For javascript to be included on every page have a look at page.xml layout <default>
section. For PHP code see which blocks are included on the page and create a block after (or before) one of them

Zifius
- 1,650
- 1
- 16
- 27
-
I figured out how to include JS files, but can you give me a bit more details about how to add a block for the php code? – Bogdan Sep 12 '11 at 09:49
-
there is plenty documentation on this topic, for example http://czetsuya-tech.blogspot.com/2009/05/magentos-block-and-template.html http://www.magentocommerce.com/design_guide/articles/intro-to-layouts – Zifius Sep 12 '11 at 09:58