gwhosting Posted October 22, 2009 Share Posted October 22, 2009 good day; I have the below code in my footer.tpl file, and i'm curious why pray tell it might not be working? Can you not put this type of code in .tpl files and whmcs not be able to call it? <h3>Twitter updates</h3> <script src="http://widgets.twimg.com/j/2/widget.js"></script> <script> new TWTR.Widget({ version: 2, type: 'profile', rpp: 4, interval: 6000, width: 250, height: 300, theme: { shell: { background: '#333333', color: '#ffffff' }, tweets: { background: '#000000', color: '#ffffff', links: '#4aed05' } }, features: { scrollbar: false, loop: false, live: true, hashtags: true, timestamp: true, avatars: false, behavior: 'default' } }).render().setUser('gwhosting').start(); </script> the error that is given is below: Fatal error: Template error: [in custom/footer.tpl line 6]: syntax error: unrecognized tag: version: 2, type: 'profile', rpp: 4, interval: 6000, width: 250, height: 300, theme: { shell: { background: '#333333', color: '#ffffff' (Smarty_Compiler.class.php, line 439) in /home/mbabcock/public_html/whmcs/includes/smarty/Smarty.class.php on line 1095 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted October 23, 2009 Share Posted October 23, 2009 use {literal}...{/literal} tags around the script 0 Quote Link to comment Share on other sites More sharing options...
gwhosting Posted October 23, 2009 Author Share Posted October 23, 2009 hi; thanks so when do i use the {literal} tags? 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted October 23, 2009 Share Posted October 23, 2009 <h3>Twitter updates</h3> <script src="http://widgets.twimg.com/j/2/widget.js"></script> {literal} <script> new TWTR.Widget({ version: 2, type: 'profile', rpp: 4, interval: 6000, width: 250, height: 300, theme: { shell: { background: '#333333', color: '#ffffff' }, tweets: { background: '#000000', color: '#ffffff', links: '#4aed05' } }, features: { scrollbar: false, loop: false, live: true, hashtags: true, timestamp: true, avatars: false, behavior: 'default' } }).render().setUser('gwhosting').start(); </script> {/literal} 0 Quote Link to comment Share on other sites More sharing options...
gwhosting Posted October 23, 2009 Author Share Posted October 23, 2009 wow sparky, your very helpful. What i mint to say though, is how often do i need to use the {literal}, i see where i use it in this code, do i use those tags by any script code, or is there any "reason" for the use of that tag? Pardon the ignorance! 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted October 23, 2009 Share Posted October 23, 2009 if within the <script>...</script> tags there are any curly braces { } then you need to put that part within the {literal} tags because smarty uses the curley braces when it compiles the template to replace the varials or commands within the braces. The other option is to replace the braces within the <script> tags with {ldelim} ( for { ) and {rdelim} ( for } ) 0 Quote Link to comment Share on other sites More sharing options...
gwhosting Posted October 23, 2009 Author Share Posted October 23, 2009 hi; thanks a lot, the admins can close this thred if they would like. mike 0 Quote Link to comment 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.