Page 1 of 1

Smarty to javascript. Is it possible?

Posted: Thu Nov 24, 2011 12:59 pm
by sturla69
Hi.

I'm trying to pass some (smarty)variables to a javascript, but cannot find a solution. I'm doing this in a specific module, but I guess the problem is global. Any tips on how to achieve this?

Re: Smarty to javascript. Is it possible?

Posted: Thu Nov 24, 2011 1:05 pm
by uniqu3
And would you mind explaining how you do it?
Where do you use your JavaScript?

{literal}
.... some javasdcript code{/literal}
{$your_smarty_var}
{literal}
.... the rest of your javascript...
{/literal}

or replace all curly brackets in your js { } with {ldelim} and {rdelim}, if it's not a huge chunk of js.

Re: Smarty to javascript. Is it possible?

Posted: Thu Nov 24, 2011 1:23 pm
by sturla69
Of course... the easy and obvious way works.

Thank you so much!