Template:Talk quote block/doc: Difference between revisions
Add TemplateData |
m Reverted 1 edit by 2C0F:FC89:80B8:839:1:0:BC17:50BB (talk) to last revision by Paine Ellsworth |
||
(20 intermediate revisions by 10 users not shown) | |||
Line 1: | Line 1: | ||
{{Documentation subpage}} |
{{Documentation subpage}} |
||
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> |
|||
{{redirect|Template:Talkquote|quoting inline|Template:Talk quote inline}} |
{{redirect|Template:Talkquote|quoting inline|Template:Talk quote inline}} |
||
{{High-use}} |
|||
{{Template shortcut|tqb|tq2}} |
{{Template shortcut|tqb|tq2}} |
||
{{Uses TemplateStyles|Template:Talk quote block/styles.css}} |
{{Uses TemplateStyles|Template:Talk quote block/styles.css}} |
||
<!-- Categories and interwikis go at the bottom of this page. --> |
|||
=== Usage === |
|||
Use {{tnull|Talk quote block}} or {{tnull|tqb}} (a.k.a. {{tnull|Talkquote}}, {{tnull|Talk quote}}, or {{tnull|tq2}}) to quote (another's comments, a policy statement, etc.) in a block, on talk pages and noticeboards. It can be safely used after colon-indenting as well (see the [[#Indenting|§ Indenting]] example below <sup>[[[#Caveats|§ Caveats]]]</sup>). For a short inline quote, instead use {{tlx|Talk quote inline}} (a.k.a. {{tlx|Talk quotation}} or {{tlx|tq}}). |
|||
Use {{tnull|Talk quote block}} or {{tnull|tqb}} to quote (another's comments, a policy statement, etc.) in a block, on talk pages and noticeboards. It can be safely used after colon-indenting as well (see the [[#Indenting|§ Indenting]] example below ({{section link||Caveats}}). For a short inline quote, instead use {{tlx|Talk quote inline}}. |
|||
== Usage == |
|||
Unnamed (positional) parameters: |
|||
* {{tlx|Talk quote block|text|by}} |
|||
** The order of positional parameters cannot change - {{var|text}} must come before {{var|by}}. |
|||
;Using named parameters |
|||
:<code><nowiki>{{talk quote block|text=text|by=by|source=source|ts=ts|oldid=oldid}}</nowiki></code> |
|||
: Explanation of named parameters: |
|||
:*'''text''' (or '''1'''): The text being quoted. |
|||
:*'''by''' (or '''2'''): The author of the text being quoted. A [[WP:U|Wikipedia username]] is expected, and the username will be provided as a [[WP:Link|wikilink]] to the author's user page. |
|||
:*'''source''': The source of the text being quoted. Use instead of ''by'' when source is not individual user name, or when copy-pasting an entire sig. |
|||
:*'''ts''': The [[WP:Timestamp|timestamp]] of the edit whose text is being quoted. Hint: You can use [[WP:5TILDES|five tildes]] to supply the current date and time: <code><nowiki>|ts=~~~~~</nowiki></code>. |
|||
:*'''oldid''': The [[WP:Revision id|revision ID]] of the edit introducing the change that was made. Displayed as the timestamp linking to the Diff of the edit. (requires ''ts'' parameter or is not shown) |
|||
:*'''diff''': The revision ID of the [[Help:Diff|Diff]] comparing target. |
|||
:*'''style''': [[HTML]] in-line style. (see the [[Template:Talk_quote_block/testcases#Parameter_"style"|testcases]]) |
|||
:*'''nodash=y''' or '''no-dash=y''': Suppresses the em dash and space before ''source'', for when pasting a sig that already starts with a dash |
|||
Named parameters: |
|||
=== Examples === |
|||
* {{tlx|Talk quote block|text{{=}}|by{{=}}|source{{=}}|ts{{=}}|id{{=}}}} |
|||
* <code><nowiki>{{talk quote block|some random text|Example}}</nowiki></code> gives: |
|||
::<div style="background-color:#f9f9f9; border:1px dashed #3170ab; padding:10px 10px">{{talk quote block|some random text|Example}}</div> |
|||
* <code><nowiki>{{talk quote block|more random text|Example|ts=08:52, 21 May 2011 (UTC)}}</nowiki></code> gives: |
|||
::<div style="background-color:#f9f9f9; border:1px dashed #3170ab; padding:10px 10px">{{talk quote block|more random text|Example|ts=08:52, 21 May 2011 (UTC)}}</div> |
|||
* <code><nowiki>{{talk quote block|different random text|Example|ts=08:52, 21 May 2011 (UTC)|oldid=139992}}</nowiki></code> gives: |
|||
::<div style="background-color:#f9f9f9; border:1px dashed #3170ab; padding:10px 10px">{{talk quote block|different random text|Example|ts=08:52, 21 May 2011 (UTC)|oldid=139992}}</div> |
|||
::(Note: ''ts'' parameter must be present for ''oldid'' link to show) |
|||
== Parameters == |
|||
==== Suggested boilerplate ==== |
|||
* {{para|text}} (or {{para|1}}): The text being quoted. |
|||
<syntaxhighlight lang="moin"> |
|||
* {{para|by}} (or {{para|2}}): The author of the text being quoted. A [[WP:U|Wikipedia username]] is expected, and the username will be provided as a [[WP:Link|wikilink]] to the author's user page. |
|||
{{tq2|1=<nowiki/> |
|||
* {{para|source}}: The source of the text being quoted. Use instead of {{para|by}} when source is not individual user name, or when copy-pasting an entire sig. |
|||
* {{para|ts}}: The [[WP:Timestamp|timestamp]] of the edit whose text is being quoted. Hint: You can use [[WP:5TILDES|five tildes]] to supply the current date and time: <code><nowiki>|ts=~~~~~</nowiki></code>. |
|||
* {{para|id}}: The ID of the comment that will be used in a link to it if the {{para|ts}} parameter is also present. You can copy it by right-clicking the timestamp. |
|||
* {{para|oldid}}: The [[Wikipedia:Revision ID|revision ID]] of the edit introducing the change that was made. Displayed as the timestamp linking to the diff of the edit. (requires {{para|ts}} or is not shown). |
|||
* {{para|diff}}: The link to the [[Help:Diff|diff]] comparing target. |
|||
* {{para|style}}: [[HTML]] in-line style. (see the [[Template:Talk quote block/testcases#Parameter "style"|testcases]]) |
|||
* {{para|nodash|y}} or {{para|no-dash|y}}: Suppresses the em dash and space before {{para|source}}, for when pasting a sig that already starts with a dash. |
|||
* {{para|noping|y}} or {{para|no-ping|y}}: Suppresses the link to the author to avoid [[Help:Notifications|notifying them]]. |
|||
== Examples == |
|||
* {{tlx|Talk quote block|some random text|Example}} gives: <div style="background-color: var(--background-color-neutral-subtle, #f8f9fa); color: inherit; border:1px dashed #3170ab; padding:10px 10px">{{talk quote block|some random text|Example}}</div> |
|||
* {{tlx|Talk quote block|more random text|Example|ts{{=}}08:52, 21 May 2011 (UTC)}} gives: <div style="background-color: var(--background-color-neutral-subtle, #f8f9fa); color: inherit; border:1px dashed #3170ab; padding:10px 10px">{{talk quote block|more random text|Example|ts=08:52, 21 May 2011 (UTC)}}</div> |
|||
* {{tlx|Talk quote block|Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.|Example User|ts{{=}}08:52, 21 May 2011 (UTC)|id{{=}}c-Example_User-20240604182100-Example}} gives: <div style="background-color: var(--background-color-neutral-subtle, #f8f9fa); color: inherit; border:1px dashed #3170ab; padding:10px 10px">{{talk quote block|Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.|Example User|ts=08:52, 21 May 2011 (UTC)|id=c-Example_User-20240604182100-Example}}</div> |
|||
* {{tlx|Talk quote block|different random text|Example|ts{{=}}08:52, 21 May 2011 (UTC)|oldid{{=}}139992}} gives: <div style="background-color: var(--background-color-neutral-subtle, #f8f9fa); color: inherit; border:1px dashed #3170ab; padding:10px 10px">{{talk quote block|different random text|Example|ts=08:52, 21 May 2011 (UTC)|oldid=139992}}</div> |
|||
Note: {{para|ts}} must be present for {{para|oldid}} link to show. |
|||
=== Suggested boilerplate === |
|||
<syntaxhighlight lang="wikitext"> |
|||
{{Talk quote block|1=<nowiki/> |
|||
|source=}} |
|source=}} |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
<syntaxhighlight lang=" |
<syntaxhighlight lang="wikitext"> |
||
{{ |
{{Talk quote block|1=<nowiki/> |
||
|by=|ts=|id=}} |
|||
</syntaxhighlight> |
|||
<syntaxhighlight lang="wikitext"> |
|||
{{Talk quote block|1=<nowiki/> |
|||
|by=|ts=|oldid=}} |
|by=|ts=|oldid=}} |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
=== Indenting === |
|||
The template works with standard talk page indentation, as the following example illustrates. This wiki-markup: |
The template works with standard talk page indentation, as the following example illustrates. This wiki-markup: |
||
<syntaxhighlight lang="wikitext"> |
|||
<pre> |
|||
Random paragraph of text. [[User:Example|Example]] ([[User talk:Example|talk]]) 09:20, 21 May 2011 (UTC) |
Random paragraph of text. [[User:Example|Example]] ([[User talk:Example|talk]]) 09:20, 21 May 2011 (UTC) |
||
:Opening statement by [[User: |
:Opening statement by [[User:Example2|Some other user]]. |
||
:{{talk quote block|Quoting an item from random paragraph.}} |
:{{talk quote block|Quoting an item from random paragraph.}} |
||
:Response to quoted text. [[User: |
:Response to quoted text. [[User:Example2|Some other user]] ([[User talk:Example2|talk]]) ~~~~~ |
||
</syntaxhighlight> |
|||
</pre> |
|||
Displays the following: |
|||
<div style="background-color:# |
<div style="background-color: var(--background-color-neutral-subtle, #f8f9fa); color: inherit; border:1px dashed #3170ab; padding:3px 10px 3px 10px"> |
||
Random paragraph of text. [[User:Example|Example]] ([[User talk:Example|talk]]) 09:20, 21 May 2011 (UTC) |
Random paragraph of text. [[User:Example|Example]] ([[User talk:Example|talk]]) 09:20, 21 May 2011 (UTC) |
||
:Opening statement by [[User: |
:Opening statement by [[User:Example2|Some other user]]. |
||
:{{talk quote block|Quoting an item from random paragraph.}} |
:{{talk quote block|Quoting an item from random paragraph.}} |
||
:Response to quoted text. [[User: |
:Response to quoted text. [[User:Example2|Some other user]] ([[User talk:Example2|talk]]) 09:26, 21 May 2011 (UTC) |
||
</div> |
|||
==== Indented multi-line quote ==== |
|||
To create an indented multi-line quote (such as within a a reply on a talk page), you ''must'' use <nowiki><br/></nowiki> tags to indicate the line breaks, but do ''not'' use manual line breaks. Refer to the following example: |
|||
<syntaxhighlight lang="wikitext"> |
|||
Random paragraph of text. [[User:Example|Example]] ([[User talk:Example|talk]]) 09:20, 21 May 2011 (UTC) |
|||
:Opening statement by [[User:Example2|Some other user]]. |
|||
:{{talk quote block|Quoting an item from random paragraph.<br/>Including a second line.}} |
|||
:Response to quoted text. [[User:Example2|Some other user]] ([[User talk:Example2|talk]]) ~~~~~ |
|||
</syntaxhighlight> |
|||
Displays the following: |
|||
<div style="background-color: var(--background-color-neutral-subtle, #f8f9fa); color: inherit; border:1px dashed #3170ab; padding:3px 10px 3px 10px"> |
|||
Random paragraph of text. [[User:Example|Example]] ([[User talk:Example|talk]]) 09:20, 21 May 2011 (UTC) |
|||
:Opening statement by [[User:Example2|Some other user]]. |
|||
:{{talk quote block|Quoting an item from random paragraph.<br/>Including a second line.}} |
|||
:Response to quoted text. [[User:Example2|Some other user]] ([[User talk:Example2|talk]]) 09:26, 21 May 2011 (UTC) |
|||
</div> |
</div> |
||
=== Quoting lists === |
|||
If the text you are quoting is a bulleted or numbered list, the first list item must start on a new line, or it won't be rendered properly. For example: |
If the text you are quoting is a bulleted or numbered list, the first list item must start on a new line, or it won't be rendered properly. For example: |
||
{| class="wikitable" |
{| class="wikitable" |
||
Line 67: | Line 92: | ||
|- |
|- |
||
| '''Wrong way''' |
| '''Wrong way''' |
||
<syntaxhighlight lang="wikitext"> |
|||
<pre> |
|||
{{talk quote block|* Item one |
{{talk quote block|* Item one |
||
* Item two |
* Item two |
||
}} |
}} |
||
</syntaxhighlight> |
|||
</pre> |
|||
| First item isn't bulleted correctly: |
| First item isn't bulleted correctly: |
||
<div style="background-color:# |
<div style="background-color: var(--background-color-base, #f8f9fa); color: inherit; border:1px dashed #3170ab; padding:3px 10px 3px 10px"> |
||
{{talk quote block|* Item one |
{{talk quote block|* Item one |
||
* Item two |
* Item two |
||
Line 80: | Line 105: | ||
|- |
|- |
||
| '''Right way''' |
| '''Right way''' |
||
<syntaxhighlight lang="wikitext"> |
|||
<pre> |
|||
{{talk quote block| |
{{talk quote block| |
||
* Item one |
* Item one |
||
* Item two |
* Item two |
||
}} |
}} |
||
</syntaxhighlight> |
|||
</pre> |
|||
| All items are bulleted correctly: |
| All items are bulleted correctly: |
||
<div style="background-color:# |
<div style="background-color: var(--background-color-base, #f8f9fa); color: inherit; border:1px dashed #3170ab; padding:3px 10px 3px 10px"> |
||
{{talk quote block| |
{{talk quote block| |
||
* Item one |
* Item one |
||
Line 100: | Line 125: | ||
|- |
|- |
||
| '''Wrong way''' |
| '''Wrong way''' |
||
<syntaxhighlight lang="wikitext"> |
|||
<pre> |
|||
{{talk quote block|text= |
{{talk quote block|text= |
||
# Item one |
# Item one |
||
# Item two |
# Item two |
||
}} |
}} |
||
</syntaxhighlight> |
|||
</pre> |
|||
| First item isn't numbered correctly: |
| First item isn't numbered correctly: |
||
<div style="background-color:# |
<div style="background-color: var(--background-color-base, #f8f9fa); color: inherit; border:1px dashed #3170ab; padding:3px 10px 3px 10px"> |
||
{{talk quote block|text= |
{{talk quote block|text= |
||
# Item one |
# Item one |
||
Line 115: | Line 140: | ||
|- |
|- |
||
| '''Right way''' |
| '''Right way''' |
||
<syntaxhighlight lang="wikitext"> |
|||
<pre> |
|||
{{talk quote block|text=<nowiki /> |
{{talk quote block|text=<nowiki /> |
||
# Item one |
# Item one |
||
# Item two |
# Item two |
||
}} |
}} |
||
</syntaxhighlight> |
|||
</pre> |
|||
| All items are numbered correctly: |
| All items are numbered correctly: |
||
<div style="background-color:# |
<div style="background-color: var(--background-color-base, #f8f9fa); color: inherit; border:1px dashed #3170ab; padding:3px 10px 3px 10px"> |
||
{{talk quote block|text=<nowiki /> |
{{talk quote block|text=<nowiki /> |
||
# Item one |
# Item one |
||
Line 129: | Line 154: | ||
</div> |
</div> |
||
|} |
|} |
||
=== Caveats === |
=== Caveats === |
||
==== Complex formatting compatibility ==== |
==== Complex formatting compatibility ==== |
||
Check {{section link||Quoting}}, and {{section link|Help:Table|Nested tables}} (for nesting demo). |
|||
<li>{{tq2|1=<nowiki/>{{tq2|1=<nowiki/> |
|||
'''Quoted URLs with query strings break the template''' |
|||
==== Quoted URLs with query strings break the template ==== |
|||
... |
|||
<syntaxhighlight lang="wikitext"> |
|||
{{Talk quote block|This here diff: https://en.wikipedia.org/enwiki/w/index.php?title=User:IamNotU/sandbox&diff=904787385&oldid=904785977}} |
|||
<syntaxhighlight lang="moin"> |
|||
{{tq2|This here diff: https://en.wikipedia.org/enwiki/w/index.php?title=User:IamNotU/sandbox&diff=904787385&oldid=904785977}} |
|||
</syntaxhighlight> |
</syntaxhighlight> |
||
When your template arguments contain an equals sign, you can't use implicit positional parameters because everything preceding the first equals sign gets parsed as the parameter name. The trick, in those situations, is to make the assignment {{em|explicit}}, so that your entire argument is unambiguously parsed as the value being assigned to that parameter. |
|||
Doesn't display at all: |
|||
{{tq2|This here diff: https://en.wikipedia.org/enwiki/w/index.php?title=User:IamNotU/sandbox&diff=904787385&oldid=904785977}}|by=IamNotU|ts=15:12, 4 July 2019 (UTC)|oldid=904789911}} |
|||
When your template arguments contain an equals sign, you can't use implicit positional parameters because everything preceding the first equals sign gets parsed as the parameter name. The trick, in those situations, is to make the assignment ''explicit'', so that your entire argument is unambiguously parsed as the value being assigned to that parameter. |
|||
<syntaxhighlight lang="wikitext"> |
|||
{{Talk quote block|1=This here diff: https://en.wikipedia.org/enwiki/w/index.php?title=User:IamNotU/sandbox&diff=904787385&oldid=904785977}} |
|||
[[wikt:IOW#Adverb|IOW]]: |
|||
<syntaxhighlight lang="moin"> |
|||
{{tq2|1=This here diff: https://en.wikipedia.org/enwiki/w/index.php?title=User:IamNotU/sandbox&diff=904787385&oldid=904785977}} |
|||
</syntaxhighlight> |
</syntaxhighlight> |
||
{{ |
{{Talk quote block|1=This here diff: https://en.wikipedia.org/enwiki/w/index.php?title=User:IamNotU/sandbox&diff=904787385&oldid=904785977}} |
||
Writing the transclusion as {{tlx|Talk quote block|2=1=...}} puts the entire URL on the right-hand side of an assignment to the first unnamed parameter, rather than it being parsed as a template parameter named <syntaxhighlight lang="wikitext" inline>This here diff: https://en.wikipedia.org/enwiki/w/index.php?title</syntaxhighlight> that's being assigned the value <syntaxhighlight lang="wikitext" inline>User:IamNotU/sandbox&diff=904787385&oldid=904785977</syntaxhighlight>. |
|||
Due to [[MediaWiki]]'s parsing limitations, embedding such templates into a [[Help:List|list]] (using the leading <code>*</code>/<code>#</code>/<code>;</code>/<code>:</code> syntax) is very likely to lead to unexpected results (for it regards the [[newline]] as the syntax delimiter [[Special:PermaLink/961705865#Common_mistakes|Help:List §§ Common mistakes]], and [[Special:PermaLink/961705865#Paragraphs_and_other_breaks|Paragraphs and other breaks]]). |
|||
Writing the transclusion as {{tlx|tq2|2=1=...}} puts the entire URL on the right-hand side of an assignment to the first unnamed parameter, rather than it being parsed as a template parameter named <syntaxhighlight lang="moin" inline>This here diff: https://en.wikipedia.org/enwiki/w/index.php?title</syntaxhighlight> that's being assigned the value <syntaxhighlight lang="moin" inline>User:IamNotU/sandbox&diff=904787385&oldid=904785977</syntaxhighlight>.|by=FeRDNYC|ts=16:25, 5 July 2019 (UTC)|oldid=904932036}}</li> |
|||
<li>Due to [[MediaWiki]]'s parsing limitations, embedding such templates into a [[Help:List|list]] (using the leading <code>*</code>/<code>#</code>/<code>;</code>/<code>:</code> syntax) is very likely to lead to unexpected results. (for it regards the [[newline]] as the syntax delimiter <sup>[Help:List §§ [[Special:PermaLink/961705865#Common_mistakes|Common mistakes]], and [[Special:PermaLink/961705865#Paragraphs_and_other_breaks|Paragraphs and other breaks]]]</sup>)</li> |
|||
<li>{{tq2|1=<nowiki/>{{tq2|1=<nowiki/>{{tq2|1=<nowiki/> |
|||
'''Play nice with ordered and unordered lists''' |
|||
==== Play nice with ordered and unordered lists ==== |
|||
* {{talkquote|Lorem ipsum}} |
|||
<syntaxhighlight lang="wikitext"> |
|||
Is there a way to get this template to function when used at the beginning of a list item? For instance <syntaxhighlight lang="moin" inline>* {{talkquote|Lorem ipsum}}</syntaxhighlight> will turn the bullet (or number) into a regular indent, rather than showing the bullet/number. It's fine if you put something between the bullet and template, but it'd be nice if it didn't need the hack.|by=Czar|ts=23:05, 6 February 2017 (UTC)|oldid=764078325}} |
|||
{{Lorem ipsum}} |
|||
As you can see by your own example above, this is now fixed. (It was fixed some time ago, I'm not sure exactly when.) Lists now play nicely with the {{tlc|tq}} templates, or vice versa. You can even colon-indent them on Talk pages, now! |
|||
: {{Talk quote block|source=Talk quote block|text=<nowiki/> |
|||
:::: {{tqb|I suspect the colon-indenting was the ''real'' motivation for fixing this.|source=[[User:FeRDNYC|FeRDNYC]] ([[User talk:FeRDNYC|talk]]) 14:31, 6 July 2019 (UTC)}}|by=FeRDNYC|ts=14:31, 6 July 2019 (UTC)|oldid=905053757}} |
|||
<syntaxhighlight lang="moin"> |
|||
:::: {{tqb|I suspect the colon-indenting was the ''real'' motivation for fixing this.|source=[[User:FeRDNYC|FeRDNYC]] ([[User talk:FeRDNYC|talk]]) 14:31, 6 July 2019 (UTC)}} |
|||
</syntaxhighlight> |
|||
<br/><br/> |
|||
{{tq2|1=<nowiki/> |
|||
{{cot|expand=yes|title=Ordered list, named parameter with nowiki, colon-indented following lorem ipsum paragraph}} |
|||
{{lorem ipsum}} |
|||
: {{Talk quote block|source={{tlx|Talk quote block}}|text=<nowiki /> |
|||
# Item one |
# Item one |
||
# Item two |
# Item two |
||
}} |
}} |
||
</syntaxhighlight> |
|||
{{cob}}|source=[[Special:PermaLink/962402214|Template:Talk quote block/testcases]]}} |
|||
<syntaxhighlight lang="moin"> |
|||
{{Lorem ipsum}} |
|||
: {{Talk quote block|source={{tlx|Talk quote block}}|text=<nowiki /> |
|||
: {{Talk quote block|source=Talk quote block|text=<nowiki/> |
|||
# Item one |
# Item one |
||
# Item two |
# Item two |
||
}} |
}} |
||
</syntaxhighlight> |
|||
<syntaxhighlight lang="wikitext"> |
|||
<br/> |
|||
<dl><dd>{{Talk quote block|1=<nowiki/> |
|||
<syntaxhighlight lang="moin"> |
|||
<dl><dd>{{tq2|1=<nowiki/> |
|||
# Item one |
# Item one |
||
# Item two|source={{tlx|Talk quote block}}}}</dd></dl> |
# Item two|source={{tlx|Talk quote block}}}}</dd></dl> |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
<dl><dd>{{tq2|1=<nowiki/> |
|||
<dl><dd>{{Talk quote block|1=<nowiki/> |
|||
# Item one |
# Item one |
||
# Item two|source={{tlx|Talk quote block}}}}</dd></dl |
# Item two|source={{tlx|Talk quote block}}}}</dd></dl> |
||
== |
== TemplateData == |
||
{{templatedata header}} |
|||
<templatedata> |
<templatedata> |
||
{ |
{ |
||
Line 203: | Line 212: | ||
"1" |
"1" |
||
], |
], |
||
"description": "The text being quoted", |
"description": "The text being quoted.", |
||
"type": "content", |
"type": "content", |
||
"required": true |
"required": true |
||
Line 211: | Line 220: | ||
"2" |
"2" |
||
], |
], |
||
"description": "The author of the text being quoted", |
"description": "The author of the text being quoted.", |
||
"type": "wiki-user-name", |
"type": "wiki-user-name", |
||
"suggested": true |
"suggested": true |
||
Line 224: | Line 233: | ||
], |
], |
||
"label": "No dash?", |
"label": "No dash?", |
||
"description": "Suppresses the em dash and space before source, for when pasting a sig that already starts with a dash", |
"description": "Suppresses the em dash and space before source, for when pasting a sig that already starts with a dash.", |
||
"type": "boolean" |
"type": "boolean" |
||
}, |
}, |
||
"ts": { |
"ts": { |
||
"label": "Timestamp", |
"label": "Timestamp", |
||
"description": "The timestamp of the edit whose text is being quoted", |
"description": "The timestamp of the edit whose text is being quoted.", |
||
"suggestedvalues": [ |
"suggestedvalues": [ |
||
"~~~~~" |
"~~~~~" |
||
], |
], |
||
"suggested": true |
"suggested": true |
||
}, |
|||
"id": { |
|||
"label": "ID", |
|||
"description": "The ID of the comment that will be used in a link to it if the ts parameter is also present. You can copy it by right-clicking the timestamp.", |
|||
"type": "string" |
|||
}, |
}, |
||
"oldid": { |
"oldid": { |
||
"label": " |
"label": "Revision ID", |
||
"description": "The revision ID of the edit introducing the change that was made. Displayed as the timestamp linking to the Diff of the edit. (requires ts parameter or is not shown)", |
"description": "The revision ID of the edit introducing the change that was made. Displayed as the timestamp linking to the Diff of the edit. (requires ts parameter or is not shown)", |
||
"type": "number" |
"type": "number" |
||
}, |
}, |
||
"diff": { |
"diff": { |
||
"description": "The |
"description": "The link to the diff comparing target.", |
||
"type": "number" |
"type": "number" |
||
}, |
|||
"noping": { |
|||
"aliases": [ |
|||
"no-ping" |
|||
], |
|||
"label": "No ping?", |
|||
"description": "Suppresses the link to the author to avoid notifying them.", |
|||
"type": "boolean" |
|||
} |
} |
||
}, |
}, |
||
"description": "Formats quoted text (from another's comments, a policy statement, etc.) in a block, for use on talk pages and noticeboards", |
"description": "Formats quoted text (from another's comments, a policy statement, etc.) in a block, for use on talk pages and noticeboards.", |
||
"paramOrder": [ |
"paramOrder": [ |
||
"text", |
"text", |
||
Line 252: | Line 274: | ||
"nodash", |
"nodash", |
||
"ts", |
"ts", |
||
"id", |
|||
"oldid", |
"oldid", |
||
"diff", |
"diff", |
||
"style" |
"style", |
||
"noping" |
|||
] |
] |
||
} |
} |
||
</templatedata> |
</templatedata> |
||
== See also == |
|||
{{Quotation templates}} |
{{Quotation templates}} |
||
{{Inline talk templates}} |
{{Inline talk templates}} |
||
<includeonly>{{Sandbox other| |
<includeonly>{{Sandbox other|| |
||
<!-- Categories below this line, please; interwikis at Wikidata --> |
|||
[[Category:Talk namespace quotation templates]] |
[[Category:Talk namespace quotation templates]] |
||
[[ja:Template:Talkquote]] |
|||
}}</includeonly> |
}}</includeonly> |
Latest revision as of 11:30, 16 September 2024
This is a documentation subpage for Template:Talk quote block. It may contain usage information, categories and other content that is not part of the original template page. |
This template is used on approximately 17,000 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
This template uses TemplateStyles: |
Use {{Talk quote block}}
or {{tqb}}
to quote (another's comments, a policy statement, etc.) in a block, on talk pages and noticeboards. It can be safely used after colon-indenting as well (see the § Indenting example below (§ Caveats). For a short inline quote, instead use {{Talk quote inline}}
.
Usage
[edit]Unnamed (positional) parameters:
{{Talk quote block|text|by}}
- The order of positional parameters cannot change - text must come before by.
Named parameters:
{{Talk quote block|text=|by=|source=|ts=|id=}}
Parameters
[edit]|text=
(or|1=
): The text being quoted.|by=
(or|2=
): The author of the text being quoted. A Wikipedia username is expected, and the username will be provided as a wikilink to the author's user page.|source=
: The source of the text being quoted. Use instead of|by=
when source is not individual user name, or when copy-pasting an entire sig.|ts=
: The timestamp of the edit whose text is being quoted. Hint: You can use five tildes to supply the current date and time:|ts=~~~~~
.|id=
: The ID of the comment that will be used in a link to it if the|ts=
parameter is also present. You can copy it by right-clicking the timestamp.|oldid=
: The revision ID of the edit introducing the change that was made. Displayed as the timestamp linking to the diff of the edit. (requires|ts=
or is not shown).|diff=
: The link to the diff comparing target.|style=
: HTML in-line style. (see the testcases)|nodash=y
or|no-dash=y
: Suppresses the em dash and space before|source=
, for when pasting a sig that already starts with a dash.|noping=y
or|no-ping=y
: Suppresses the link to the author to avoid notifying them.
Examples
[edit]{{Talk quote block|some random text|Example}}
gives:some random text
— User:Example{{Talk quote block|more random text|Example|ts=08:52, 21 May 2011 (UTC)}}
gives:more random text
— User:Example 08:52, 21 May 2011 (UTC){{Talk quote block|Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.|Example User|ts=08:52, 21 May 2011 (UTC)|id=c-Example_User-20240604182100-Example}}
gives:Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
— User:Example User 08:52, 21 May 2011 (UTC){{Talk quote block|different random text|Example|ts=08:52, 21 May 2011 (UTC)|oldid=139992}}
gives:different random text
— User:Example 08:52, 21 May 2011 (UTC)
Note: |ts=
must be present for |oldid=
link to show.
Suggested boilerplate
[edit]{{Talk quote block|1=<nowiki/>
|source=}}
{{Talk quote block|1=<nowiki/>
|by=|ts=|id=}}
{{Talk quote block|1=<nowiki/>
|by=|ts=|oldid=}}
Indenting
[edit]The template works with standard talk page indentation, as the following example illustrates. This wiki-markup:
Random paragraph of text. [[User:Example|Example]] ([[User talk:Example|talk]]) 09:20, 21 May 2011 (UTC)
:Opening statement by [[User:Example2|Some other user]].
:{{talk quote block|Quoting an item from random paragraph.}}
:Response to quoted text. [[User:Example2|Some other user]] ([[User talk:Example2|talk]]) ~~~~~
Displays the following:
Random paragraph of text. Example (talk) 09:20, 21 May 2011 (UTC)
- Opening statement by Some other user.
Quoting an item from random paragraph.
- Response to quoted text. Some other user (talk) 09:26, 21 May 2011 (UTC)
Indented multi-line quote
[edit]To create an indented multi-line quote (such as within a a reply on a talk page), you must use <br/> tags to indicate the line breaks, but do not use manual line breaks. Refer to the following example:
Random paragraph of text. [[User:Example|Example]] ([[User talk:Example|talk]]) 09:20, 21 May 2011 (UTC)
:Opening statement by [[User:Example2|Some other user]].
:{{talk quote block|Quoting an item from random paragraph.<br/>Including a second line.}}
:Response to quoted text. [[User:Example2|Some other user]] ([[User talk:Example2|talk]]) ~~~~~
Displays the following:
Random paragraph of text. Example (talk) 09:20, 21 May 2011 (UTC)
- Opening statement by Some other user.
Quoting an item from random paragraph.
Including a second line.- Response to quoted text. Some other user (talk) 09:26, 21 May 2011 (UTC)
Quoting lists
[edit]If the text you are quoting is a bulleted or numbered list, the first list item must start on a new line, or it won't be rendered properly. For example:
Wiki-markup | Output |
---|---|
Wrong way
{{talk quote block|* Item one
* Item two
}}
|
First item isn't bulleted correctly:
|
Right way
{{talk quote block|
* Item one
* Item two
}}
|
All items are bulleted correctly:
|
If you are using the |text=
named parameter (as opposed to simply supplying your list as the first parameter) please add the following code: <nowiki />
after the =
sign. The reason is that the MediaWiki parser automatically removes line breaks at the start of the text, causing the list to be displayed improperly otherwise. Example:
Wiki-markup | Output |
---|---|
Wrong way
{{talk quote block|text=
# Item one
# Item two
}}
|
First item isn't numbered correctly:
|
Right way
{{talk quote block|text=<nowiki />
# Item one
# Item two
}}
|
All items are numbered correctly:
|
Caveats
[edit]Complex formatting compatibility
[edit]Check § Quoting, and Help:Table § Nested tables (for nesting demo).
Quoted URLs with query strings break the template
[edit]{{Talk quote block|This here diff: https://en.wikipedia.org/enwiki/w/index.php?title=User:IamNotU/sandbox&diff=904787385&oldid=904785977}}
When your template arguments contain an equals sign, you can't use implicit positional parameters because everything preceding the first equals sign gets parsed as the parameter name. The trick, in those situations, is to make the assignment explicit, so that your entire argument is unambiguously parsed as the value being assigned to that parameter.
{{Talk quote block|1=This here diff: https://en.wikipedia.org/enwiki/w/index.php?title=User:IamNotU/sandbox&diff=904787385&oldid=904785977}}
This here diff: https://en.wikipedia.org/enwiki/w/index.php?title=User:IamNotU/sandbox&diff=904787385&oldid=904785977
Writing the transclusion as {{Talk quote block|1=...}}
puts the entire URL on the right-hand side of an assignment to the first unnamed parameter, rather than it being parsed as a template parameter named This here diff: https://en.wikipedia.org/enwiki/w/index.php?title
that's being assigned the value User:IamNotU/sandbox&diff=904787385&oldid=904785977
.
Due to MediaWiki's parsing limitations, embedding such templates into a list (using the leading *
/#
/;
/:
syntax) is very likely to lead to unexpected results (for it regards the newline as the syntax delimiter Help:List §§ Common mistakes, and Paragraphs and other breaks).
Play nice with ordered and unordered lists
[edit]{{Lorem ipsum}}
: {{Talk quote block|source=Talk quote block|text=<nowiki/>
# Item one
# Item two
}}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
- Item one
- Item two
— Talk quote block
<dl><dd>{{Talk quote block|1=<nowiki/>
# Item one
# Item two|source={{tlx|Talk quote block}}}}</dd></dl>
- Item one
- Item two
—{{Talk quote block}}
TemplateData
[edit]TemplateData for Talk quote block
Formats quoted text (from another's comments, a policy statement, etc.) in a block, for use on talk pages and noticeboards.
Parameter | Description | Type | Status | |
---|---|---|---|---|
text | text 1 | The text being quoted. | Content | required |
by | by 2 | The author of the text being quoted. | User | suggested |
source | source | The source of the text being quoted. Use instead of by when source is not individual user name, or when copy-pasting an entire sig. | Line | optional |
No dash? | nodash no-dash | Suppresses the em dash and space before source, for when pasting a sig that already starts with a dash. | Boolean | optional |
Timestamp | ts | The timestamp of the edit whose text is being quoted.
| Unknown | suggested |
ID | id | The ID of the comment that will be used in a link to it if the ts parameter is also present. You can copy it by right-clicking the timestamp. | String | optional |
Revision ID | oldid | The revision ID of the edit introducing the change that was made. Displayed as the timestamp linking to the Diff of the edit. (requires ts parameter or is not shown) | Number | optional |
diff | diff | The link to the diff comparing target. | Number | optional |
style | style | HTML in-line style. | Unknown | optional |
No ping? | noping no-ping | Suppresses the link to the author to avoid notifying them. | Boolean | optional |
See also
[edit]