Template:Quote box
{{{quote}}} |
This template has a sandbox (edit) for editors to experiment.
Usage
The quote box template allows you to easily put a quote (and its source) inside a box. The box is floating like an image and the article's text that follows will wrap around it. This is useful in articles where you are short on images and want to add some sort of graphic, or you just want to set off an important or interesting quote away from the main text.
{{Quote box | quote = | source = | width = | align = }}
Parameters
- quote
- Text to be quoted, without quotation marks around it. (Required)
- source
- Source of the quoted text.
- width
- Width of the box, preferably a relative percentage of the screen such as"33%", possibly an absolute width such as "200px". (Default: self-adjusts to the width of the text)
- align
- Position of the floating box, can be "right" or "left". "center" is possible but disables floating. (Default: "right")
Examples
Various codes and their results.
- Minimal code, defaults to floating right and minimal width:
{{Quote box | quote = Cry "Havoc," and let slip the dogs of war. | source = [[William Shakespeare]], ''[[Julius Caesar (play)|Julius Caesar]]'', Act III, Scene I. }} {{Lorem ipsum}}
Cry "Havoc," and let slip the dogs of war. —William Shakespeare, Julius Caesar, Act III, Scene I. |
Lorem ipsum dolor sit amet, consectetur adipisicing 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.
- Floating right:
{{Quote box | quote = Cry "Havoc," and let slip the dogs of war. | source = [[William Shakespeare]], ''[[Julius Caesar (play)|Julius Caesar]]'', Act III, Scene I. | width = 50% | align = right }} {{Lorem ipsum}}
Cry "Havoc," and let slip the dogs of war. —William Shakespeare, Julius Caesar, Act III, Scene I. |
Lorem ipsum dolor sit amet, consectetur adipisicing 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.
- Floating left:
{{Quote box | quote = Cry "Havoc," and let slip the dogs of war. | source = [[William Shakespeare]], ''[[Julius Caesar (play)|Julius Caesar]]'', Act III, Scene I. | width = 50% | align = left }} {{Lorem ipsum}}
Cry "Havoc," and let slip the dogs of war. —William Shakespeare, Julius Caesar, Act III, Scene I. |
Lorem ipsum dolor sit amet, consectetur adipisicing 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.
- Centered but not floating any more:
{{Quote box | quote = Cry "Havoc," and let slip the dogs of war. | source = [[William Shakespeare]], ''[[Julius Caesar (play)|Julius Caesar]]'', Act III, Scene I. | width = 50% | align = center }} {{Lorem ipsum}}
Cry "Havoc," and let slip the dogs of war. —William Shakespeare, Julius Caesar, Act III, Scene I. |
Lorem ipsum dolor sit amet, consectetur adipisicing 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.
Tests
Each test shows the template call code followed by the current template's result and then the Template:Quote box/sandbox's result.
1. No parameters at all:
{{Quote box}} gives:
{{{quote}}} |
sandbox gives:
{{{quote}}} |
2. source parameter only:
{{Quote box|source=source value only}} gives:
{{{quote}}} —source value only |
sandbox gives:
{{{quote}}} —source value only |
3. all parameters with range of characters:
{{Quote box
| quote = quote value 0123456789 !"£$%&/()=?^ é*ç°§;:_ ,.- òàù è+ {} @# ' many characters
| source = source value 0123456789 !"£$%&/()=?^ é*ç°§;:_ ,.- òàù è+ {} @# ' many characters
| width = 50%
| align = left
}}
quote value 0123456789 !"£$%&/()=?^ é*ç°§;:_ ,.- òàù è+ {} @# ' many characters —source value 0123456789 !"£$%&/()=?^ é*ç°§;:_ ,.- òàù è+ {} @# ' many characters |
sandbox gives:
quote value 0123456789 !"£$%&/()=?^ é*ç°§;:_ ,.- òàù è+ {} @# ' many characters —source value 0123456789 !"£$%&/()=?^ é*ç°§;:_ ,.- òàù è+ {} @# ' many characters |
5. all parameters with trailing pipe:
{{Quote box
| quote = quote value 0123456789 simple
| source = source value 0123456789 simple
| width = 50%
| align = left
|}}
—source value 0123456789 simple |
sandbox gives:
quote value 0123456789 simple —source value 0123456789 simple |
7. parameters align, quote, source and lastly a nondefined parameter:
{{Quote_box
|align=left
|quote=quote value second
|source=source value third and last
|nondefinedparameter=nondefined parameter's value
}}
quote value second —source value third and last |
sandbox gives:
quote value second —source value third and last |
10. all parameters, with text after trailing pipe:
{{Quote box
| source = source value 0123456789 simple
| quote = quote value 0123456789 simple
| width = 50%
| align = left
|text after trailing pipe}}
text after trailing pipe —source value 0123456789 simple |
sandbox gives:
quote value 0123456789 simple —source value 0123456789 simple |
11. all parameters, with two unamed parameter values:
{{Quote box
| source = source value 0123456789 simple
| quote = quote value 0123456789 simple
| width = 50%
| align = left
|first unnamed parameter value
|second unnamed parameter value}}
first unnamed parameter value
|
sandbox gives:
quote value 0123456789 simple —second unnamed parameter value |
12. all parameters, with two unnamed parameter values, first one null:
{{Quote box
| source = source value 0123456789 simple
| quote = quote value 0123456789 simple
| width = 50%
| align = left
||second unnamed parameter value}}
—second unnamed parameter value |
sandbox gives:
quote value 0123456789 simple —second unnamed parameter value |
13. Quote parameter with empty trailing unnamed parameter:
{{Quote box|quote=quote value|}} gives:
sandbox gives:
quote value |
14. Quote parameter with trailing non-empty unnamed parameter:
{{Quote box|quote=quote value|}} gives:
non-empty unnamed parameter value |
sandbox gives:
quote value |
Expected result above is "quote value" should be seen.
See also
- Similar templates
- Template:Epigraph – quote without border, page-wide, normal-sized attribution
- Template:Quote – quote without border, page-wide, smaller-sized attribution
- Template:Quotation – quote with border, page-wide
- Template:Quote box – quote with border, in a reduced floating box
- Template:Quote box2 – quote with border, in a reduced floating box, optional title, extra formatting options
- Template:Cquote – pull-quote between graphic quotation marks, page-wide
- Template:Rquote – pull-quote between graphic quotation marks, in a reduced floating area
- Category:Quotation templates – more templates
id:Templat:Quote box ja:Template:Quote box ro:Format:Cutie citat simple:Template:Quote box