Twitter Embedded content does not always appear

Hi folks,

I have a little issue with embedded contents on this website I built on Webflow: http://onetribe.webflow.io/. It’s a Facebook video and several tweets.

Embedded contents takes team to appear and some times and doesn’t even appear. It depends, to make the test just reload the page several times.

Any ideas? Let me know if you need more information.

Cheers!

It’s pretty fast for me, and embedded content loads every time.

Nice fresh and effective layout BTW :slight_smile:

Hi @laurentdesserre, like @vincent, the embeds load for me every time also, but I think this might be related to speed and quality of net connection.

I think in this case, since you have 21 separate embeds, with separate embed code for each, there is greater possibility some may not render in all cases because things don’t sync properly with the twitter calls.

That is a lot of twitter embeds to put on a page :wink:

One thing you can do to help things, is to not call the twitter widgets.js script with each embed:

Rather, put a single script in the Footer of the page, using custom code, to call the widgets.js script. See this article: JavaScript API | Docs | Twitter Developer Platform

The script in the Footer in the custom code tab, would have this placed at the very beginning of the Footer panel:

<script>window.twttr = (function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0],
    t = window.twttr || {};
  if (d.getElementById(id)) return t;
  js = d.createElement(s);
  js.id = id;
  js.src = "https://platform.twitter.com/widgets.js";
  fjs.parentNode.insertBefore(js, fjs);
 
  t._e = [];
  t.ready = function(f) {
    t._e.push(f);
  };
 
  return t;
}(document, "script", "twitter-wjs"));</script>

I hope this gives you some ideas :slight_smile: Cheers,
Dave

Hi @cyberdave!

Thank you so much for your answer :smile: There are definitely a lot of embedded tweets on this single page haha :blush:

I just added the script in the footer in the custom code tab but it doesn’t sound to reduce the time to load, or to ensure those tweets to appear every time.

Also, the Facebook video on the Hero Header sometimes does not appear AT ALL :confused:

Let me know guys ! Have great week :smile:

Hi @laurentdesserre, thanks for the update. I can see you have the twitter widget.js call in the footer, but I also show it in the embed.

Could you share the read-only link: Share a read-only link | Webflow University

or paste the full embed code from one of the embeds so I can see if that script is still being included?

Cheers,
Dave

Yeah I know :relaxed: How can I deleted it?

Here are the Read-only link: Webflow - Tribe™ - Magical Messaging

Thanks @cyberdave :smile:

Hi @laurentdesserre, in each embed, just make a change and remove the script part :slight_smile:

Instead of:

<blockquote class="twitter-tweet" lang="en"><p lang="en" dir="ltr">Why. Do. I. Make. So. Many. Spelling. Mistakes.</p>&mdash; Matthew Santoro (@MatthewSantoro) <a href="https://twitter.com/MatthewSantoro/status/632247192439230465">August 14, 2015</a></blockquote>
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>

Remove the script part:

<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>

You have remaining:

<blockquote class="twitter-tweet" lang="en"><p lang="en" dir="ltr">Why. Do. I. Make. So. Many. Spelling. Mistakes.</p>&mdash; Matthew Santoro (@MatthewSantoro) <a href="https://twitter.com/MatthewSantoro/status/632247192439230465">August 14, 2015</a></blockquote>

Do that for each embed :smile:

If you have issues, then try and put the script that is in the footer, in the Head.

Let me know when you update, so I can check also :smile:

Cheers,
Dave

Thanks @cyberdave ! I’ve just done it. It’s better, but you can try on Safari. Only 50% of the website is loading…

Hi @laurentdesserre, for me at least, all is loading. You might want to try and refresh your browser a few times and see if that helps.

It seems to load a lot faster for me now. I will check this again in a little while :slight_smile:

Cheers,
Dave

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.