[SOLVED] Adding twitter widget/JS causes error..

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
meatPopsicle
New Member
New Member
Posts: 6
Joined: Mon Jun 17, 2013 9:59 am

[SOLVED] Adding twitter widget/JS causes error..

Post by meatPopsicle »

Hi again guys, I've been trying to add a bit of twitter code to my template, but it causes a bit of a problem.

I'm trying to add this:

Code: Select all

<div style="width: 200px;">
    <a class="twitter-timeline"  href="https://twitter.com/QueensTaunton"  data-widget-id="354565331076907008">Tweets by @QueensTaunton</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>

</div>
...
but when I hit the apply button this pops up:

Code: Select all

Syntax Error in template "globalcontent:twitta" 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");" - Unexpected ",", expected one of: "}" , " " , ATTR
I know that the code works, as I have two servers to play with and it functions well when thrown into a plain page of its own (outside of CMSMS), but CMSMS seems to dislike it!

I've also tried adding the code as a global content block, but that gives the same response.

Am I missing something simple/obvious here?

Many thanks,
Fred
Last edited by meatPopsicle on Tue Jul 09, 2013 2:09 pm, edited 1 time in total.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: Adding twitter widget/JS causes error..

Post by Rolf »

- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
meatPopsicle
New Member
New Member
Posts: 6
Joined: Mon Jun 17, 2013 9:59 am

Re: Adding twitter widget/JS causes error..

Post by meatPopsicle »

Fantastic - worked like a charm :)

Thank you very much Rolf!
meatPopsicle
New Member
New Member
Posts: 6
Joined: Mon Jun 17, 2013 9:59 am

Re: Adding twitter widget/JS causes error..

Post by meatPopsicle »

It's not a big problem, but how long do my posts need to be moderated for as a new user?

Thanks,
Fred
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: [SOLVED] Adding twitter widget/JS causes error..

Post by calguy1000 »

It's currently 5.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Post Reply

Return to “Modules/Add-Ons”