「テンプレート:Talk quote block」の版間の差分
Template:Talk quote block>Izno (remove the deliberate whitespace per VPT) |
細 (1版 をインポートしました) |
(相違点なし)
|
2023年5月14日 (日) 10:29時点における最新版
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.
This template is used on approximately 13,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[ソースを編集]
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=|oldid=}}
Parameters[ソースを編集]
|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=~~~~~
.|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 revision ID of 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.
Examples[ソースを編集]
{{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|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[ソースを編集]
{{Talk quote block|1=<nowiki/>
|source=}}
{{Talk quote block|1=<nowiki/>
|by=|ts=|oldid=}}
Indenting[ソースを編集]
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:User|Some other user]].
:{{talk quote block|Quoting an item from random paragraph.}}
:Response to quoted text. [[User:User|Some other user]] ([[User talk:User|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)
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:
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[ソースを編集]
Complex formatting compatibility[ソースを編集]
Check § Quoting, and Help:Table § Nested tables (for nesting demo).
Quoted URLs with query strings break the template[ソースを編集]
{{Talk quote block|This here diff: https://en.wikipedia.org/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/w/index.php?title=User:IamNotU/sandbox&diff=904787385&oldid=904785977}}
This here diff: https://en.wikipedia.org/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/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[ソースを編集]
{{Lorem ipsum}}
: {{Talk quote block|source=Talk quote block|text=<nowiki/>
# Item one
# Item two
}}
- 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[ソースを編集]
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
引数 | 説明 | 型 | 状態 | |
---|---|---|---|---|
text | text 1 | The text being quoted | 内容 | 必須 |
by | by 2 | The author of the text being quoted | 利用者 | 推奨 |
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. | 行 | 省略可能 |
No dash? | nodash no-dash | Suppresses the em dash and space before source, for when pasting a sig that already starts with a dash | ブール値 | 省略可能 |
Timestamp | ts | The timestamp of the edit whose text is being quoted
| 不明 | 推奨 |
Old 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) | 数値 | 省略可能 |
diff | diff | The revision ID of the Diff comparing target. | 数値 | 省略可能 |
style | style | HTML in-line style. | 不明 | 省略可能 |