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

Rollover Tags?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 10-15-2003, 12:58 PM
 
Griswold Griswold is offline
 

Newbie
  
Join Date: Oct 2002
Location: Springfield, MO
Posts: 8
 

Default Rollover Tags?

I was trying to implement some javascript rollovers in my head.tpl file.
Everytime I do, it blows up the page. I used the {integral} tags around the rollovers themselves and it goes bam!
Any ideas?
Reply With Quote
  #2  
Old 10-15-2003, 02:36 PM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

{integral} or {literal}
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #3  
Old 10-29-2003, 05:32 PM
 
narisc narisc is offline
 

Newbie
  
Join Date: Oct 2003
Posts: 5
 

Default

wait im lost do you need to put

the acutall code

{integral} in between the javascript coding or what?
Reply With Quote
  #4  
Old 10-30-2003, 08:46 AM
 
moshguy moshguy is offline
 

Advanced Member
  
Join Date: May 2003
Location: York, PA USA
Posts: 40
 

Default Suggestion

Create a separate TPL file for the javascript that goes in the head of the document. Name it something like javascript_header.tpl and include it customer/home.tpl. It worked great for me.

Second always use {literal}{/literal} tags around any Javascript functions. The reason is that JavaScript uses {} to declare functions. Smarty will interpret it as smarty and not JS. Which is one of the reasons why it keeps blowing up.

This is what your javascript_header.tpl should look like.

Code:
{literal} <script language="JavaScript""> function showStatusMsg(msgStr) { status=msgStr; document.BigValue = true; } </script> {/literal}

This is what your customer/home.tpl should look like.

Code:
<html> <head> <title>My site</title> { include file="javascript_header.tpl" } </head>

I do have a working example of JS image rollovers on my current X-Cart store.
http://www.angelcycleworld.com/cart/customer

NOTE: Don't try to use a JS file. For some reason IE doesn't like a JS file in smarty.

I sure hope this helps you guys out.

-Jeremy
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 09:15 AM.

   

 
X-Cart forums © 2001-2020