FANDOM


Template documentation (for the above template, sometimes hidden or invisible)[view] [edit] [history] [refresh]

Description

This template is used to create a quotation box.  It is ideal for the top of an article or, like an image thumbnail, to break up a wall of text within an article.  Quoteboxes with incorrect parameters will be added to Category:Quoteboxes with incorrect parameters.

This template is under construction, with multiple sandboxed drafts and notes.  The newest notes are at Template:Quotebox/sandbox3.

Copy/Paste Code

{{quotebox
  |quote=
  |source=
  |page=
  |random=
  |alltags=
  |anytags=
  |notags=
  |align=
  |width=
  |hidequotes=
  |format-area=
  |format-box=
  |format-qmarks=
  |format-quote=
  |format-source=
  |edit=
  |nsfw=
}}

Syntax

This template accepts the following parameters:

Parameter Accepted Values
default
  • The default behavior of the {{quotebox}} is to select a random quotation–source pair from [[{{PAGENAME}}/quotes]] that is tagged with "top" but not "nsfw".
  • Cannot be used with {{{1}}}, {{{2}}}, {{{quote}}}, or {{{source}}}.
  • The "top" tag will not be active by default if {{{alltags}}}, {{{anytags}}}, or {{{notags}}} are defined.
{{{1}}}
(1st unnamed parameter)
  • The quotation.  Accepts wikitext.
  • Must be used with {{{2}}} or {{{source}}}, but not both.
  • Cannot be used with {{{quote}}} or {{{page}}}.
{{{2}}}
(2nd unnamed parameter)
  • The source (such as the speaking character).  Accepts wikitext.
  • Must be used with {{{1}}} or {{{quote}}}, but not both.
  • Cannot be used with {{{source}}} or {{{page}}}.
quote=
  • The quotation.  Accepts wikitext.
  • Must be used with {{{source}}} or {{{1}}}, but not both.
  • Cannot be used with {{{2}}}, {{{source}}}, or {{{page}}}.
source=
  • The source (such as the speaking character).  Accepts wikitext.
  • Must be used with {{{quote}}} or {{{1}}}, but not both.
  • Cannot be used with {{{2}}}, {{{quote}}}, or {{{page}}}.
page=
  • Selects a specific page's "/quotes" subpage from which the quotation and source should be extracted.
  • Accepts any pagename where the subpage "/quotes" exists on this wiki.  Do not include brackets or "/quotes"; e.g., "Grog Strongjaw" will automatically select a quotation and source pair from Grog Strongjaw/quotes.
  • Cannot be used with {{{1}}}, {{{2}}}, {{{quote}}}, or {{{source}}}.
random=
  • Any value indicates true, forcing random quotations when queried from a /quotes page.
  • Purpose:  When {{quotebox}} is used multiple times on the same page without parameters, the random quotation will be the same on all parameterless instances.  This is a limitation of the wiki software (MediaWiki).  To overcome the limitation, set the fake parameter {{{random}}} to any value.
  • Example:  {{quotebox|random=true}}
  • Not needed if any other parameters are defined.
alltags=
  • When querying a list of quotations (e.g., when calling for a random quotation from a "/quotes" subpage), use only the subset of quotations tagged with all of the specified tags (separated by commas).
  • Example:  To create a quotebox featuring a random pre-stream quotation (in the "Background" section of an article, for example):
{{quotebox|alltags=prestream}}
  • Example:  To select from the quotations between Scanlan and Vex'ahlia that are related to Trinket and are funny:
{{quotebox
  |page=Relationship between Scanlan and Vex'ahlia
  |alltags=trinket,funny
}}
  • Has no effect when used with {{{1}}}, {{{2}}}, {{{quote}}}, or {{{source}}}.
anytags=
  • When querying a list of quotations (e.g., when calling for a random quotation from a "/quotes" subpage), use only the subset of quotations tagged with any of the specified tags (separated by commas).
  • Example:  To create the quotebox at the top of an article:
{{quotebox|anytags=top}}
  • Example:  To select from the quotations between Scanlan and Vex'ahlia that are related to Trinket or are funny:
{{quotebox
  |page=Relationship between Scanlan and Vex'ahlia
  |anytags=trinket,funny
}}
  • Has no effect when used with {{{1}}}, {{{2}}}, {{{quote}}}, or {{{source}}}.
