Jump to content

a tpl question


gwhosting

Recommended Posts

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

Link to comment
Share on other sites

<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}

Link to comment
Share on other sites

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 } )

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated