sunilvadranapu Posted May 1, 2007 Share Posted May 1, 2007 Hi, I am using smarty templtes for view part in my PHP project. Thing is, if i embed CSS code in smarty templates it is working fine. But if i add an external CSS file in smarty templates, then it is not working. If any one having idea on why it is behaving like that, pls help me. -SunilKumar Link to comment https://forums.phpfreaks.com/topic/49408-how-to-use-external-css-in-smarty-templates/ Share on other sites More sharing options...
jitesh Posted May 1, 2007 Share Posted May 1, 2007 <literal> <style type="text/css"> ........... ........... </style> <script language="javascript"></script> </literal> literal Literal tags allow a block of data to be taken literally. This is typically used around javascript or stylesheet blocks where curly braces would interfere with the template delimiter syntax. Anything within {literal}{/literal} tags is not interpreted, but displayed as-is. If you need template tags embedded in your literal block, consider using {ldelim}{rdelim} to escape the individual delimiters instead. Example 7-13. literal tags {literal} <script type="text/javascript"> <!-- function isblank(field) { if (field.value == '') { return false; } else { document.loginform.submit(); return true; } } // --> </script> {/literal} Link to comment https://forums.phpfreaks.com/topic/49408-how-to-use-external-css-in-smarty-templates/#findComment-242134 Share on other sites More sharing options...
sunilvadranapu Posted May 1, 2007 Author Share Posted May 1, 2007 Thanks for response. But when i add the CSS code in the template file itself it is working Ex: {literal} <script type="text/javascript" src="js/bsn.Ajax.js"></script> <script type="text/javascript" src="js/bsn.DOM.js"></script> <script type="text/javascript" src="js/bsn.AutoSuggest.js"></script> <style type="text/css"> body { font-family: Lucida Grande, Arial, sans-serif; font-size: 10px; text-align: center; margin: 0; padding: 0px; } table { font-size: 10px; } tr { vertical-align: top; } th { background-color: #005988; color: #fff; } th, td { padding: 1px; font-family: Trebuchet MS; font-size: 1.2em; } td { background-color: ; } </style> {/literal} But when i write a separate CSS file and include that CSS file in template file, like Ex: {literal} <link rel="stylesheet" type="text/css" href="test.css" /> {/literal} This is not workig... any idea???? Thanks SunilKumar V Link to comment https://forums.phpfreaks.com/topic/49408-how-to-use-external-css-in-smarty-templates/#findComment-242172 Share on other sites More sharing options...
jitesh Posted May 1, 2007 Share Posted May 1, 2007 This should work <link rel="stylesheet" type="text/css" href="test.css" /> check the path is proper or not May be it is like this <link rel="stylesheet" type="text/css" href="css/test.css" /> Link to comment https://forums.phpfreaks.com/topic/49408-how-to-use-external-css-in-smarty-templates/#findComment-242179 Share on other sites More sharing options...
sunilvadranapu Posted May 1, 2007 Author Share Posted May 1, 2007 thanks for quick response. i will check and let you know Link to comment https://forums.phpfreaks.com/topic/49408-how-to-use-external-css-in-smarty-templates/#findComment-242220 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.