Vorlage:Cite tweet/Doku: Unterschied zwischen den Versionen

add info on optional date parameter
(→‎TemplateData: no basis in consensus, see talk for more)
(add info on optional date parameter)
Zeile 13: Zeile 13:
|- style="vertical-align:top;"
|- style="vertical-align:top;"
|
|
: <code><nowiki>{{Cite tweet |user= |number= |date= |title=}}</nowiki></code>
: <code><nowiki>{{Cite tweet |user= |number= |title=}}</nowiki></code>
{{end}}
{{end}}
{{csdoc|usage full}}
{{csdoc|usage full}}
Zeile 26: Zeile 26:


This reference would be cited as <code><nowiki>{{sfn|Porck|2017}}</nowiki></code>.
This reference would be cited as <code><nowiki>{{sfn|Porck|2017}}</nowiki></code>.
=== Optional {{para|date}} parameter ===
Unlike most citation templates, the {{para|date}} parameter is optional. This is because the date can be calculated directly from the Tweet's ID using [[Module:TwitterSnowflake]] (wrapped with [[Template:TwitterSnowflake]]).
If the {{para|date}} parameter is off by more than one day from what the calculated date is, the template will output an error. This can be fixed by removing or correcting the date parameter.
If the Tweet was posted before November 4, 2010, the date cannot be calculated from the ID {{--}} the template will output an error if no date is provided.


== Examples ==
== Examples ==
'''<code><nowiki>{{Cite tweet |user=Pigsonthewing |number=564068436633214977 |date=7 February 2015 |title=This is an example tweet. Hello, Wikipedians!}}</nowiki></code>'''
'''<code><nowiki>{{Cite tweet |user=Pigsonthewing |number=564068436633214977 |title=This is an example tweet. Hello, Wikipedians!}}</nowiki></code>'''
: {{Cite tweet |user=Pigsonthewing |number=564068436633214977 |date=7 February 2015 |title=This is an example tweet. Hello, Wikipedians!}}
: {{Cite tweet |user=Pigsonthewing |number=564068436633214977 |title=This is an example tweet. Hello, Wikipedians!}}
'''<code><nowiki>{{Cite tweet |author=Andy Mabbett |user=Pigsonthewing |number=564068436633214977 |date=7 February 2015 |title=This is an example tweet. Hello, Wikipedians!}}</nowiki></code>'''
'''<code><nowiki>{{Cite tweet |author=Andy Mabbett |user=Pigsonthewing |number=564068436633214977 |title=This is an example tweet. Hello, Wikipedians!}}</nowiki></code>'''
: {{Cite tweet |author=Andy Mabbett |user=Pigsonthewing |number=564068436633214977 |date=7 February 2015 |title=This is an example tweet. Hello, Wikipedians!}}
: {{Cite tweet |author=Andy Mabbett |user=Pigsonthewing |number=564068436633214977 |title=This is an example tweet. Hello, Wikipedians!}}
'''<code><nowiki>{{Cite tweet |author=Andy Mabbett |user=Pigsonthewing |number=564068436633214977 |date=7 February 2015 |title=This is an example tweet. Hello, Wikipedians! |retweet=Wikimedia Foundation [Wikimedia]}}</nowiki></code>'''
'''<code><nowiki>{{Cite tweet |author=Andy Mabbett |user=Pigsonthewing |number=564068436633214977 |title=This is an example tweet. Hello, Wikipedians! |retweet=Wikimedia Foundation [Wikimedia]}}</nowiki></code>'''
: {{Cite tweet |author=Andy Mabbett |user=Pigsonthewing |number=564068436633214977 |date=7 February 2015 |title=This is an example tweet. Hello, Wikipedians! |retweet=Wikimedia Foundation [Wikimedia]}}
: {{Cite tweet |author=Andy Mabbett |user=Pigsonthewing |number=564068436633214977 |title=This is an example tweet. Hello, Wikipedians! |retweet=Wikimedia Foundation [Wikimedia]}}


