X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   If/Then Statment in Body Tag (https://forum.x-cart.com/showthread.php?t=27903)

1day2004 01-09-2007 02:44 PM

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?

Jon 01-09-2007 09:18 PM

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}"

1day2004 01-10-2007 02:52 PM

Re: If/Then Statment in Body Tag
 
Perfect Jon, worked great.

Thanks.


All times are GMT -8. The time now is 04:02 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.