Skip to content

Instantly share code, notes, and snippets.

@mcmullengreg
Created April 20, 2015 23:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcmullengreg/2fdf0aa9b0a64179d6bc to your computer and use it in GitHub Desktop.
Save mcmullengreg/2fdf0aa9b0a64179d6bc to your computer and use it in GitHub Desktop.
Embedded Twitter Feed for Umbraco
@* Embedded Twitter Feed
* ---------------------
* Create a widget from Twitter.com FIRST - https://twitter.com/settings/widgets
* Embedded Timeline API - https://dev.twitter.com/docs/embedded-timelines
* All of these settings are for the local end. User & Search information
* Should be setup on the actually widget creation page.
*
*
*@
@{
string widgetID = Parameter.widgetID;
string width = Parameter.width;
string height = Parameter.height;
string linkColor = Parameter.linkColor;
string numTweets = (Parameter.numTweets != "") ? Parameter.numTweets : "";
var chrome = "";
@* Boolean values store as string 1 and 0 *@
if ( Parameter.header == "1" ) {
chrome += "noheader ";
} if ( Parameter.footer == "1" ) {
chrome += "nofooter ";
} if ( Parameter.scrollbar == "1" ) {
chrome += "noscrollbar ";
}
}
<div>
<a class="twitter-timeline"
data-widget-id="@widgetID"
data-link-color="@linkColor"
width="@width"
height="@height"
data-chrome="@chrome"
data-tweet-limit="@numTweets">
</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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment