Template:Cquote/doc: Difference between revisions

m
175 revisions imported from wikipedia:Template:Cquote/doc
(→‎Examples: +{{cquote|1=quote text}} example, some formatting tweaks)
m (175 revisions imported from wikipedia:Template:Cquote/doc)
 
(169 intermediate revisions by 84 users not shown)
Line 1:
{{Documentation subpage}}{{TOC right}}
----
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->
<includeonly>:''This template documentation is [[Wikipedia:Template doc page pattern|transcluded]] from [[{{FULLPAGENAME}}/doc]]'' [<span class="plainlinks">[{{fullurl:{{FULLPAGENAMEE}}/doc|action=edit}} edit]</span>]</includeonly>
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->__NOTOC__
 
{{Blockquote/doc/boilerplate}}
'''Usage:''' <code><nowiki>{{cquote|quote text|quote width in pixels|quote height in pixels|Origin of quote|Cited source}}</nowiki><code>
* Only the first parameter is required.
 
== Usage ==
# <code><nowiki>{{cquote|quote text}}</nowiki></code>
For quotes, this template provides a centered, borderless quote, with scalable decorative quotation marks, and optional attribution of the source of the quote. It can be used with or without the names of the parameters.
# <code><nowiki>{{cquote|quote text|quotewidth=40px|quoteheight=40px}}</nowiki></code> or <code><nowiki>{{cquote|quote text|40px|40px}}</nowiki></code>
 
# <code><nowiki>{{cquote|quote text|quote width in pixels|quote height in pixels|Origin of quote|Cited source}}</nowiki></code>
===Syntax===
* {{tlx|{{BASEPAGENAME}}|2=quote={{var|text of the quotation}}|3=author={{var|person quoted}}|4=source={{var|source of the quotation}}}}
 
