Embed twitter widget at ArcGIS Hub page

1083
1
07-26-2018 06:52 AM
IrisTheunisse
New Contributor

How do I embed a twitter widget on my ArcGIS Hub page. I saw the following example:

I followed the steps found on "It Still Works" to get a twitter widget with a html code that looks like this:

<a class="twitter-timeline"  href="https://twitter.com/...." data-widget-id="....">Tweets from ...</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's not clear to me what to do with this code. Should I use a testbox and copy paste this code into this box or should I use an iFrame and use part of this code? I tried both ways bud didn't manage to get Twitter on my page. Is there an example of how the url should look like when using a iFrame?

0 Kudos
1 Reply
BrianRollison
Esri Contributor

Hi Iris,

The Twitter embed widget used custom embedded javascript, which we do not support directly on our pages; therefore, we recommend the following...

  1. Host the embed widget on a separate web page
  2. Drag and drop an iFrame card onto your Hub page
  3. Copy/paste the URL of the external web page into the iFrame card

Unfortunately, allowing customers to embed their own javascript onto Hub pages would potentially result in multiple collisions which may lead to the page no longer functioning.

We are actively researching a more fluid way for users to simply copy/paste the URL of a timeline/collection/etc. into a social media card on the site editor.  We expect work to begin on this functionality relatively soon.

Thanks for reaching out!

Brian

Product Engineer, ArcGIS Hub

0 Kudos