Pure Software Knowledge Base Glossary    Contact Us
 
   
Browse by Category
Pure Software Knowledge Base > Lore > Troubleshooting > Smarty/Template Problems > Why do I get Smarty template errors where I have JavaScript/CSS code?

Why do I get Smarty template errors where I have JavaScript/CSS code?

Smarty recognizes several types of tags, some of which can be within JavaScript or CSS code. Since you do not want Smarty to try to parse the JavaScript or CSS as Smarty template code, you need to surround the offending code in {literal} {/literal} tags. Example:

{literal}
<script language="JavaScript" type="text/javascript">
// code here
</script>

<style type="text/css">
/* css here */
</style>

{/literal}


How helpful was this article to you?

Related Articles

Why do I get Smarty template errors where I have PHP code?
In order to use PHP code within the Smarty templates, you either have to...

 
Do you provide code customization services?
No, we do not provide code customization services at this time, whether...

 
Why don't my template changes show up?
Smarty compiles the templates into PHP code and caches them. When you...

 

User Comments

No comments have been posted.


powered by Lore