Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

If/Then Statment in Body Tag

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-09-2007, 02:44 PM
 
1day2004 1day2004 is offline
 

Senior Member
  
Join Date: Dec 2004
Posts: 115
 

Default If/Then Statment in Body Tag

I currently have the following in my body tag:

Code:
body onLoad="MM_preloadImages('../images/navigation1.gif','../images/navigation2.gif')"

I have Google Analytics and want to add this into the body tag:

Code:
{if $body_onload ne '' or $smarty.get.mode eq "order_message"} onload="{if $smarty.get.mode eq "order_message"}javascript:__utmSetTrans();{/if}{$body_onload}"{/if}

If I simply add the 2 codes together like this:

Code:
body onLoad="MM_preloadImages('../images/navigation1.gif','../images/navigation2.gif')" ]{if $body_onload ne '' or $smarty.get.mode eq "order_message"} onload="{if $smarty.get.mode eq "order_message"}javascript:__utmSetTrans();{/if}{$body_onload}"{/if}

I will have 2 onload events on the order_message page.


What is the proper method of merging these together?
__________________
Version 4.0.8 Live
Reply With Quote
  #2  
Old 01-09-2007, 09:18 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default Re: If/Then Statment in Body Tag

Try this:

Code:
onload="MM_preloadImages('../images/navigation1.gif','../images/navigation2.gif');{if $smarty.get.mode eq "order_message"} javascript:__utmSetTrans();{/if}{if $body_onload ne ""} {$body_onload}{/if}"
Reply With Quote
  #3  
Old 01-10-2007, 02:52 PM
 
1day2004 1day2004 is offline
 

Senior Member
  
Join Date: Dec 2004
Posts: 115
 

Default Re: If/Then Statment in Body Tag

Perfect Jon, worked great.

Thanks.
__________________
Version 4.0.8 Live
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 10:59 AM.

   

 
X-Cart forums © 2001-2020