Template:Tweet/doc: Difference between revisions

[checked revision][checked revision]
Content deleted Content added
Created page with "<includeonly>{{Quote box|style={{#if: {{{block|}}}|margin:1rem 40px;|}}|align={{#if: {{{left|}}}|left|{{#if: {{{block|}}}|none|right}}}}|width={{#if: {{{block|}}}|{{{width|500..."
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1:
{{documentation subpage}}
<includeonly>{{Quote box|style={{#if: {{{block|}}}|margin:1rem 40px;|}}|align={{#if: {{{left|}}}|left|{{#if: {{{block|}}}|none|right}}}}|width={{#if: {{{block|}}}|{{{width|500px}}}|{{{width|220px}}}}}|quote={{#if: {{{name|}}}||{{Formatting error|Missing <u>name</u> parameter.<br>|nocategory={{{nocategory|}}}}}}}<!--
{{tweet|name=Example|username=example|text=Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc dignissim, dolor vitae ullamcorper aliquet, velit mi sagittis metus.|date=12 Jul 2017|reference={{dummy reference}} }}
-->{{#if: {{{username|}}}||{{Formatting error|Missing <u>username</u> parameter.<br>|nocategory={{{nocategory|}}}}}}}<!--
This template allows relevant tweets to be easily quoted within articles, with a citation automatically generated using {{tlx|cite tweet}}.
-->{{#if: {{{date|}}}||{{Formatting error|Missing <u>date</u> parameter.<br>|nocategory={{{nocategory|}}}}}}}<!--
 
-->{{#if: {{{text|}}}||{{Formatting error|Missing <u>text</u> parameter.<br>|nocategory={{{nocategory|}}}}}}}<!--
Using this template is better than a screen-shot of a tweet because the text is [[WP:ACCESSIBLE|accessible]] to screen readers.
-->{{#ifeq: {{extract|{{{date|}}}|show=format}} | dmy
 
||{{#ifeq: {{extract|{{{date|}}}|show=format}} | mdy
It is an alternative to standard quotation templates because it displays all relevant information about the tweet (date of posting, user's name, user's handle, etc).
||{{Formatting error|<u>date</u> parameter should be [[MOS:DATE|reformatted]] to look like:<br>''1 Jan 1970'' or ''Jan 1, 1970''.<br>|nocategory={{{nocategory|}}}}}
 
}}
== Full blank syntax ==
}}<!--
<pre>
-->{{#if: {{{ID|{{{id|{{{reference|{{{ref|}}}}}}}}}}}}
{{tweet
||{{Formatting error|<u>reference</u> or <u>ID</u> parameter required.<br>|nocategory={{{nocategory|}}}}}
|text = [content of the tweet]
}}
|name = [user's name as it appears at the top of the tweet]
<table role="presentation" style="line-height: 1em; width: 100%;">
|username = [user's @ handle (without the @)]
<tr>
|date = [date of the tweet formatted according to MOS:DATE]
{{#if: {{{image|}}}
|ID = [number at the end of the tweet URL]
|<td rowspan=2 style="padding-right: 5px; width: 28px;">
|replyto = [optional: username tweet is replying to]
<div style="height: 28px; width: 28px; padding: 0; border-radius: 50%; overflow: hidden;">
|image = [optional: image or logo associated with twitter account]
[[File:{{{image|}}}|left|28px]]
|left = [optional: any value makes tweet aligned </div>left]
|block = [optional: any value displays tweet as block (text above and below, doesn't flow around).]
</td>
|width = [optional: custom tweet |}}width]
|reference = [optional: {{tweet}} automatically creates a reference, but one can be provided to use instead. See 2nd example.]
<th style="text-align: left; white-space: nowrap;">{{{name|}}}</th>
|lang = [optional: language code of the tweet if non-English]
<td style="text-align: right; color: #4C545C;">[[Twitter]]</td>
|translation = [optional: English translation of tweet if original tweet non-English]
</tr>
}}
<tr>
</pre>
<td style="color: #4C545C; white-space: nowrap;">@{{{username|}}}</td>
 
</tr>
== Example usage: ==
</table>
<pre><nowiki>
{{#if: {{{replyto|}}}|
{{tweet
<div style="color: #4C545C; font-size: 95%;">
|text=@WilliamShatner Good day, Captain. #ISS is in standard orbit and Commander Swanson has the conn. Hope you’re having a great weekend!
Replying to @{{{replyto|}}}
|name=NASA
</div>
|username=NASA
|}}
|date=Aug 2 2014
{{#if: {{{lang|{{{language|}}}}}}
|ID=495719809695621121
|<div style='color: #1c2022; text-align: left'>
|replyto=WilliamShatner
{{lang-{{{lang|{{{language|}}}}}}|{{{text|}}}}}
|image=NASA logo.svg
</div>
}}
|<div style='color: #1c2022; text-align: left'>
</nowiki></pre>
{{{text|}}}
{{clear}}
</div>
{{tweet
}}
|text=@WilliamShatner Good day, Captain. #ISS is in standard orbit and Commander Swanson has the conn. Hope you’re having a great weekend!
{{#if: {{{translation|}}}|
|name=NASA
<hr style="height: 0; border: 0; border-top: 1px solid #aaa; margin: 10px 0 10px 0;">
|username=NASA
<div>
|date=Aug 2 2014
{{{translation|}}}
|ID=495719809695621121
</div>
|replyto=WilliamShatner
|}}
|image=NASA logo.svg
<div style="color: #4C545C;">
}}
{{{date|}}}<!--
{{clear}}
-->{{{reference|{{{ref
<pre><nowiki>
|{{#tag:ref|{{cite tweet|user= {{{username}}} |author= {{{name|}}} |number= {{{ID|{{{id|}}}}}} |date= {{{date}}} |title= {{#invoke:String|replace|{{{text}}}|%s+| |plain=false}} }} }}
{{tweet
}}}}}}
|text=Despite the constant negative press covfefe
</div>
|name=Donald J. Trump
}}</includeonly><noinclude>
|username=realDonaldTrump
{{documentation}}
|date=30 May 2017
</noinclude>
|ID=869766994899468288
|left=yes
|reference={{dummy reference}}
}}
</nowiki></pre>
{{clear}}
{{tweet
|text=Despite the constant negative press covfefe
|name=Donald J. Trump
|username=realDonaldTrump
|date=30 May 2017
|ID=869766994899468288
|left=yes
|reference={{dummy reference}}
}}
{{clear}}
<pre><nowiki>
{{tweet
|name=Donald J. Trump
|username=realDonaldTrump
|date=Jan 5 2018
|text=I authorized Zero access to White House (actually turned him down many times) for author of phony book! I never spoke to him for book. Full of lies, misrepresentations and sources that don't exist. Look at this guy's past and watch what happens to him and Sloppy Steve [Bannon]!
|reference={{dummy reference}}
|block=yes
}}
</nowiki></pre>
{{clear}}
{{tweet|name=Donald J. Trump|username=realDonaldTrump|date=Jan 5 2018|text=I authorized Zero access to White House (actually turned him down many times) for author of phony book! I never spoke to him for book. Full of lies, misrepresentations and sources that don't exist. Look at this guy's past and watch what happens to him and Sloppy Steve [Bannon]!|reference={{dummy reference}}|block=yes}}
{{clear}}
<pre><nowiki>
{{tweet
|text=Dubito, ergo cogito, ergo sum
|lang=la
|translation=I doubt, therefore I think, therefore I am
|username=descartes
|name=René Descartes
|ref=example
|date=1637
}}
</nowiki></pre>
{{tweet
|text=Dubito, ergo cogito, ergo sum
|lang=la
|translation=I doubt, therefore I think, therefore I am
|username=descartes
|name=René Descartes
|ref=<ref>example</ref>
|date=Jan 1 1637
}}
{{clear}}
==TemplateData==
<templatedata>
{
"params": {
"block": {
"label": "block",
"description": "Any value displays tweet as block (text above and below, doesn't flow around). Overrides left parameter",
"type": "string"
},
"width": {
"label": "width",
"description": "Custom tweet width",
"example": "300px",
"type": "string"
},
"left": {
"label": "left",
"description": "Any value makes tweet aligned left",
"type": "string"
},
"name": {
"label": "name",
"description": "User's name as it appears at the top of the tweet",
"type": "string",
"required": true
},
"username": {
"label": "username",
"description": "User's Twitter handle. Do not include the @ symbol.",
"required": true
},
"date": {
"label": "date",
"description": "Date of the tweet formatted according to MOS:DATE",
"type": "date",
"required": true
},
"text": {
"label": "text",
"description": "Content of the tweet",
"type": "string",
"required": true
},
"ID": {
"aliases": [
"id"
],
"label": "ID",
"description": "The number at the end of the tweet URL",
"type": "number",
"suggested": true
},
"reference": {
"label": "reference",
"description": "A custom reference can be provided to use instead of the automatically generated one",
"example": "<ref>custom reference</ref>",
"aliases": [
"ref"
],
"type": "string"
},
"image": {
"label": "image",
"description": "Image or logo associated with twitter account",
"type": "wiki-file-name"
},
"replyto": {
"label": "replyto",
"description": "Username the tweet is replying to",
"type": "string"
},
"lang": {
"label": "lang",
"description": "language code of original tweet",
"example": "de",
"type": "string",
"aliases": [
"language"
]
},
"translation": {
"label": "translation",
"description": "english translation of the tweet"
}
},
"description": "This template allows relevant tweets to be easily quoted within articles, with a citation automatically generated using the template, \"cite tweet\".\n\nUsing this template is better than a screen-shot of a tweet because the text is accessible to screen readers.\n\nIt is an alternative to standard quotation templates because it displays all relevant information about the tweet (date of posting, user's name, user's handle, etc) in a way that reflects Twitter's design language."
}
</templatedata>
 
==See also==
*{{tl|Quote tweet}} – for tweets that quote another tweet
 
== Refs ==
{{reflist}}
 
<includeonly>{{Sandbox other||
[[Category:Quotation templates]]
 
}}</includeonly>