Magento Forum

   
How to add a script in header.phtml ?? 
 
messned
Jr. Member
 
Total Posts:  4
Joined:  2010-07-29
 

Hi,

First of all im from holland so my english is not that good.

I try to explain my problem:
Recently i have bought a extension so i have googletranslate on my webshop.
Now i installed it and all is done correctly only my seller wont help me out to get it working in my custom theme.
He only today have told me to do this:

Hello,

Our Tech Support just told me to add this code in your theme’s header.phtml (app/design/frontend/default/yourtheme/template/page/html):

<?php echo $this->getChildHtml('googletranslate') ?>

It must be anywhere inside <div class=”header”> container.

Regards,

VJ Templates

Now i want to know where i need to add this code in my header.phtml so it will be displayed correctly before my currency dropdown menu.
Here is my header.phtml file:

<div class="top container">
  <
div class="shopLinks">
    <
div class="row">
      <
div class="span4">
      <
div class="lan-cur"><?php echo $this->getChildHtml('store_language'?><?php echo $this->getChildHtml('store_currency_selector'?></div></div>
      <
div class="span8"<?php echo $this->getChildHtml('topLinks'?> </div>
      
<?php /*?><p class="welcome-msg"><?php echo $this->getWelcome() ?><?php echo $this->getAdditionalHtml() ?></p><?php */?>
    
</div>
  </
div>
  <
div class="header-container">
    <
div class="header">
      <
div class="row">
        
<?php if ($this->getIsHomePage()):?>
        
<div class="span4">
          <
div class="logo"><strong><?php echo $this->getLogoAlt() ?></strong><a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>"><img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" /></a></div>
        </
div>
        
<?php else:?>
        
<div class="span4">
          <
div class="logo"><a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>"><strong><?php echo $this->getLogoAlt() ?></strong><img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" /></a></div>
        </
div>
        
<?php endif?>
        
<div class="span8">
          <
div class="shop-info">
          <
div class="shoppingCart"><?php echo $this->getChildHtml('topcart'); ?></div>
          
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('top_info')->toHtml(); ?>
          
</div>
          <
div class="user-search">
          
<?php echo $this->getChildHtml('topContainer'); ?> <?php echo $this->getChildHtml('topSearch'?>
          
<div class="welcome-to"><?php echo $this->getWelcome() ?></div>
          </
div>
        </
div>
         </
div>
    </
div>
    
<?php echo $this->getChildHtml('topMenu'?> </div>
  
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('social')->toHtml(); ?> </div>

Let me know how to add this thanks in advice!

 
Magento Community Magento Community
Magento Community
Magento Community
 
happy_shopper
Jr. Member
 
Avatar
Total Posts:  29
Joined:  2008-10-29
the Netherlands
 

Hi, I think it’s depending on where you want the dropdown with the languages to appear. But you can try to place it under the “toplinks” div. If it’s not good there you can always place it with css.

 
Magento Community Magento Community
Magento Community
Magento Community
 
messned
Jr. Member
 
Total Posts:  4
Joined:  2010-07-29
 

Hi its not showing correctly and i was seeing that u are from the netherlands to maybe u can help my out though skype maybe.

here is whats happening right now the language dropdown and my login for facebook connect will not center like the rest of the links.

ty

Image Attachments
screen.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
 
happy_shopper
Jr. Member
 
Avatar
Total Posts:  29
Joined:  2008-10-29
the Netherlands
 

sorry, I was on Holliday. Still need help?
Did you put the code behind the closing tag of the “div”

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