Difference between revisions of "Template:Floruit/sandbox"
(Rewrite with error checks etc.) |
|||
| Line 22: | Line 22: | ||
Copy a blank version to use. All parameter names must be in lowercase. Use the "{{!}}" (pipe) character between each parameter. Leading and trailing spaces ( ) are trimmed from parameter values; therefore, parameters will not display if they are only populated by spaces. Misspelled or undefined parameters are ignored. Delete unused parameters or options, and explanatory text. See {{slink||Parameters}} for important details. | Copy a blank version to use. All parameter names must be in lowercase. Use the "{{!}}" (pipe) character between each parameter. Leading and trailing spaces ( ) are trimmed from parameter values; therefore, parameters will not display if they are only populated by spaces. Misspelled or undefined parameters are ignored. Delete unused parameters or options, and explanatory text. See {{slink||Parameters}} for important details. | ||
| − | By default, displayable values are separated by a [[whitespace character]]s of varying lengths | + | By default, the date is prefixed with the abbreviation "fl.", wikilinked to its expanded form (''[[floruit]]''); displayable values are separated by a [[whitespace character]]s of varying lengths. [[Line wrap and word wrap]] is off. Template {{tl|dts}} ({{bxtn|d}}ate {{bxtn|t}}ime {{bxtn|s}}orting) has been embedded in code and becomes active when the {{em|floruit}} date is (optionally) set to be sortable. In most cases, usage errors will result in display of relevant error messages. |
===Applicability=== | ===Applicability=== | ||
| Line 38: | Line 38: | ||
Suggested: | Suggested: | ||
*{{bxtn|date}}{{spaced en dash}} the time period during which the subject is known to have been active or popular. Dated in year(s), decade(s), centuries or other time units, including ranges. May be any one of Wikipedia's [[MOS:DATEFORMAT|acceptable date formats]], but please follow the relevant format established in the article, if any. Depending on the template options used, {{em|this parameter may require a value}}. | *{{bxtn|date}}{{spaced en dash}} the time period during which the subject is known to have been active or popular. Dated in year(s), decade(s), centuries or other time units, including ranges. May be any one of Wikipedia's [[MOS:DATEFORMAT|acceptable date formats]], but please follow the relevant format established in the article, if any. Depending on the template options used, {{em|this parameter may require a value}}. | ||
| − | :{{em|id=unnamed| | + | :{{em|id=unnamed|Note:}} You may treat {{bxt|date}} as an unnamed parameter, and insert only its desired value. |
| − | :{{em|id=space| | + | :{{em|id=space|Note:}} If {{bxt|date}} is not utilized, the displayed output may vary according to the user’s choice of [[whitespace character]](s) following the prefix "fl.", or according to other user formatting. |
:{{en dash}}{{nbsp}}{{em|for examples see}} [[#dec|{{em|here}}]] {{em|(unnamed) and}} [[#plain|{{em|here}}]] {{em|(not used)}} | :{{en dash}}{{nbsp}}{{em|for examples see}} [[#dec|{{em|here}}]] {{em|(unnamed) and}} [[#plain|{{em|here}}]] {{em|(not used)}} | ||
Optional: | Optional: | ||
| Line 46: | Line 46: | ||
Conditional: | Conditional: | ||
*{{bxtn|sortable}}{{spaced en dash}} set {{para|sortable|yes}} to format the {{bxt|date}} value(s) so that they are displayed properly within [[WP:TABLESORT|sortable table]]s; {{em|requires a value for parameter}} {{bxt|date}}. | *{{bxtn|sortable}}{{spaced en dash}} set {{para|sortable|yes}} to format the {{bxt|date}} value(s) so that they are displayed properly within [[WP:TABLESORT|sortable table]]s; {{em|requires a value for parameter}} {{bxt|date}}. | ||
| − | :{{em|id= | + | :{{em|id=sorted|Note:}} To sort correctly, parameter {{bxt|sortable}} wraps template {{tl|dts}} around the date value(s); it works best with single-date values. {{em|Do not}} embed templates as values to {{bxt|date}} when {{bxt|sortable}} is used; results may be unpredictable. Note {{tlf|dts}} has other shortcomings. |
:{{en dash}}{{nbsp}}{{em|for an example see}} [[#sort|{{em|here}}]] | :{{en dash}}{{nbsp}}{{em|for an example see}} [[#sort|{{em|here}}]] | ||
| Line 76: | Line 76: | ||
==Examples== | ==Examples== | ||
Some of the following examples may utilize additional, embedded templates, in order to enhance presentation or clarity. Such practice is optional. | Some of the following examples may utilize additional, embedded templates, in order to enhance presentation or clarity. Such practice is optional. | ||
| − | *{{anchor|dec}}{{strong|Decade | + | *{{anchor|dec}}{{strong|Decade range}} |
:<code><nowiki>{{floruit/sandbox|date=2010s}}</nowiki></code> | :<code><nowiki>{{floruit/sandbox|date=2010s}}</nowiki></code> | ||
:or | :or | ||
:<code><nowiki>{{floruit/sandbox|2010s}}</nowiki></code> ([[#unnamed|{{em|note}}]]) | :<code><nowiki>{{floruit/sandbox|2010s}}</nowiki></code> ([[#unnamed|{{em|note}}]]) | ||
:Either generates: {{floruit/sandbox|2010s}} | :Either generates: {{floruit/sandbox|2010s}} | ||
| − | *{{anchor|brc}}{{strong| | + | *{{anchor|brc}}{{strong|Decade, in parentheses}} |
:<code><nowiki>{{floruit/sandbox|date=2010s|b=yes}}</nowiki></code> | :<code><nowiki>{{floruit/sandbox|date=2010s|b=yes}}</nowiki></code> | ||
:or | :or | ||
| Line 91: | Line 91: | ||
*{{anchor|ttip}}{{strong|Year range, prefix with tooltip}} | *{{anchor|ttip}}{{strong|Year range, prefix with tooltip}} | ||
:<code><nowiki>{{floruit/sandbox|date={{dash year|2010|2016}}|pfx2=abbr}}</nowiki></code> | :<code><nowiki>{{floruit/sandbox|date={{dash year|2010|2016}}|pfx2=abbr}}</nowiki></code> | ||
| − | :Generates: {{floruit/sandbox|date={{dash year|2010|2016}}|pfx2=abbr}} | + | :Generates: {{floruit/sandbox|date={{dash year|2010|2016}}|pfx2=abbr}} ([[#sorted|{{em|note}}]]) |
| − | :{{en dash}}{{nbsp}}{{em|uses}} {{tl|dash year}} {{em|to format year range | + | :{{en dash}}{{nbsp}}{{em|uses}} {{tl|dash year}} {{em|to format year range}} |
*{{anchor|circa}}{{strong|Circa century, prefix wikilinked, and suffix}} | *{{anchor|circa}}{{strong|Circa century, prefix wikilinked, and suffix}} | ||
:<code><nowiki>{{floruit/sandbox|date=21st century|ca=yes|sfx=ce}}</nowiki></code> | :<code><nowiki>{{floruit/sandbox|date=21st century|ca=yes|sfx=ce}}</nowiki></code> | ||
| Line 102: | Line 102: | ||
:<code><nowiki>{{floruit/sandbox|date=2016|sortable=yes|pfx1=italics|pfx2=abbr|wrap=yes}}</nowiki></code> | :<code><nowiki>{{floruit/sandbox|date=2016|sortable=yes|pfx1=italics|pfx2=abbr|wrap=yes}}</nowiki></code> | ||
:Generates: {{floruit/sandbox|date=2016|sortable=yes|pfx1=italics|pfx2=abbr|wrap=yes}} | :Generates: {{floruit/sandbox|date=2016|sortable=yes|pfx1=italics|pfx2=abbr|wrap=yes}} | ||
| − | |||
| − | |||
| − | |||
==Error messages== | ==Error messages== | ||
| Line 164: | Line 161: | ||
"description": "Set to \"yes\" to turn word wrap on", | "description": "Set to \"yes\" to turn word wrap on", | ||
"type": "boolean", | "type": "boolean", | ||
| − | "default": "no" | + | "default": "no wrap" |
}, | }, | ||
"pfx1": { | "pfx1": { | ||
"label": "Prefix style", | "label": "Prefix style", | ||
| − | "description": "Set to \"italics\" to render the prefix | + | "description": "Set to \"italics\" to render the prefix fl. in italics", |
"type": "string" | "type": "string" | ||
}, | }, | ||
| Line 184: | Line 181: | ||
"description": "Adds an era suffix; options are: \"ad\", \"bc\", \"bce\", or \"ce\"; displays in uppercase; requires a 'date' value", | "description": "Adds an era suffix; options are: \"ad\", \"bc\", \"bce\", or \"ce\"; displays in uppercase; requires a 'date' value", | ||
"type": "string" | "type": "string" | ||
| + | }, | ||
| + | "sfx-lk": { | ||
| + | "label": "Suffix link", | ||
| + | "description": "Set to \"yes\" to wikilink the era suffix; requires a suffix", | ||
| + | "type": "boolean", | ||
| + | "default": "no link" | ||
} | } | ||
}, | }, | ||
| Line 189: | Line 192: | ||
"paramOrder": [ | "paramOrder": [ | ||
"date", | "date", | ||
| + | "b", | ||
"ca", | "ca", | ||
| − | |||
"pfx1", | "pfx1", | ||
"pfx2", | "pfx2", | ||
"sfx", | "sfx", | ||
| − | " | + | "sfx-lk", |
| + | "sortable", | ||
"wrap" | "wrap" | ||
], | ], | ||
Revision as of 00:00, 21 September 2016
fl. 2010s
[error in template {{floruit}}: wrong value for the bracket option] fl. 2010s
[error in template {{floruit}}: wrong value for the prefix-link option] 2010
(fl. 2010s AD)
fl. [error in template {{floruit}}: suffix option requires a date value]
[error in template {{floruit}}: bracket option requires a date value] fl.
[error in template {{floruit}}: bracket option requires a date value] fl.
fl. c. [error in template {{floruit}}: suffix option requires a date value]
fl. [error in template {{floruit}}: wrong value for the sortable option] AD
[error in template {{floruit}}: wrong value for the wrap option] fl.
| File:Sandbox.svg | This is the template sandbox page for Template:Floruit (diff). |
The template floruit (or any of its aliases) may be used to format the display of time periods or eras during which people, ideas, theories, or political, cultural or religious movements etc., may have been active or popular. It utilizes "fl.", an abbreviation of floruit or "flourished" (in Latin), as a prefix to the relevant date(s). The prefix abbreviation is wikilinked to floruit by default, but users may employ different or additional display options. Please also see Script error: No such module "Section link". for possible usage exceptions.
Contents
Usage
Structure
For presentation purposes only, in the box below [brackets] indicate parameter values; variables are italicized; explanatory text is in (parentheses).
|
Copy a blank version to use. All parameter names must be in lowercase. Use the "|" (pipe) character between each parameter. Leading and trailing spaces ( ) are trimmed from parameter values; therefore, parameters will not display if they are only populated by spaces. Misspelled or undefined parameters are ignored. Delete unused parameters or options, and explanatory text. See Script error: No such module "Section link". for important details.
By default, the date is prefixed with the abbreviation "fl.", wikilinked to its expanded form (floruit); displayable values are separated by a whitespace characters of varying lengths. Line wrap and word wrap is off. Template {{dts}} (date time sorting) has been embedded in code and becomes active when the floruit date is (optionally) set to be sortable. In most cases, usage errors will result in display of relevant error messages.
Applicability
This template may be used when exact or complete date information Template:Ordered list By definition, the relevant date(s) may be month, year, decade, or century ranges, or may otherwise be inexact or approximate. See WP:APPROXDATE for additional guidance.
Exceptions
Normally, this template should not be used when exact, complete dates need to be indicated, such as a person's birth and death dates, or an organization's founding and dissolution dates. However, it may be used in similar cases if exact or reliable date information is unavailable, or if providing such detail is unnecessary.
Parameters
All parameters are optional; use of parameter date is suggested, as some options depend on it. Incorrect values will be flagged under almost all usage scenarios (see Script error: No such module "Section link".). Parameter names are in bold; explanatory or expanded text may follow, in parentheses.
Date formatting parameters
Suggested:
- dateTemplate:Spaced en dash the time period during which the subject is known to have been active or popular. Dated in year(s), decade(s), centuries or other time units, including ranges. May be any one of Wikipedia's acceptable date formats, but please follow the relevant format established in the article, if any. Depending on the template options used, this parameter may require a value.
- Note: You may treat date as an unnamed parameter, and insert only its desired value.
- Note: If date is not utilized, the displayed output may vary according to the user’s choice of whitespace character(s) following the prefix "fl.", or according to other user formatting.
- – for examples see here (unnamed) and here (not used)
Optional:
- ca (circa)Template:Spaced en dashset
|ca=yesfor circa dates; the additional prefix "c.", preceded by a thin space, is inserted before the date ( c.).
- – for an example see here
Conditional:
- sortableTemplate:Spaced en dash set
|sortable=yesto format the date value(s) so that they are displayed properly within sortable tables; requires a value for parameter date.
- Note: To sort correctly, parameter sortable wraps template {{dts}} around the date value(s); it works best with single-date values. Do not embed templates as values to date when sortable is used; results may be unpredictable. Note {{dts}} has other shortcomings.
- – for an example see here
Prefix formatting parameters
Optional:
- pfx1 (prefix style)Template:Spaced en dash use this parameter to italicize the display of the prefix "fl.", by setting
|pfx1=italics.
- – for an example see here
- pfx2 (prefix link)Template:Spaced en dash alias lk. By default, the prefix is wikilinked to floruit; use this parameter to change the default by inserting one of the following values:
- set
|pfx2=abbrto display a tooltip when the pointer hovers over "fl.", expanding it to "floruit"; tooltip display may depend on browser and/or operating system version. - set
|pfx2=noor|pfx2=offto display "fl." in plain text; use to avoid overlinking when this template is used repeatedly in the body of an article (Script error: No such module "Section link".).
- set
Other parameters
Conditional (require a value for parameter date):
- b (brackets)Template:Spaced en dash use b to display the template's output in parentheses, by setting
|b=yes.
- – for an example see here
- sfx (suffix): use this parameter to append an era suffix (preceded by a no-break space) to the year of birth. Displays in plain text, but you may use the dependent parameter sfx-lk (see below) to display with an appropriate wikilink. The available options conform to the default calendar era.
- set
|sfx=adto display the suffix AD (Anno Domini) - set
|sfx=bcto display the suffix BC (Before Christ) - set
|sfx=bceto display the suffix BCE (Before Common Era) - set
|sfx=ceto display the suffix CE (Common Era)
- set
- – for an example see here
- sfx-lk (suffix link): use to wikilink the suffix to the appropriate page, by setting
|sfx-lk=yes;[lower-alpha 1] parameter sfx is required.
- – for an example see here
Optional:
- wrap (word wrap)Template:Spaced en dash by default, template output displays without word wrapping; to turn word wrap on, set
|wrap=yes.
- – for an example see here
Examples
Some of the following examples may utilize additional, embedded templates, in order to enhance presentation or clarity. Such practice is optional.
- Decade range
- Decade, in parentheses
{{floruit/sandbox|date=2010s|b=yes}}- or
{{floruit/sandbox|2010s|b=yes}}- Either generates: (fl. 2010s)
- Prefix only, in plain text
{{floruit/sandbox|pfx2=no}} 2010s(note)- Generates: fl. 2010s
- Year range, prefix with tooltip
{{floruit/sandbox|date={{dash year|2010|2016}}|pfx2=abbr}}- Generates: fl. 2010–16 (note)
- – uses {{dash year}} to format year range
- Circa century, prefix wikilinked, and suffix
{{floruit/sandbox|date=21st century|ca=yes|sfx=ce}}- Generates: fl. c. 21st century CE
- Circa century, suffix wikilinked, in parentheses
{{floruit/sandbox|date=21st century|b=yes|ca=yes|pfx2=no|sfx=ce|sfx-lk=yes}}- Generates: (fl. c. 21st century CE)
- Sortable, single year, prefix italicized with tooltip, word wrap is on
{{floruit/sandbox|date=2016|sortable=yes|pfx1=italics|pfx2=abbr|wrap=yes}}- Generates: fl. 2016
Error messages
Multiple errors are flagged per parameter; errors involving the same parameter may be mutually exclusive.
Messages may replace or precede the relevant parameter value(s), and appear under the following conditions:[lower-alpha 2]
Parameters wrap, b, pfx1, pfx2, ca, and sortable
- Incorrect value: [error in template
{{floruit}}: wrong value for the parameter-name option]
Parameters b, sortable, and sfx
- Date required: [error in template
{{floruit}}: parameter-name option requires a date value]
Parameter sfx
- Incorrect or unsupported entry: [error in template
{{floruit}}: wrong or unsupported suffix]
Parameter sfx-lk
- Suffix not defined: [error in template
{{floruit}}: suffix link requires suffix]
Redirects
{{floruit}} has the following redirects:
- {{fl.}}
- {{flor}}
- {{flor.}}
- {{flourished}}
- {{flr}}
TemplateData
TemplateData for floruit
Formats the display of periods of activity or popularity for people, ideas, or movements
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Date | date 1 | Time-period or era, may be a single date or a range | String | suggested |
| Brackets | b | Set to "yes" to display output in parentheses; requires a 'date' value
| Boolean | optional |
| Circa | ca | Set to "yes" for circa date(s)
| Boolean | optional |
| Prefix style | pfx1 | Set to "italics" to render the prefix fl. in italics | String | optional |
| Prefix link | pfx2 lk | Use to change the default display of the prefix 'fl.': "abbr" replaces wikilink to 'floruit' with a tooltip; "no" or "off" renders 'fl.' in plain text
| String | optional |
| Suffix | sfx | Adds an era suffix; options are: "ad", "bc", "bce", or "ce"; displays in uppercase; requires a 'date' value | String | optional |
| Suffix link | sfx-lk | Set to "yes" to wikilink the era suffix; requires a suffix
| Boolean | optional |
| Sortable | sortable | Set to "yes" to sort the date correctly within tables; requires a 'date' value
| Boolean | optional |
| Word wrap | wrap | Set to "yes" to turn word wrap on
| Boolean | optional |
See also
Footnotes
- ↑ Any other value is ignored silently.
- ↑ When error messages appear in live usage, the included template link to {{floruit}} is active.
| The above documentation is transcluded from Template:Floruit/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (create) pages. Subpages of this template. |