Jump to content

Template:Talk quote block/doc: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
syntaxhighlight lang="wikitext"
m Reverted 1 edit by 2C0F:FC89:80B8:839:1:0:BC17:50BB (talk) to last revision by Paine Ellsworth
 
(8 intermediate revisions by 6 users not shown)
Line 2: Line 2:
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
<!-- 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}}
{{#ifeq:{{SUBPAGENAME}}|sandbox||{{High-use}}}}
{{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}}
Line 14: Line 14:


Named parameters:
Named parameters:
* {{tlx|Talk quote block|text{{=}}|by{{=}}|source{{=}}|ts{{=}}|oldid{{=}}}}
* {{tlx|Talk quote block|text{{=}}|by{{=}}|source{{=}}|ts{{=}}|id{{=}}}}


== Parameters ==
== Parameters ==
Line 21: Line 21:
* {{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|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|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|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 {{para|ts}} or is not shown).
* {{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|diff}}: The revision ID of the [[Help:Diff|diff]] comparing target.
* {{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|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|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 ==
== Examples ==
* {{tlx|Talk quote block|some random text|Example}} gives:
* {{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>
<div style="background-color:#f9f9f9; 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|more random text|Example|ts{{=}}08:52, 21 May 2011 (UTC)}} 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>
* {{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>
* {{tlx|Talk quote block|different random text|Example|ts{{=}}08:52, 21 May 2011 (UTC)|oldid{{=}}139992}} 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: {{para|ts}} must be present for {{para|oldid}} link to show.
Note: {{para|ts}} must be present for {{para|oldid}} link to show.
Line 40: Line 40:
{{Talk quote block|1=<nowiki/>
{{Talk quote block|1=<nowiki/>
|source=}}
|source=}}
</syntaxhighlight>

<syntaxhighlight lang="wikitext">
{{Talk quote block|1=<nowiki/>
|by=|ts=|id=}}
</syntaxhighlight>
</syntaxhighlight>


Line 51: Line 56:
<syntaxhighlight lang="wikitext">
<syntaxhighlight lang="wikitext">
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:User|Some other 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:User|Some other user]] ([[User talk:User|talk]]) ~~~~~
:Response to quoted text. [[User:Example2|Some other user]] ([[User talk:Example2|talk]]) ~~~~~
</syntaxhighlight>
</syntaxhighlight>


Displays the following:
Displays the following:
<div style="background-color:#f9f9f9; border:1px dashed #3170ab; padding:3px 10px 3px 10px">
<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:User|Some other 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:User|Some other user]] ([[User talk:User|talk]]) 09:26, 21 May 2011 (UTC)
: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>


Line 76: Line 98:
</syntaxhighlight>
</syntaxhighlight>
| First item isn't bulleted correctly:
| First item isn't bulleted correctly:
<div style="background-color:#f9f9f9; border:1px dashed #3170ab; padding:3px 10px 3px 10px">
<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 90: Line 112:
</syntaxhighlight>
</syntaxhighlight>
| All items are bulleted correctly:
| All items are bulleted correctly:
<div style="background-color:#f9f9f9; border:1px dashed #3170ab; padding:3px 10px 3px 10px">
<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 110: Line 132:
</syntaxhighlight>
</syntaxhighlight>
| First item isn't numbered correctly:
| First item isn't numbered correctly:
<div style="background-color:#f9f9f9; border:1px dashed #3170ab; padding:3px 10px 3px 10px">
<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 125: Line 147:
</syntaxhighlight>
</syntaxhighlight>
| All items are numbered correctly:
| All items are numbered correctly:
<div style="background-color:#f9f9f9; border:1px dashed #3170ab; padding:3px 10px 3px 10px">
<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 190: Line 212:
"1"
"1"
],
],
"description": "The text being quoted",
"description": "The text being quoted.",
"type": "content",
"type": "content",
"required": true
"required": true
Line 198: 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 211: 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": "Old ID",
"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 revision ID of the Diff comparing target.",
"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 239: Line 274:
"nodash",
"nodash",
"ts",
"ts",
"id",
"oldid",
"oldid",
"diff",
"diff",
"style"
"style",
"noping"
]
]
}
}

Latest revision as of 11:30, 16 September 2024

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:

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:

* Item one

  • Item two
Right way
{{talk quote block|
* Item one
* Item two
}}
All items are bulleted correctly:
  • Item one
  • Item two

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:

# Item one

  1. Item two
Right way
{{talk quote block|text=&lt;nowiki /&gt;
# Item one
# Item two
}}
All items are numbered correctly:
  1. Item one
  2. Item two

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.

  1. Item one
  2. Item two
    — Talk quote block
<dl><dd>{{Talk quote block|1=<nowiki/>
# Item one
# Item two|source={{tlx|Talk quote block}}}}</dd></dl>
  1. Item one
  2. Item two
    — {{Talk quote block}}

TemplateData

[edit]
This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Talk quote block in articles based on its TemplateData.

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.

Template parameters

ParameterDescriptionTypeStatus
texttext 1

The text being quoted.

Contentrequired
byby 2

The author of the text being quoted.

Usersuggested
sourcesource

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.

Lineoptional
No dash?nodash no-dash

Suppresses the em dash and space before source, for when pasting a sig that already starts with a dash.

Booleanoptional
Timestampts

The timestamp of the edit whose text is being quoted.

Suggested values
~~~~~
Unknownsuggested
IDid

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.

Stringoptional
Revision IDoldid

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)

Numberoptional
diffdiff

The link to the diff comparing target.

Numberoptional
stylestyle

HTML in-line style.

Unknownoptional
No ping?noping no-ping

Suppresses the link to the author to avoid notifying them.

Booleanoptional

See also

[edit]