How to embed Share the Facts widgets in articles and blog posts
The Share the Facts widget can be embedded in articles and blog posts just like tweets. So if you’re a writer or editor who publishes articles about politics, you can embed the widgets, which summarize fact-checks in a concise way.
This gives you the opportunity to show multiple fact-checks from a single event, such as a debate or political convention, or to include several widgets when you are discussing a candidate.
There are two ways to embed widgets in your articles and blog posts: using oEmbed, which is supported by WordPress and many other content management systems; or using a short embed code.
oEmbed – The easiest way to embed the Share the Facts widget is to use oEmbed. Once it’s set up for your CMS, you will likely be able to just copy and paste the URL for the widget(s) you’d like to feature. (Since each CMS is different, you may need to consult sources specific to your site for details.)
To use oEmbed for our widget, your developer or IT team will typically need to whitelist sharethefacts.co. WordPress users can find instructions here. Non-WordPress oEmbed users may need to enable script execution, depending on your site’s implementation.
Once sharethefacts.co has been whitelisted, you can just click “Share” and “Embed” on the widget you want to feature, and copy the oEmbed URL into your story. Make sure the URL is on its own line.
If you run into problems with oEmbed, contact Erica Ryan, the widget project manager for the Duke Reporters’ Lab.
Short embed code – Using the short embed code is also simple, but it requires your developer or IT team to place a snippet of code in the template for your site.
Once the code is in the template, you will be able to simply paste the short embed code for any widget (typically just two or three lines long) into the HTML of your article in the spot where you want the widget to appear.
Voila! The fact-checking widget will appear like an embedded tweet.
To get instructions for adding the code to your site’s template, contact Erica Ryan, the widget project manager for the Duke Reporters’ Lab.