Template:Quote2/doc: Difference between revisions

From MEpedia, a crowd-sourced encyclopedia of ME and CFS science and history
m (unlink play)
(tidy, add example with named parameters)
Line 1: Line 1:
{{Documentation subpage}}
{{Documentation subpage}}


{{For|displaying a quote with graphical speech marks.}}
== Usage ==
== Usage ==


Line 11: Line 10:


;Unnamed (positional) parameters
;Unnamed (positional) parameters
<code><nowiki>{{quote2|phrase|author|source}}</nowiki></code>
<code><nowiki>{{quote2|text|author|source}}</nowiki></code>
This markup will fail if any parameter contains an equals sign (=).
This markup will fail if any parameter contains an equals sign (=).


;Numbered (positional) parameters
;Numbered (positional) parameters
<code><nowiki>{{quote2|1=phrase|2=author|3=source}}</nowiki></code>
<code><nowiki>{{quote2|1=text|2=author|3=source}}</nowiki></code>


=== Example ===
=== Examples ===


;Wikitext:
;Wikitext:
<code><nowiki>{{Quote2|text=Cry "Havoc" and let slip the dogs of war.|author=William Shakespeare|source=''Julius Caesar (play)'', act III, scene I}}</nowiki></code>
<code><nowiki>{{Quote2|1=Cry "Havoc" and let slip the dogs of war.|2=William Shakespeare|3=Julius Caesar (play), act III, scene I}}</nowiki></code>
 
;Result
{{Quote2|1=Cry "Havoc" and let slip the dogs of war.|2=William Shakespeare|3=Julius Caesar (play), act III, scene I}}
 
;Wikitext:
<code><nowiki>{{Quote2|text=We are told not to worry about breakthrough cases because they are ‘mild’ – but long Covid is anything but mild|author=Hannah Davis|source=The Guardian}}</nowiki></code>


;Result:
;Result:
{{Quote2|1=Cry "Havoc" and let slip the dogs of war.|2=William Shakespeare|3=Julius Caesar (play), act III, scene I}}
{{Quote2|text=We are told not to worry about breakthrough cases because they are ‘mild’ – but long Covid is anything but mild|author=Hannah Davis|source=The Guardian}}


=== Restrictions ===
=== Restrictions ===
Line 57: Line 62:
},
},
"2": {
"2": {
"label": "author",
"label": "author(s)",
"description": "The person who is being quoted, can be linked ",
"description": "The person who is being quoted, can be linked ",
"type": "string",
"type": "string",

Revision as of 12:07, August 13, 2021

Usage[edit source]

{{Quote2}} adds a block quotation to an article page.

Note: Block quotes do not normally contain quotation marks. See Manual of style.

Synopsis[edit source]

Unnamed (positional) parameters

{{quote2|text|author|source}} This markup will fail if any parameter contains an equals sign (=).

Numbered (positional) parameters

{{quote2|1=text|2=author|3=source}}

Examples[edit source]

Wikitext

{{Quote2|1=Cry "Havoc" and let slip the dogs of war.|2=William Shakespeare|3=Julius Caesar (play), act III, scene I}}

Result
Cry "Havoc" and let slip the dogs of war.

—William Shakespeare,  Julius Caesar (play), act III, scene I


Wikitext

{{Quote2|text=We are told not to worry about breakthrough cases because they are ‘mild’ – but long Covid is anything but mild|author=Hannah Davis|source=The Guardian}}

Result
We are told not to worry about breakthrough cases because they are ‘mild’ – but long Covid is anything but mild

—Hannah Davis,  The Guardian


Restrictions[edit source]

If you do not provide quoted text, the template generates a parser error message, which will appear in red text in the rendered page.

If any parameter's actual value contains an equals sign (=), you must use named parameters. (The equals sign gets interpreted as a named parameter otherwise.)

If any parameter's actual value contains characters used for wiki markup syntax (such as pipe, brackets, single quotation marks, etc.), you may need to escape it. See Template:! and friends.

Be wary of URLs which contain restricted characters. The equals sign is especially common.

Multiple paragraphs[edit source]

The <blockquote> element and any templates that use it do not honor newlines:

Markup Renders as
<blockquote>
Line 1
Line 2
Line 3
Line 4
</blockquote>

Line 1 Line 2 Line 3 Line 4

The simplest workaround for this is to use the <poem> tag inside <blockquote>, which will convert line breaks to <br /> tags:

Markup Renders as
<blockquote><poem>
Line 1
Line 2
Line 3
Line 4
</poem></blockquote>

<poem>

Line 1 Line 2 Line 3 Line 4

</poem>

TemplateData[edit source]

This is the TemplateData documentation for this template used by VisualEditor and other tools; see the monthly error report for this template.

TemplateData for Quote2

Adds a quote with graphical speech marks.

Template parameters

ParameterDescriptionTypeStatus
text1 1 quote

The text to quote

Stringrequired
author(s)2 2 person author

The person who is being quoted, can be linked

Example
[[Charles Shepherd]]
Stringsuggested
source3 3 book article

A source for the quote - book, article, etc

Example
The flu vaccine and Chronic Fatigue Syndrome
Stringsuggested

See also[edit source]