👉 Societas x Tape's Missing Info 🔎

"Who can help fill in the missing pieces?"

 Actions

Widget

Difference between revisions of "Tweet"

(Created page with "{{Widget |description=Allows to embed a single tweet. |author=Pablog |provider=Twitter |providerurl=https://dev.twitter.com/web/embedded-tweets |status=active |security=unknow...")
 
m
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
βˆ’
{{Widget
+
<noinclude>__NOTOC__
βˆ’
|description=Allows to embed a single tweet.
+
This widget allows you to '''[https://dev.twitter.com/docs/embedded-tweets embed a tweet]''' on your wiki page.
βˆ’
|author=Pablog
 
βˆ’
|provider=Twitter
 
βˆ’
|providerurl=https://dev.twitter.com/web/embedded-tweets
 
βˆ’
|status=active
 
βˆ’
|security=unknown
 
βˆ’
}}
 
βˆ’
This widget allows you to [https://dev.twitter.com/web/embedded-tweets embed a tweet] to your wiki page. It was created by [[User:Pablog|Pablo Castellano]].
 
  
βˆ’
== Usage ==
+
Created by [https://www.mediawikiwidgets.org/User:Pablog Pablo Castellano].
βˆ’
To insert this widget, use the following code:
 
  
βˆ’
<nowiki>{{#widget:Tweet
+
== Using this widget ==
βˆ’
|id=226413520412090368
+
For information on how to use this widget, see [https://www.mediawikiwidgets.org/Tweet widget description page on MediaWikiWidgets.org].
βˆ’
}}</nowiki>
 
  
βˆ’
You can use some parameters to customize the style of the tweet box, like:
+
== Copy to your site ==
βˆ’
 
+
To use this widget on your site, just install [https://www.mediawiki.org/wiki/Extension:Widgets MediaWiki Widgets extension] and copy the [{{fullurl:{{FULLPAGENAME}}|action=edit}} full source code] of this page to your wiki as page '''{{FULLPAGENAME}}'''.
βˆ’
<nowiki>{{#widget:Tweet
+
</noinclude><includeonly>
βˆ’
|id=226413520412090368
+
<!--{if isset($id)}-->
βˆ’
|linkColor=#cc0000
+
    <!--{counter name="tweetcounter" assign="tweetincluded"}-->
βˆ’
|theme=dark
+
    <div id="twitter-<!--{$tweetincluded}-->-<!--{$id}-->"></div>
βˆ’
}}</nowiki>
+
    <!--{if $tweetincluded eq 1}-->
βˆ’
 
+
    <script>
βˆ’
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].
+
    if (typeof window.twttr === 'undefined') {
βˆ’
 
+
        window.twttr = (function (d,s,id) {
βˆ’
 
+
            var t, js, fjs = d.getElementsByTagName(s)[0];
βˆ’
== Parameters ==
+
            if (d.getElementById(id)) return; js=d.createElement(s); js.id=id;
βˆ’
 
+
            js.src="//platform.twitter.com/widgets.js";
βˆ’
=== Mandatory ===
+
            fjs.parentNode.insertBefore(js, fjs);
βˆ’
* '''id''' - tweet id
+
            return window.twttr || (t = { _e: [], ready: function(f){ t._e.push(f) } });
βˆ’
 
+
        }(document, "script", "twitter-wjs"));
βˆ’
=== Optional ===
+
    }
βˆ’
* '''align''' - ''left'', ''right'', ''center''. (Default: ''undefined'')
+
    </script>
βˆ’
* '''conversation''' - ''none'', ''all''. (Default: ''all'')
+
    <!--{/if}-->
βˆ’
* '''cards''' - ''hidden'', ''visible''. (Default: ''visible'')
+
    <script>
βˆ’
* '''width''' - ''numeric value''. (Default: ''auto'')
+
    twttr.ready(function (twttr) {
βˆ’
* '''linkColor''' - ''hexadecimal color value'' (Default: ''blue'')
+
        twttr.widgets.createTweet(
βˆ’
* '''theme''' - ''dark'', ''light''. (Default: ''light'')
+
            "<!--{$id}-->",
βˆ’
 
+
            document.getElementById("twitter-<!--{$tweetincluded}-->-<!--{$id}-->"),
βˆ’
== Examples ==
+
            {
βˆ’
=== Single post ===
+
                align: <!--{if $align}-->'<!--{$align}-->'<!--{else}-->undefined<!--{/if}-->,
βˆ’
{{#widget:Tweet|id=226413520412090368}}
+
                conversation: '<!--{if $conversation}--><!--{$conversation}--><!--{else}-->all<!--{/if}-->',
βˆ’
 
+
                cards: '<!--{if $cards}--><!--{$cards}--><!--{else}-->visible<!--{/if}-->',
βˆ’
=== Single post enhanced with further options ===
+
                width: <!--{if $width}-->'<!--{$width}-->'<!--{else}-->undefined<!--{/if}-->,
βˆ’
{{#widget:Tweet|id=226413520412090368|linkColor=#cc0000|theme=dark}}
+
                linkColor: '<!--{if $linkColor}--><!--{$linkColor}--><!--{else}-->blue<!--{/if}-->',
βˆ’
{{Comments}}
+
                theme: '<!--{if $theme}--><!--{$theme}--><!--{else}-->light<!--{/if}-->'
 +
            }
 +
        );
 +
    });
 +
    </script>
 +
<!--{else}-->
 +
    <b style="color:red">No id supplied for Tweet!</b>
 +
<!--{/if}-->
 +
</includeonly>
  
 +
<noinclude>
 
[[Category:Widgets]]
 
[[Category:Widgets]]
 +
</noinclude>

Latest revision as of 22:21, 23 March 2017

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.

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.