===Parameters===
*; Parameter <code>1</code>, <code>quote</code>: text of the quote; use <code><nowiki><br{{tag|p}} />around second or betweensubsequent paragraphs. </nowiki></code>[REQUIRED]
: '''''Required'''''
::'''Note''': if the quote text contains one or more "=" (equal signs), then the template must be called as <nowiki>{{cquote|</nowiki>'''<span style="color:red">1=</span>'''<nowiki>quote text}}</nowiki> (see [http://meta.wikimedia.org/wiki/Help:Templates#Equals_sign_in_parameter_value "Equals sign in parameter value"])
: {{A note}} if the quote text contains a <code>=</code> (equals sign), then the template must be called with a named parameter for the content. For example: {{tlx|Cquote|{{stronggood|quote{{=}}}}{{var|quote text{{=}}more quoted text}}}} {{Crossreference|1=(see {{section link|Help:Template#Usage hints and workarounds}})}}.
; <code>author</code>: Name of the person that wrote or spoke the text being quoted. Can include wiki syntax.
; <code>source</code>: Source of the quote (publication title, speech, etc.). Can include wiki syntax. Can be used without {{para|author}} (e.g. for a scripture, law, or other source without an author ''per se'')
; <code>bgcolor</code>: The color of the background. This parameter is disabled in article space.
; <code>float</code>: Defaults to center, but can also be right or left. Usually used with {{para|width|30%}} or so (otherwise for quotes longer than one line on the rendered page, the float will have no useful effect). This parameter is disabled in article space.
; <code>width</code>: for example {{para|width|30%}}. This parameter is disabled in article space.
; <code>qcolor</code>: color of quotemarks, for example {{para|qcolor|#FF0000}} for a red color (only for use in [[WP:Signpost]], and personal pages; do not use in articles, guidelines, etc.). This parameter is disabled in article space.
; <code>rtl</code>: set to any non-blank value for quotes that should be rendered from right to left (e.g., Arabic). Adds the necessary dir attribute and reverses the quotes. This parameter is disabled in article space.
; <code>quotealign</code>: set to center to center align the quote text. This parameter is disabled in article space.
'''Deprecated''':
; <code style="color: DarkRed;">wide</code>: In older versions of the template, when this was set to "yes", the quote expanded to the entire width of the page, which was useful for long quotes. However, it clashed with other floating objects, such as infoboxes, and the template now auto expands and line wraps as needed (full page, or within a {{para|width}} constraint). This parameter is disabled in article space.
 
===Simple example===
<pre>{{Cquote|quote text}}</pre>
{{Cquote|To be, or not to be ...}}
 
===Sourced example===
<syntaxhighlight lang="moin">{{Cquote|Life is like riding a bicycle. To keep your balance you must keep moving.
|author=[[Albert Einstein]]
|source=in a letter to his son<ref>[[Walter Isaacson]], ''Einstein: His Life and Universe'' (2007), p. 367.</ref>
}}</syntaxhighlight>
 
{{Cquote|Life is like riding a bicycle. To keep your balance you must keep moving.
|author=[[Albert Einstein]]
|source=in a letter to his son<ref>[[Walter Isaacson]], ''Einstein: His Life and Universe'' (2007), p. 367.</ref>
}}
 
{{reflist}}
The next two parameters can be used to scale the graphical [[quotation mark]]s up and down to suit larger or smaller quotes.
* Parameter 2: "quotewidth" - desired width of the quote image; defaults to 20px
* Parameter 3: "quoteheight" - desired height of the quote image; defaults to 20px.
 
===Other examples===
The last two parameters can be used to provide attribution for the quote:
<pre>{{Cquote|1=F=ma|author=[[Isaac Newton]]}}</pre>
* Parameter 4: Name of the person that wrote or spoke the text being quoted. Can include links.
(the ''1='' is necessary as quote text contains an equals sign)
* Parameter 5: Source of the quote (publication title, speech, etc.). Can include links.
{{Cquote|1=F=ma|author=[[Isaac Newton]]}}
 
 
<pre>{{Cquote|1=Thus:
===Examples===
{{in5}}<math>E=mc^2</math>|author=[[Albert Einstein]]}}</pre>
;<code><nowiki>{{cquote|quote text}}</nowiki></code>
(quote text contains an equals sign and math syntax)
As [[Amy Tan]] once said
{{Cquote|1=Thus:
{{Cquote|External success has to do with people who may see me as a model, or an example, or a representative. As much as I may dislike or want to reject that responsibility, this is something that comes with public success. It's important to give others a sense of hope that it is possible and you can come from really different places in the world and find your own place in the world that's unique for yourself.}}
{{in5}}<math>E=mc^2</math>|author=[[Albert Einstein]]}}
 
;<code><nowiki>{{cquote|1=quote text}}</nowiki></code> (quote text contains an equal sign)
{{cquote|1=The essential point, established by Lorentz, is that the equations of the electromagnetic field are not altered by a certain transformation (which I will call by the name of Lorentz) of the form{{rf|2|LT1904}}:
::<math>x^\prime = k\ell\left(x + \varepsilon t\right),</math><math>t^\prime = k\ell\left(t + \varepsilon x\right),</math><math>y^\prime = \ell y,</math> <math>z^\prime = \ell z,</math><math> k = 1/\sqrt{1-\varepsilon^2}.</math>}}
 
<pre>{{Cquote|Congress shall make no law respecting an establishment of religion, or prohibiting the free exercise thereof; or abridging the freedom of speech, or of the press; or the right of the people peaceably to assemble, and to petition the Government for a redress of grievances.|source=First Amendment to the Constitution of the United States |float=right |width=30%}}</pre>
;<code><nowiki>{{cquote|quote text|40px|40px}}</nowiki></code>
(source with no author; floated right and width-constrained)
{{Cquote|You have the right to remain silent. If you give up that right, anything you say can and will be used against you in a court of law. You have the right to an attorney and to have an attorney present during questioning. If you cannot afford an attorney, one will be provided to you at no cost. During any questioning, you may decide at any time to exercise these rights, not answer any questions, or make any statements.|40px|40px}}
{{Cquote|Congress shall make no law respecting an establishment of religion, or prohibiting the free exercise thereof; or abridging the freedom of speech, or of the press; or the right of the people peaceably to assemble, and to petition the Government for a redress of grievances.|source=First Amendment to the Constitution of the United States |float=right |width=30%}}
Note that it will wrap around article text like this.{{Lorem ipsum}}{{clear|both}}
 
;<code><nowiki>{{cquote|quote text|30px|30px|Origin of quote|Cited source}}</nowiki></code>
{{cquote|And when they've given you their all / Some stagger and fall, after all it's not easy / Banging your heart against some mad bugger's wall.|30px|30px|[[Pink Floyd]]|''[[The Wall]]''}}
 
<pre>{{Cquote|Congress shall make no law respecting an establishment of religion, or prohibiting the free exercise thereof; or abridging the freedom of speech, or of the press; or the right of the people peaceably to assemble, and to petition the Government for a redress of grievances.|source=First Amendment to the Constitution of the United States |width=50%}}</pre>
===Limitations===
(same quote, no float, width constraint)
Note that <nowiki>{{Cquote|Some text {{ref|Some ref}} }}</nowiki> doesn't work. You may find that <nowiki>{{Cquote|Some text}}{{ref|Some ref}}</nowiki> gives ugly results. [[User:Angusmclellan|Angus McLellan]] 18:35, 15 March 2006 (UTC)
{{Cquote|Congress shall make no law respecting an establishment of religion, or prohibiting the free exercise thereof; or abridging the freedom of speech, or of the press; or the right of the people peaceably to assemble, and to petition the Government for a redress of grievances.|source=First Amendment to the Constitution of the United States |width=50%}}
 
<nowiki>{{Cquote|Some text <ref>Some ref</ref> }}</nowiki>, however, does work. [[User:Run!|<font size="-2" color="white" style="background:red">&nbsp;'''-- Run!'''&nbsp;</font>]] 14:55, 3 May 2006 (UTC)
 
<pre>{{Cquote|Congress shall make no law respecting an establishment of religion, or prohibiting the free exercise thereof; or abridging the freedom of speech, or of the press; or the right of the people peaceably to assemble, and to petition the Government for a redress of grievances.|source=First Amendment to the Constitution of the United States}}</pre>
===Related templates===
(same quote, no float, no width setting – for short quote, would use as much of line as necessary, and for longer quotes, full width of page, wrapping for multiple lines.)
*{{tl|quotation}}
{{Cquote|Congress shall make no law respecting an establishment of religion, or prohibiting the free exercise thereof; or abridging the freedom of speech, or of the press; or the right of the people peaceably to assemble, and to petition the Government for a redress of grievances.|source=First Amendment to the Constitution of the United States}}
*{{tl|quote box}}
*{{tl|rquote}}
 
===TemplateData===
<includeonly>
{{TemplateData header}}
<!-- ADD CATEGORIES BELOW THIS LINE -->
<templatedata>
[[category:Quotation templates|{{PAGENAME}}]]
{
"params": {
"2": {},
"3": {
"deprecated": true
},
"4": {
"deprecated": true
},
"5": {
"deprecated": true
},
"float": {
"label": "Float",
"description": "Position the quote to float on the right or left side of the content",
"example": "left",
"type": "string"
},
"bgcolor": {
"label": "Background color",
"description": "The background color for the quote",
"type": "string",
"default": "transparent"
},
"wide": {
"label": "Full width",
"description": "In older versions of the template, when this was set to \"yes\", the quote expanded to the entire width of the page, which was useful for long quotes. However, it clashed with other floating objects, such as infoboxes, and the template now auto expands and line wraps as needed (full page, or within a |width= constraint).",
"type": "boolean",
"deprecated": "Replace it with width=100%"
},
"width": {
"label": "Width",
"description": "The width of the quote",
"example": "30%",
"type": "string",
"default": "Sized to fit content (auto)",
"autovalue": ""
},
"qcolor": {
"label": "Quotation mark color",
"description": "Color of quotemarks (only for use in WP:Signpost, and personal pages; do not use in articles, guidelines, etc.)",
"example": "#FF0000 for a red color",
"default": "#B2B7F2"
},
"small": {
"deprecated": "This is an option of a template that was merged into this one. You can remove it."
},
"quote": {
"aliases": [
"1",
"quotetext",
"text",
"content"
],
"label": "Quote",
"description": "The quote to be visually repeated",
"type": "content",
"required": true
},
"author": {
"aliases": [
"personquoted"
],
"label": "Author",
"description": "Name of the person that wrote or spoke the text being quoted",
"example": "[[Albert Einstein]]",
"type": "content",
"suggested": true
},
"personquoted": {
"deprecated": "This is an option of a template that was merged into this one. You can replace it with 'author'."
},
"source": {
"aliases": [
"publication",
"title",
"quotesource"
],
"label": "Source",
"description": "Source of the quote (publication title, speech, etc.). Can include wiki syntax. Can be used without |author= (e.g. for a scripture, law, or other source without an author per se)",
"example": "in a letter to his son<ref>[[Walter Isaacson]], ''Einstein: His Life and Universe'' (2007), p. 367.</ref>",
"type": "content",
"suggested": true
},
"publication": {
"deprecated": "This is an option of a template that was merged into this one. You can replace it with 'source'"
},
"title": {
"deprecated": true
},
"quotesource": {
"deprecated": "This is an option of a template that was merged into this one. You can replace it with 'source'."
},
"rtl": {
"label": "Direction",
"description": "Sets scrript direction right-to-left (Arabic, Hebrew)",
"example": "rtl=yes"
}
},
"description": "This template is intended for quotes. Usually this is not appropriate for encyclopedia articles. The Manual of Style guidelines for block quotations recommend formatting block quotations using the {{Quote}} template or the HTML <blockquote> element.",
"paramOrder": [
"quote",
"author",
"source",
"width",
"float",
"bgcolor",
"qcolor",
"wide",
"small",
"personquoted",
"publication",
"title",
"quotesource",
"2",
"3",
"4",
"5",
"rtl"
],
"format": "block"
}
</templatedata>
 
{{Quotation templates}}
<!-- ADD INTERWIKIS BELOW THIS LINE -->
[[category:Quotation templates|{{PAGENAME}}]]
[[es:Plantilla:Cita]]
[[eu:Txantiloi:Aipu]]
[[id:Template:cquote]]
[[fr:Modèle:Cquote]]
[[mk:Шаблон:Цитатник]]
[[pt:Predefinição:Quote2]]
[[ru:Шаблон:Цитатник]]
[[sv:Mall:Citat]]
[[fa:الگو:نقل قول]]
 
</includeonly>{{sandbox other||
[[Category:Enhanced quote templates]]
}}</includeonly>