notags=
  • When querying a list of quotations (e.g., when calling for a random quotation from a "/quotes" subpage), use only the subset of quotations not tagged with the specified tags (separated by commas).
  • Example:  To create a quotebox that won't repeat the same quotation as the quotebox at the top of an article:
{{quotebox|notags=top}}
  • Example:  To select from the quotations between Scanlan and Vex'ahlia that are not related to Trinket nor are funny:
{{quotebox
  |page=Relationship between Scanlan and Vex'ahlia
  |notags=trinket,funny
}}
  • Example:  To select from the quotations between Scanlan and Vex'ahlia that are safe for work:
{{quotebox
  |page=Relationship between Scanlan and Vex'ahlia
  |notags=nsfw
}}
  • Has no effect when used with {{{1}}}, {{{2}}}, {{{quote}}}, or {{{source}}}.
align=
  • When left empty (default), or with a value of center, c, middle, mid, m, auto, or a, the box will flex through the available center space (but share the margin with preceding floating objects, like character infoboxes and image thumbnails).
  • left or l will align the box to the left.
  • right or r will align the box to the right.
  • Cannot include a space before the equals sign.
width=
  • Any valid CSS width format will be accepted.
  • "250px", "75%", and "50em" are all acceptable.
  • No semicolon; no quotations marks.
  • Cannot include a space before the equals sign.
hidequotes=
  • Any value indicates true, removing the quotation marks and their margins.
    • If the [edit] button is also hidden, then the margin for the source expands to fill the [edit] button's area.
  • Cannot include a space before the equals sign.
format-area=
  • Any valid CSS style parameters will be accepted.  Overrides defaults.
  • Formats the outermost div, useful for padding.
  • Semicolon required; no quotations marks.
  • Cannot include a space before the equals sign.
format-box=
  • Any valid CSS style parameters will be accepted.  Overrides defaults.
  • Formats the div for the quotebox itself, useful for borders and colors.
  • Semicolon required; no quotations marks.
  • Cannot include a space before the equals sign.
format-qmarks=
  • Any valid CSS style parameters will be accepted.  Overrides defaults.
  • Formats the quotation marks in the left and right margins of the quote section, not the quote text.  Useful for formatting the color or size of the quotation marks.
  • Semicolon required; no quotations marks.
  • Cannot include a space before the equals sign.
format-quote=
  • Any valid CSS style parameters will be accepted.  Overrides defaults.
  • Formats the quote section only, not including the fancy quotation marks.  Useful for formatting the text appearance or the divider (border-bottom) between the quote and source sections.
  • Semicolon required; no quotations marks.
  • Cannot include a space before the equals sign.
format-source=
  • Any valid CSS style parameters will be accepted.  Overrides defaults.
  • Formats the quote section only, not including the indentation or [edit] button.  Useful for formatting the text appearance.
  • Semicolon required; no quotations marks.
  • Cannot include a space before the equals sign.
edit=
  • Any existing page name for this wiki will be accepted.  Overrides default.
  • Causes the [edit] button to link to the specified page.  To use a specific subpage, include its full page name path; e.g., "Grog Strongjaw/quotes" to link to the /quotes subpage, not just "Grog Strongjaw".
  • A value of hide, hidden, no, n, or false will hide the [edit] button.
    • If the fancy quotation marks and the [edit] button are hidden, then the margin for the source expands to fill the [edit] button's area.
  • Cannot include a space before the equals sign.
nsfw=
  • Any value indicates true, automatically hiding the quote portion of the quotebox until the user clicks the "[NSFW]" toggle button.
  • When the {{quotebox}} imports a quotation–source pair from a "/quotes" subpage, it will detect whether it has been tagged with "---nsfw" and activate if necessary.

Common Purposes

Random Quote from Subpage /quotes

Requires the subpage /quotes to exist and contain the code from Template:New quotes subpage.

{{quotebox}}

Random Quote from a Specific Page's /quotes Subpage

Requires the page name provided to exist and contain the code from Template:New quotes subpage.

{{quotebox|page=Grog Strongjaw}}

Specific Quote with Standard Quotebox Formatting

No prerequisites.  Can be used anywhere on the wiki.

{{quotebox|This is a quote.|This is the source.}}
{{quotebox|quote=This is a quote.|source=This is the source.}}

Specific Quote with Custom Quotebox Formatting

No prerequisites.  Can be used anywhere on the wiki.

{{quotebox
  |quote=
  |source=
  |align=
  |width=
  |hidequotes=
  |format-area=
  |format-box=
  |format-qmarks=
  |format-quote=
  |format-source=
  |edit=
  |nsfw=
}}

