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

Smarty Error: Syntax ?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-11-2010, 05:39 PM
 
misterjoeg misterjoeg is offline
 

Newbie
  
Join Date: Jan 2010
Posts: 4
 

Default Smarty Error: Syntax ?

I'm hoping someone might be able to point me in the right direction:

I have a JS menu that I'm including via external calls and 2 inline functions in /customer/home.tpl (snippet below). What I'm seeing is this smarty error:

"Error: Smarty error: [in customer/home.tpl line 24]: syntax error: unrecognized tag 'x' (Smarty_Compiler.class.php, line 590) in /var/www/vhosts/********path-to-install/httpdocs/dsbg/include/lib/smarty/Smarty.class.php on line 1093"

The menu appears and operates correctly on the first page load but the error is displayed. Upon a refresh, the error goes away and the menu stops behaving in a normal manner.

Wondering if anyone might be able to point me in the right direction.

Code:
<div id="page-container"> <script language="JavaScript" src="skin1/browserInfo.js" type='text/javascript'></script> <script type='text/javascript'> <literal> function Show() {x = event.clientX + document.body.scrollLeft; y = event.clientY + document.body.scrollTop + 35; Popup.style.display="block"; Popup.style.left = x; Popup.style.top = y; } function Hide() {Popup.style.display="none"; } </literal> </script> <script type="text/javascript" src="skin1/dsbgmenu_var.js"></script> <script type="text/javascript" src="skin1/menu_com.js"></script> <noscript>Your browser does not support script</noscript>
__________________
X-Cart DB Version: 4.3.0 GOLD
Gift Registry
Reply With Quote
  #2  
Old 01-12-2010, 05:27 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Smarty Error: Syntax ?

It should be {literal} not <literal>
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 01-12-2010, 06:27 PM
 
misterjoeg misterjoeg is offline
 

Newbie
  
Join Date: Jan 2010
Posts: 4
 

Default Re: Smarty Error: Syntax ?

Thanks Padraic. I gave that a try too and while the error goes away, it renders the menu non functional.

I actually took out that inline function block so it's now only

<code>
<script type="text/javascript" src="skin1/browserInfo.js"></script>
<script type="text/javascript" src="skin1/dsbgmenu_var.js"></script>
<script type="text/javascript" src="skin1/menu_com.js"></script>
<noscript>Your browser does not support script</noscript>
</code>

When not included in a smarty template, the menu renders as it should. As soon as I include it in the template, it breaks.

I'm guessing that my problem may have more to do with conflicting JS instead of a parsing error.
__________________
X-Cart DB Version: 4.3.0 GOLD
Gift Registry
Reply With Quote
  #4  
Old 01-12-2010, 09:48 PM
 
misterjoeg misterjoeg is offline
 

Newbie
  
Join Date: Jan 2010
Posts: 4
 

Default Re: Smarty Error: Syntax ?

Can anyone recommend a tool that will pull in a list of all JS functions (on page and external calls) that are in use when a page loads? I was thinking firebug did this but it clearly does not.
__________________
X-Cart DB Version: 4.3.0 GOLD
Gift Registry
Reply With Quote
  #5  
Old 01-13-2010, 05:54 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Smarty Error: Syntax ?

You need to put literal tags around the external js file code as well.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #6  
Old 01-13-2010, 03:59 PM
 
misterjoeg misterjoeg is offline
 

Newbie
  
Join Date: Jan 2010
Posts: 4
 

Default Re: Smarty Error: Syntax ?

Hi Padraic,

I've reduced it to this:

{literal}
<script type="text/javascript" src="skin1/browserInfo.js"></script>
<script type="text/javascript" src="skin1/dsbgmenu_var.js"></script>
<script type="text/javascript" src="skin1/menu_com.js"></script>
{/literal}

and still no success. I get no parse error but the menu is compressed and jammed into the upper left corner in a small pile.
__________________
X-Cart DB Version: 4.3.0 GOLD
Gift Registry
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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:05 AM.

   

 
X-Cart forums © 2001-2020