Page 1 of 1

How to include javascript file

Posted: Sat Oct 14, 2006 7:54 am
by pralay
Hi,
I am to include javascript file in the template......now i know that I am to write it like this
{literal}

{/literal}

Now when I am doing this inside the head tag it's ok.
But placing inside the body of the template it is producing smarty error...

string(118) "Smarty error: [in template:22 line 91]: syntax error: unrecognized tag 'literal' (Smarty_Compiler.class.php, line 583)" string(118) "Smarty error: [in template:22 line 93]: syntax error: unrecognized tag 'literal' (Smarty_Compiler.class.php, line 583)"


How can I do that? Is there a way to include js file inside the body of the template or always I have to make it included in head tag?

Please help

Re: How to include javascript file

Posted: Sat Oct 14, 2006 12:49 pm
by tsw
actually including js like that doesnt need {literal} tags.

literal is only needed if the content inside it has { or } characters. its smarty way of telling here starts a block you shouldnt touch. in your situtation there is only plain html and the script inclusion is done by browser...


but why you literal tag doesnt work beats me, did you check that all files are uploaded correctly and config.php has all right paths..

Re: How to include javascript file

Posted: Sun Oct 15, 2006 5:51 pm
by cyberman
Don't know if I'm right but it isn't {literal} a Smarty tag so it must allowed in config.php ?

Code: Select all

$config['use_smarty_php_tags'] = true;

Re: How to include javascript file

Posted: Sun Oct 15, 2006 8:18 pm
by tsw
that config is for smarty php tag {php} {/php}

Re: How to include javascript file

Posted: Mon Oct 16, 2006 4:51 am
by cyberman
OK, thx.