Template:Quotebox/doc

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.

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

Syntax
This template accepts the following parameters:

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

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.

Specific Quote with Standard Quotebox Formatting
No prerequisites. Can be used anywhere on the wiki.

Specific Quote with Custom Quotebox Formatting
No prerequisites. Can be used anywhere on the wiki.

Examples

 * ...produces...

Alignment

 * ...produces...

Complex Formatting
 

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  ,   , or    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:  Also, the output from   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 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)