Examples

{{quotebox|How do you want to do this?|[[Matthew Mercer]]}}
{{quotebox|I would like to rage.|[[Travis Willingham]]}}
{{quotebox
  |{{quote multi
     |Laura
       |"I feel so guilty."
     |Marisha
       |"No, he was a fucking cock!"
   }}
  |from {{ep time|ep=The Echo Tree|2:17:10}}
  |nsfw=true
}}
...produces...
How do you want to do this?
– 
I would like to rage.
Laura:  "I feel so guilty."
Marisha:  "No, he was a fucking cock!"
– 
from "The Echo Tree" (1x63) at 2:17:10

Alignment

{{quotebox|How do you want to do this?|[[Matthew Mercer]]|align=left}}
{{quotebox|I would like to rage.|[[Travis Willingham]]|align=right}}
...produces...
How do you want to do this?
– 
I would like to rage.

Complex Formatting

{{quotebox
  |quote=How do you want to do this?
  |source=[[Matthew Mercer]]
  |align=left
  |width=
  |hidequotes=true
  |format-area=
  |format-box=border-radius:0;
  |format-qmarks=
  |format-quote=
  |format-source=
  |edit=hide
}}
{{quotebox
  |quote=I would like to rage.
  |source=[[Travis Willingham|<span style="color:black;text-decoration:underline;">Travis Willingham</span>]]
  |align=right
  |width=
  |hidequotes=
  |format-area=
  |format-box=background-color:rgba(255, 36, 37, 0.55);border-color:black;color:black;
  |format-qmarks=color:red;
  |format-quote=border-bottom:1px solid black;
  |format-source=
  |edit=Craven Edge
}}
How do you want to do this?
– 
[!h]
I would like to rage.

Text will fill in the gaps between adjacent left-aligned and right-aligned boxes, just like it does when image thumbnails are used in an article.  To prevent that behavior, type {{{clr}}}, {{{clr|left}}}, or {{{clr|right}}} after the {{quotebox}} code.

Programming Rationale for /quotes Subpages

Due to a known bug (bugzilla:2257), parameters cannot be used inside Extension:RandomSelection.  That means the following template construction format will not work:

{{#vardefine:i|1}}
<choose>
  {{#while:
    | {{{ {{#var:i}} |}}}
    | <option>{{{ {{#var:i}} }}}  –{{{ {{#expr:{{#var:i}}+1}} }}}</option>{{#vardefine:i|{{#expr:{{#var:i}}+2}}}}
  }}
</choose>

Also, the output from <choose> cannot be parsed properly by #explode, #replace, #switch, #array, or #var when it contains certain tags, like the ref tag used in {{ep ref}}.

For these reasons, /quotes subpages select a random quotation/source pair by using a {{random number}} in conjunction with an array of quotations:

  • {{quotebox}} will decide whether or not to transclude /quotes as input.
  • {{New quotes subpage}} contains the basic format for creating an array of quotations, one of which is randomly selected for transcluding.
  • {{Quotes subpage instructions}} contains instructions for editing the /quotes subpage, but it also contains the code for viewing the quotations on that subpage.


It may be feasible to create an individual page for each quotation, using {{FULLPAGENAME}} as its unique identifier, then calling that identifier anywhere on the wiki when a random or specific quotation is desired.  For example, a custom set of random quotations could be created by creating an array of the quotations' unique identifiers, then selecting a {{random number}} based on the array size (which would have the effect of selecting a quotation from the list), then printing it as output.  That printed output could then be used in {{quotebox}} or any other template.  The printed output would probably look like:

+++uniqueid=Original Page Name---Quote.---Source---formatparams=formatvalues

Continued Development

  • In Revision 20926, I commented out the padding for center-aligned quoteboxes.  This will allow, for example, a "figure + div.crquotebox" to show side-by-side at the same vertical starting line.  Left-aligned and right-aligned crquoteboxes still have padding.  –VeganCritter (talk) 20:48, October 16, 2016 (UTC)


The above text is transcluded from Template:Quotebox/doc; you can change it or view its history. (How does this work?)
If you're done making changes, please refresh the text. (Why?)
You can experiment in this template's sandbox (edit | diff) and testcases (create) pages.
Please add categories and interwikis to Template:Quotebox/doc. (View all subpages of this page.)
Community content is available under CC-BY-SA unless otherwise noted.