Widget:Tweet: Difference between revisions
Jump to navigation
Jump to search
Pat Palmer (talk | contribs) (Created page with "<noinclude>__NOTOC__ This widget allows you to '''[https://dev.twitter.com/docs/embedded-tweets embed a tweet]''' on your wiki page. Created by [https://www.mediawikiwidgets.org/User:Pablog Pablo Castellano]. == Using this widget == For information on how to use this widget, see [https://www.mediawikiwidgets.org/Tweet widget description page on MediaWikiWidgets.org]. == Copy to your site == To use this widget on your site, just install [https://www.mediawiki.org/wiki/...") |
Pat Palmer (talk | contribs) (adding more details on documentation) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
== Using this widget == | == Using this widget == | ||
For information on how to use this widget, see [https://www.mediawikiwidgets.org/Tweet widget description page on MediaWikiWidgets.org]. | For information on how to use this widget, see [https://www.mediawikiwidgets.org/Tweet widget description page on MediaWikiWidgets.org]. | ||
To insert this widget, use the following code: | |||
<nowiki>{{#widget:Tweet | |||
|id=226413520412090368 | |||
}}</nowiki> | |||
You can use some parameters to customize the style of the tweet box, like: | |||
<nowiki>{{#widget:Tweet | |||
|id=226413520412090368 | |||
|linkColor=#cc0000 | |||
|theme=dark | |||
}}</nowiki> | |||
Mandatory Parameter | |||
id - tweet id | |||
Optional Parameters | |||
align - left, right, center. (Default: undefined) | |||
conversation - none, all. (Default: all) | |||
cards - hidden, visible. (Default: visible) | |||
width - numeric value. (Default: auto) | |||
linkColor - hexadecimal color value (Default: blue) | |||
theme - dark, light. (Default: light) | |||
For more information about customization parameters, have a look at the Twitter documentation available at [https://dev.twitter.com/web/javascript/creating-widgets#create-tweet https://dev.twitter.com/web/javascript/creating-widgets#create-tweet]. | |||
== Copy to your site == | == Copy to your site == | ||
Line 23: | Line 52: | ||
return window.twttr || (t = { _e: [], ready: function(f){ t._e.push(f) } }); | return window.twttr || (t = { _e: [], ready: function(f){ t._e.push(f) } }); | ||
}(document, "script", "twitter-wjs")); | }(document, "script", "twitter-wjs")); | ||
} | |||
</script> | |||
<!--{/if}--> | |||
<script> | |||
twttr.ready(function (twttr) { | |||
twttr.widgets.createTweet( | |||
"<!--{$id}-->", | |||
document.getElementById("twitter-<!--{$tweetincluded}-->-<!--{$id}-->"), | |||
{ | |||
align: <!--{if $align}-->'<!--{$align}-->'<!--{else}-->undefined<!--{/if}-->, | |||
conversation: '<!--{if $conversation}--><!--{$conversation}--><!--{else}-->all<!--{/if}-->', | |||
cards: '<!--{if $cards}--><!--{$cards}--><!--{else}-->visible<!--{/if}-->', | |||
width: <!--{if $width}-->'<!--{$width}-->'<!--{else}-->undefined<!--{/if}-->, | |||
linkColor: '<!--{if $linkColor}--><!--{$linkColor}--><!--{else}-->blue<!--{/if}-->', | |||
theme: '<!--{if $theme}--><!--{$theme}--><!--{else}-->light<!--{/if}-->' | |||
} | |||
); | |||
}); | |||
</script> | |||
<!--{else}--> | |||
<b style="color:red">No id supplied for Tweet!</b> | |||
<!--{/if}--> | |||
</includeonly> |
Latest revision as of 10:47, 13 October 2022
This widget allows you to embed a tweet on your wiki page.
Created by Pablo Castellano.
Using this widget
For information on how to use this widget, see widget description page on MediaWikiWidgets.org.
To insert this widget, use the following code:
{{#widget:Tweet |id=226413520412090368 }}
You can use some parameters to customize the style of the tweet box, like:
{{#widget:Tweet |id=226413520412090368 |linkColor=#cc0000 |theme=dark }}
Mandatory Parameter
id - tweet id
Optional Parameters
align - left, right, center. (Default: undefined) conversation - none, all. (Default: all) cards - hidden, visible. (Default: visible) width - numeric value. (Default: auto) linkColor - hexadecimal color value (Default: blue) theme - dark, light. (Default: light)
For more information about customization parameters, have a look at the Twitter documentation available at https://dev.twitter.com/web/javascript/creating-widgets#create-tweet.
Copy to your site
To use this widget on your site, just install MediaWiki Widgets extension and copy the full source code of this page to your wiki as page Widget:Tweet.