If the author has a Wikipedia article, use of {{para|author-link}} is recommended:<br/>
If the author has a Wikipedia article, use of {{para|author-link}} is recommended:<br/>
'''<code><nowiki>{{Cite tweet |author=Elon Musk |author-link=Elon Musk |user=elonmusk |number=743097337782763521 |date=15 June 2016 |title=Looks like thrust was low on 1 of 3 landing engines. High g landings v sensitive to all engines operating at max.}}</nowiki></code>'''
'''<code><nowiki>{{Cite tweet |author=Elon Musk |author-link=Elon Musk |user=elonmusk |number=743097337782763521 |title=Looks like thrust was low on 1 of 3 landing engines. High g landings v sensitive to all engines operating at max.}}</nowiki></code>'''
: {{Cite tweet |author=Elon Musk |author-link=Elon Musk |user=elonmusk |number=743097337782763521 |date=15 June 2016 |title=Looks like thrust was low on 1 of 3 landing engines. High g landings v sensitive to all engines operating at max.}}
: {{Cite tweet |author=Elon Musk |author-link=Elon Musk |user=elonmusk |number=743097337782763521 |title=Looks like thrust was low on 1 of 3 landing engines. High g landings v sensitive to all engines operating at max.}}


Note that if {{para|last}} is used, {{para|author}} is ignored:<br/>
Note that if {{para|last}} is used, {{para|author}} is ignored:<br/>
'''<code><nowiki>{{Cite tweet |last=Mabbett |first=Andy |author=Redundant Author Name Ignored |user=Pigsonthewing |number=564068436633214977 |date=7 February 2015 |title=This is an example tweet. Hello, Wikipedians! |retweet=Wikimedia Foundation [Wikimedia]}}</nowiki></code>'''
'''<code><nowiki>{{Cite tweet |last=Mabbett |first=Andy |author=Redundant Author Name Ignored |user=Pigsonthewing |number=564068436633214977 |title=This is an example tweet. Hello, Wikipedians! |retweet=Wikimedia Foundation [Wikimedia]}}</nowiki></code>'''
: {{Cite tweet |last=Mabbett |first=Andy |author=Redundant Author Name Ignored |user=Pigsonthewing |number=564068436633214977 |date=7 February 2015 |title=This is an example tweet. Hello, Wikipedians! |retweet=Wikimedia Foundation [Wikimedia]}}
: {{Cite tweet |last=Mabbett |first=Andy |author=Redundant Author Name Ignored |user=Pigsonthewing |number=564068436633214977 |title=This is an example tweet. Hello, Wikipedians! |retweet=Wikimedia Foundation [Wikimedia]}}
 
This tweet was posted before November 4, 2010, so {{para|date}} is necessary:<br/>
'''<code><nowiki>{{Cite tweet |user=jack |number=20 |title=just setting up my twttr |date=Mar 21, 2006 }}</nowiki></code>'''
: {{Cite tweet |user=jack |number=20 |title=just setting up my twttr |date=Mar 21, 2006 |author-link=Jack Dorsey }}


== Error detection ==
== Error detection ==
* The parameters {{para|user}}, {{para|number}}, {{para|date}}, and {{para|title}} are '''{{red|required}}'''. If omitted or left blank, errors will be reported. For example:
* The parameters {{para|user}}, {{para|number}}, and {{para|title}} are '''{{red|required}}'''. If omitted or left blank, errors will be reported. For example:
*: '''<code><nowiki>{{Cite tweet |title=I'm an incomplete citation!}}</nowiki></code>'''
*: '''<code><nowiki>{{Cite tweet |title=I'm an incomplete citation!}}</nowiki></code>'''
*:: {{Cite tweet |title=I'm an incomplete citation!}}
*:: {{Cite tweet |title=I'm an incomplete citation!}}
* The tweet URL depends on {{para|user}} and {{para|number}}; if either or both are missing, the URL defaults to <nowiki>https://twitter.com/</nowiki>
* The tweet URL depends on {{para|user}} and {{para|number}}; if either or both are missing, the URL defaults to <nowiki>https://twitter.com/</nowiki>
* The tweet date depends on {{para|number}} for Tweets posted after November 4, 2010, if the given date parameter is off by more than a day from the calculated date, an error is displayed
* Templates are checked for {{para|ref|harv}}, which is an error. The {{para|ref}} parameter must use {{tl|harvid}} in the value.  
* Templates are checked for {{para|ref|harv}}, which is an error. The {{para|ref}} parameter must use {{tl|harvid}} in the value.  
* The template also checks for parameters that are unsupported (e.g. misspellings of parameter names).
* The template also checks for parameters that are unsupported (e.g. misspellings of parameter names).
Anonymer Benutzer