Try the Demo

Magento Forum

   
Place Javascript Just Under the Opening Body Tag
 
janellez
Jr. Member
 
Total Posts:  15
Joined:  2010-03-08
 

This seems like a simple question but it’s turning out not to be.  Our tag management provider would like us to put their javascript snippet “just under the opening body tag”.  They don’t want it in the footer and they don’t want it in the header (the two places I can reasonably put it myself from within the admin/configuration panel).

We are using the Magento Enterprise template and when I look at design/frontend/enterprise/template/page/html, I see footer.phtml and header.phtml and rss.phtml.

Am I looking in the wrong place?  Can anyone help?

 
Magento Community Magento Community
Magento Community
Magento Community
 
chiefair
Mentor
 
Avatar
Total Posts:  1682
Joined:  2009-06-04
 

Magento has two predefined insertion blocks for this. after_body_start and before_body_end are their names and the referenced post link describes how to add the block and then reference it in the layout so it gets called at the proper time. Use after_body_start

The advantage of using the layout method is that you can have strict control and keep the javascript out of the cart where it may conflict severely with operations and prevent cart function.

http://www.magentocommerce.com/boards/v/viewreply/384445/

 Signature 

-----
1) For preserving thy future happiness, thou shalt back up thy HTTP doc directories and Magento database regularly.
2) For preserving thy sanity during module installs and moves, thou shalt disable thy cache and compiler and flush their caches.

 
Magento Community Magento Community
Magento Community
Magento Community
 
janellez
Jr. Member
 
Total Posts:  15
Joined:  2010-03-08
 

Thank you - I appreciate your answer!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top