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)
-   -   Smarty Error: Syntax ? (https://forum.x-cart.com/showthread.php?t=51719)

misterjoeg 01-11-2010 05:39 PM

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>


balinor 01-12-2010 05:27 AM

Re: Smarty Error: Syntax ?
 
It should be {literal} not <literal>

misterjoeg 01-12-2010 06:27 PM

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.

misterjoeg 01-12-2010 09:48 PM

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.

balinor 01-13-2010 05:54 AM

Re: Smarty Error: Syntax ?
 
You need to put literal tags around the external js file code as well.

misterjoeg 01-13-2010 03:59 PM

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.


All times are GMT -8. The time now is 08:47 PM.

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