csplrj Posted June 4, 2007 Share Posted June 4, 2007 I have embedded CSS Tags in my template file and Smarty throws error saying Fatal error: Smarty error: [in register.tpl line 7]: syntax error: unrecognized tag: background-color: #660000; (Smarty_Compiler.class.php, line 446) in \libs\Smarty.class.php on line 1095 I think this happens due to .body{ the opening bracket how to avoid this? Thanks in advance CSJakharia <style type="text/css"><!--/* body { background-color: #660000; } .style29 {font-size: 12px} .style37 {color: #660000; font-weight: bold; font-style: italic; } .style39 {font-size: 12px; color: #666666; } a:link { color: #000000; text-decoration: none; } a:visited { text-decoration: none; color: #000000; } a:hover { text-decoration: none; color: #339966; } a:active { text-decoration: none; color: #000000; } .style11 {font-family: "Times New Roman", Times, serif; font-size: 12px; } .style28 {font-size: 10px; color: #999999; } .style32 {color: #FFFFFF} .style47 { font-family: Georgia, "Times New Roman", Times, serif; font-size: 12px; } body,td,th { font-family: Georgia, Times New Roman, Times, serif; font-size: 12px; } .style48 { color: #FF3300; font-style: italic; } .style49 {font-size: 12px; font-style: italic; color: #FF0000;} */--></style> Quote Link to comment https://forums.phpfreaks.com/topic/54152-embedded-css-tags-in-smarty-template-throws-syntax-error/ Share on other sites More sharing options...
csplrj Posted June 4, 2007 Author Share Posted June 4, 2007 Thanks but I finally got the answer We should use {literal} <script type="text/javascript"> <!-- function isblank(field) { if (field.value == '') { return false; } else { document.loginform.submit(); return true; } } // --> </script> {/literal} The link from where I got http://smarty.php.net/manual/en/language.function.literal.php Bye for now CSJakharia Quote Link to comment https://forums.phpfreaks.com/topic/54152-embedded-css-tags-in-smarty-template-throws-syntax-error/#findComment-267728 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.