Difference between revisions of "Template:Floruit/sandbox"

From blackwiki
Jump to navigation Jump to search
(Ren param. Ed. examples.)
imported>Nøkkenbuer
m (spacing)
 
(93 intermediate revisions by 12 users not shown)
Line 1: Line 1:
<!--Begin {{floruit/sandbox}}--><includeonly>{{#if:{{{1|{{{date|}}}}}}|{{#ifeq:{{{b|}}}|yes|(}}}}{{#ifeq:{{{pre1|}}}|italics|<em>}}{{#switch:{{{pre2|{{{lk|}}}}}}|no|off=fl.|abbr={{abbr|fl.|floruit/sandbox}}|#default=[[Floruit|fl.]]}}{{#ifeq:{{{pre1|}}}|italics|</em>}}{{#ifeq:{{{ca|}}}|yes|&#8239;c.}}{{#if:{{{1|{{{date|}}}}}}|&#8239;{{#ifeq:{{{sortable|}}}|yes|{{dts|{{{1|{{{date}}}}}}}}|{{{1|{{{date}}}}}}}}}}{{#if:{{{1|{{{date|}}}}}}|{{#ifeq:{{{b|}}}|yes|)}}}}</includeonly><!--End {{floruit/sandbox}}--><noinclude>
+
{{#if:{{{sortable|}}}
{{floruit/sandbox|2010s}}
+
|<span style="display:none;">{{{1|}}}</span>
 
+
}}{{#if:{{{i|}}}
==Scope and structure==
+
|<nowiki/>''
The template {{bxtn|floruit/sandbox}} (or [[#Redirects|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 {{slink||Exceptions}} for possible usage exceptions.
+
}}{{#switch:{{{lk|}}}
 
+
|no|off       = fl.
==Usage==
+
|yes|on        = [[Floruit|fl.]]
{{csdoc|usage full}}
+
|abbr
:<code><nowiki>{{floruit/sandbox|date= </nowiki>{{bxt|or}} {{var|[date-value]}}<nowiki>|ca= |sortable= |pre1= |pre2= |b= }}</nowiki></code>
+
|#default      = {{Abbr|fl.|floruit}}
{{end}}
+
}}{{#if:{{{i|}}}
Copy a blank version to use. All parameter names must be in lowercase. Use the "|" (pipe) character between each parameter. Leading and trailing spaces (&#160;) are trimmed from parameter values; therefore, parameters will not display if they are only populated by spaces. Delete unused parameters. See {{slink||Parameters}} for important details.
+
|''<nowiki/>
 
+
}}{{#if:{{{1|}}}
===Exceptions===
+
|<span style="white-space:nowrap;">&thinsp;{{{1}}}</span>
[[Floruit|By definition]], the relevant date(s) may be inexact or approximate; normally, this template should not be used when {{em|exact dates}} should be indicated. For example, this template should not be used for a person's birth or death dates, or for an organization's founding or dissolution dates; however, it may be used in similar cases, when there is no reliable or exact dating information.
+
}}{{#if:{{{2|}}}
 
+
|&nbsp;{{Abbr|c.|circa}}<span style="white-space:nowrap;">&thinsp;{{{2}}}</span>
==Examples==
+
}}<noinclude>
Some of the following examples may utilize additional, embedded templates, in order to enhance presentation or clarity. Such practice is optional.
+
{{Documentation}}
*{{strong|Decade, prefix wikilinked}}
+
</noinclude>
:<code><nowiki>{{floruit/sandbox|date=2010s}}</nowiki></code>
 
:or
 
:<code><nowiki>{{floruit/sandbox|2010s}}</nowiki></code>
 
:{{en dash}}{{nbsp}}{{em|Date entered without label}} {{para|date}} ({{em|[[#unnamed|Note1]]}})
 
:Either generates: {{floruit/sandbox|2010s}}
 
*{{strong|As above, in parentheses}}
 
:<code><nowiki>{{floruit/sandbox|date=2010s|b=yes}}</nowiki></code>
 
:or
 
:<code><nowiki>{{floruit/sandbox|2010s|b=yes}}</nowiki></code>
 
:Either generates: {{floruit/sandbox|2010s|b=yes}}
 
*{{strong|Prefix only, in plain text}}
 
:<code><nowiki>{{floruit/sandbox|pre2=no}} 2010s</nowiki></code>
 
:Generates: {{floruit/sandbox|pre2=no}} 2010s
 
:{{en dash}}{{nbsp}}{{em|Please see [[#space|Note2]]}}
 
*{{strong|Parentheses don't display without a}} {{bxt|date}} {{strong|value}}
 
:<code><nowiki>{{floruit/sandbox|b=yes}} 2010s</nowiki></code>
 
:Generates: {{floruit/sandbox|b=yes}} 2010s
 
*{{strong|Year range, prefix with tooltip}}
 
:<code><nowiki>{{floruit/sandbox|date={{dash year|2010|2016}}|pre2=abbr}}</nowiki></code>
 
:Generates: {{floruit/sandbox|date={{dash year|2010|2016}}|pre2=abbr}}
 
:{{en dash}}{{nbsp}}{{em|Uses}} {{tl|dash year}} {{em|to format year range, but please see [[#sort|Note3]]}}
 
*{{strong|Circa century, prefix wikilinked}}
 
:<code><nowiki>{{floruit/sandbox|date=21st century CE|ca=yes}}</nowiki></code>
 
:Generates: {{floruit/sandbox|date=21st century CE|ca=yes}}
 
*{{strong|Single year sortable, prefix italicized with tooltip}}  
 
:<code><nowiki>{{floruit/sandbox|date=2016|sortable=yes|pre1=italics|pre2=abbr}}</nowiki></code>
 
:Generates: {{floruit/sandbox|date=2016|sortable=yes|pre1=italics|pre2=abbr}}
 
*{{strong|As above, in parentheses}}
 
:<code><nowiki>{{floruit/sandbox|date=2016|sortable=yes|pre1=italics|pre2=abbr|b=yes}}</nowiki></code>
 
:Generates: {{floruit/sandbox|date=2016|sortable=yes|pre1=italics|pre2=abbr|b=yes}}
 
 
 
==Parameters==
 
All parameters are optional; certain display options require parameter values.
 
 
 
===Date formatting parameters===
 
*{{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. Do not wikilink. Not checked for date-formatting errors. 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, this parameter may require a value, see below.
 
:{{em|id=unnamed|Note1}}: You may treat parameter {{bxt|date}} as unnamed, and insert only the parameter's desired value; in such cases, this value should be the {{em|first entry}} in the template.
 
:{{em|id=space|Note2:}} The value of {{bxt|date}} is preceded by a [[narrow no-break space]] (&#8239;); if the parameter is not utilized, the template’s display may vary according to the user’s choice of [[whitespace character]](s) or other formatting.
 
:*{{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; requires a date value.
 
::{{em|id=sort|Note3:}} To sort correctly, {{para|sortable}} wraps template {{tl|dts}} around the date value(s); it works best with single date values. When using this parameter, {{em|do not}} insert other templates as values to {{bxt|date}}; results may be unpredictable.
 
*{{bxtn|ca}}{{spaced en dash}}set {{para|ca|yes}} for [[circa]] dates; adds a [[narrow no-break space]] (&#8239;), followed by the additional prefix "c.", before the date value.
 
 
 
===Prefix formatting parameters===
 
*{{bxtn|pre1}}{{spaced en dash}}use this parameter to {{em|italicize}} the display of the prefix "fl.", by setting {{para|pre1|italics}}.
 
*{{bxtn|pre2}}{{spaced en dash}}alias {{bxtn|lk}}. By default, the prefix is wikilinked to ''[[floruit]]''; use this parameter to change this default by inserting one of the following values:
 
**set {{para|pre2|abbr}} to instead display a [[tooltip]] when the cursor hovers over "fl.", expanding it to "floruit". Tooltip display may depend on browser and/or operating system version.
 
**set {{para|pre2|no}} or {{para|pre2|off}} to display "fl." in plain text; use to avoid [[WP:Overlinking|overlinking]] when this template is used repeatedly in the body of an article; see {{slink|Wikipedia:Manual of Style/Abbreviations|Miscellaneous shortenings}}.
 
 
 
===Other parameters===
 
*{{bxtn|b}}{{spaced en dash}}use {{bxt|b}} ({{bxt|b}}rackets) to display the template's output inside parentheses "()", by setting {{para|b|yes}}; requires a {{bxt|date}} value.
 
 
 
==Redirects==
 
<!--This section is linked from within this document ([[MOS:HEAD]])-->
 
{{tl|floruit/sandbox}} can be replaced with the redirects:
 
*{{tl|fl.}}
 
*{{tl|flor}}
 
*{{tl|flor.}}
 
*{{tl|flr}}
 
 
 
==See also==
 
*[[Tempore]]
 
*{{tl|circa}}
 
*{{tl|reign}}
 

Latest revision as of 13:06, 26 July 2018

fl.

Template documentation[view] [edit] [history] [purge]

Usage

Source: {{fl.}} 1234, {{fl.|1234}} or {{fl.|1234|lk=off}}

Result: fl. 1234, fl. 1234 or fl. 1234

This template generates an abbreviation for floruit ("fl."); by default, it has a mouse-over tooltip explaining its meaning.

Parameters

This template supports an optional (first, unnamed) parameter representing a year. For example, {{fl.|1956}} renders to give fl. 1956. This differs from {{fl.}} 1956 in that {{fl.|1956}} puts a non-breaking space in between the "fl." and the number, which prevents the web browsers from inserting a line break there.

If the parameter "sortable=yes" is specified, the template generates invisible text that will cause the output to work in sortable tables, at the cost of causing problems for visually-impaired readers. Compare "Col 1" and "Col 2" in the following table:

Title Col 1 Col 2
Foo 1066 1066
Bar fl. 1510 1510fl. 1510
Baz 1956 1956
Jaz fl. 410 410fl. 410

"Col 1" uses {{Floruit}} 1510, and does not sort correctly. "Col 2" uses {{Floruit|1510|sortable=yes}}, and does sort correctly. This works because {{Floruit|1510|sortable=yes}} inserts an invisible span element at the start of the cell: <span style="display:none;">1510</span>. Although it is not rendered, it is still seen by the sorting code and makes sorting work.

The downside of this approach is that the invisible text is still rendered by screen readers that are used by visually impaired readers, and by text browsers such as Lynx, so the table will become garbled for readers who are using assistive technology or text browsers.

If the |lk= (as in "link") parameter is set to |lk=off, then the abbreviation will be rendered as fl. (without a wikilink). Otherwise, the link is displayed. (This can be used to avoid overlinking when this template is used repeatedly in the body of an article.)

Potential future parameters could add articles to appropriate categories, e.g. Category:Year of birth missing.

See also