solved Twitter widget breaks front page if added

MAD
MAD
@madc
10 years ago
600 posts
I have lots of stuff on my front page
If i add the widget ( tried a lot of ways ) it breaks the page ( either white screen or breaks everything after that ie wont show anything below the edit )

This is the last code I tried but still nothing

{ * Twitter * }
< a class="twitter-timeline" href="https://twitter.com/PunkBP" data-widget-id="434217568581087232" >Tweets by @PunkBP < /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 >

It works on profile pages etc but not the front page
Any ideas?


--
~ https://punkbandpromotions.com ~
Check us out for all your Punk/Alternative Music!
Check us out on Facebook:- https://facebook.com/PunkBandPromotion

updated by @madc: 05/02/14 10:54:00AM
douglas
@douglas
10 years ago
2,791 posts
Have you tried adding the code wrapped in literal tags?

{literal}
    Twitter code here...
{/literal}



--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
MAD
MAD
@madc
10 years ago
600 posts
Yes,
I had it in this

   {capture name="template" assign="twitter_templ"}
     {literal}
< a class="twitter-timeline" href="https://twitter.com/PunkBP" data-widget-id="434217568581087232" >Tweets by @PunkBP < /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 >
       {/foreach}
     {/literal}
   {/capture} 

             <div id="ctv">
               {jrCore_list template=$twitter_templ}
             </div>



--
~ https://punkbandpromotions.com ~
Check us out for all your Punk/Alternative Music!
Check us out on Facebook:- https://facebook.com/PunkBandPromotion
douglas
@douglas
10 years ago
2,791 posts
That isn't going to work...

give this a try:

<div id="ctv">
{literal}
<a class="twitter-timeline" href="https://twitter.com/PunkBP" data-widget-id="434217568581087232">Tweets by @PunkBP </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>
{/literal}
</div>



--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos

updated by @douglas: 03/22/14 06:16:44AM
MAD
MAD
@madc
10 years ago
600 posts
Ok That Worked!!
Great. The anchor tags and script tags have spaces BTW in the code above.
Anyone else with same problem make sure they edit the code to remove the spaces ( Added so the code could be posted here
Thanks @douglas!
Great support...............as usual ;)


--
~ https://punkbandpromotions.com ~
Check us out for all your Punk/Alternative Music!
Check us out on Facebook:- https://facebook.com/PunkBandPromotion
douglas
@douglas
10 years ago
2,791 posts
Or give this a try:

<div id="ctv">
<a class="twitter-timeline" href="https://twitter.com/PunkBP" data-widget-id="434217568581087232">Tweets by @PunkBP </a>
<script>!function(d,s,id){ldelim}var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){ldelim}js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);{rdelim}{rdelim}(document,"script","twitter-wjs");</script>
</div>



--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos

updated by @douglas: 03/22/14 06:16:25AM
douglas
@douglas
10 years ago
2,791 posts
Either way should work, I've actually got the same code I just posted on a clients site and it works well.


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
douglas
@douglas
10 years ago
2,791 posts
MAD©:
Ok That Worked!!
Great. The anchor tags and script tags have spaces BTW in the code above.
Anyone else with same problem make sure they edit the code to remove the spaces ( Added so the code could be posted here

No need to add the spaces anymore, that has been fixed. I modified my two posts to remove the spaces form the code.


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
MAD
MAD
@madc
10 years ago
600 posts
Ok . To follow your edit, I see you used the ldelim and rdelim.
Is that all you changed ( for future reference )
BTW second code worked fine as well


--
~ https://punkbandpromotions.com ~
Check us out for all your Punk/Alternative Music!
Check us out on Facebook:- https://facebook.com/PunkBandPromotion

updated by @madc: 03/22/14 07:11:04AM
douglas
@douglas
10 years ago
2,791 posts
Yes, removed the literal code and changed the { and } to {ldelim} and {rdelim}

Either way should work.


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos

Tags