Error in Twitter Follow Link

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
CRSounds
Forum Members
Forum Members
Posts: 32
Joined: Sun Apr 28, 2013 6:31 pm

Error in Twitter Follow Link

Post by CRSounds »

Can anyone point me in the right direction please?
I'm trying to add a follow me on twitter link to my site.
I am pasting the html from twitter into a brand new page on its own at the moment but I keep getting an error.
The code I am pasting is as follows:

Code: Select all

<a href="https://twitter.com/CRSounds" class="twitter-follow-button" data-show-count="false" data-show-screen-name="false">Follow @CRSounds</a>
<__script__>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</__script>
That is all that is on the page at the moment.
When I try to open the page I get the following:

Code: Select all

Error: at line 3 in file /home/crsou730/public_html/lib/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php:

Code: Select all

Syntax error in template "content:content_en"  on line 3 "!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');" unknown tag "var"
Any pointers greatly appreciated.

Regards
Clive
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: Error in Twitter Follow Link

Post by Rolf »

Add space before and after all { and } in your code or use literal tags
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
CRSounds
Forum Members
Forum Members
Posts: 32
Joined: Sun Apr 28, 2013 6:31 pm

Re: Error in Twitter Follow Link

Post by CRSounds »

Thanks Rolf, well spotted :) .
I just copied and pasted from the twitter help page and assumed they would have it right. Bad move on my part ::) .
Thanks again. Help much appreciated.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Error in Twitter Follow Link

Post by velden »

Twitter is right of course. They don't know you're going to use it inside a Smarty template which uses the curly braces for its tags.
CRSounds
Forum Members
Forum Members
Posts: 32
Joined: Sun Apr 28, 2013 6:31 pm

Re: Error in Twitter Follow Link

Post by CRSounds »

Ah, thanks Velden. That explains it.
Post Reply

Return to “The Lounge”