Widget:Tweet: Difference between revisions

From SMO.wiki
Create widget
 
add classes to widget divs instead
 
(22 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly><blockquote class="twitter-tweet"><a href="https://twitter.com/_/status/<!--{$id|escape:'urlpathinfo'}-->"></a></blockquote><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script></includeonly>
<includeonly>
<div class="tweet-widget light-theme" style="max-width: 100%;<!--{if isset($float)}--> float: right; clear: right; margin-top: -10px; margin-bottom: calc(0.5em - 10px); margin-left: 1em;<!--{/if}--> width: <!--{if isset($float)}--><!--{$width|escape:'html'|default:'440'}--><!--{else}--><!--{$width|escape:'html'|default:'550'}--><!--{/if}-->px;">
  <blockquote class="twitter-tweet" data-dnt="true" data-theme="light">
    <a href="https://twitter.com/_/status/<!--{$id|escape:'urlpathinfo'}-->"></a>
  </blockquote>
</div>
<div class="tweet-widget dark-theme" style="max-width: 100%;<!--{if isset($float)}--> float: right; clear: right; margin-top: -10px; margin-bottom: calc(0.5em - 10px); margin-left: 1em;<!--{/if}--> width: <!--{if isset($float)}--><!--{$width|escape:'html'|default:'440'}--><!--{else}--><!--{$width|escape:'html'|default:'550'}--><!--{/if}-->px;">
  <blockquote class="twitter-tweet" data-dnt="true" data-theme="dark">
    <a href="https://twitter.com/_/status/<!--{$id|escape:'urlpathinfo'}-->"></a>
  </blockquote>
</div>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</includeonly>
 
<noinclude>
This widget allows you to add a [https://help.twitter.com/en/using-twitter/how-to-embed-a-tweet Tweet card] to your wiki page.
 
== Using this widget ==
To insert this widget, use the following syntax:
<code><nowiki>{{#widget:</nowiki>{{PAGENAME}}<nowiki>|id = example}}</nowiki></code>
 
Replace <code>example</code> with the ID of the Tweet found in the URL. You can also add the following optional parameters (separated using <code>|</code> symbols within the brackets):
* <code>width = W</code> (replace <code>W</code> with the desired width in pixels)
* <code>float</code> (places the video along the right side of the page, also changes the default width)
 
=== Example ===
{{#widget:Tweet|id = 20}}
</noinclude>

Latest revision as of 08:38, 31 July 2023


This widget allows you to add a Tweet card to your wiki page.

Using this widget

To insert this widget, use the following syntax: {{#widget:Tweet|id = example}}

Replace example with the ID of the Tweet found in the URL. You can also add the following optional parameters (separated using | symbols within the brackets):

  • width = W (replace W with the desired width in pixels)
  • float (places the video along the right side of the page, also changes the default width)

Example