Difference between revisions of "Template:Color by age/doc"

From blackwiki
Jump to navigation Jump to search
imported>Jason Quinn
(fixing color scheme)
imported>Jason Quinn
(→‎Usage: changing example)
Line 13: Line 13:
 
</dl>
 
</dl>
  
== Usage ==
+
== Example usage ==
 
 
===Example 1===
 
{{tlx|Color by age|November 21, 2015|This is some example text.}}
 
 
 
which will render as
 
 
 
{{Color by age|November 21, 2015|This is some example text.}}
 
 
 
because the specified date is old enough to render red.
 
  
 
===Example 2===
 
===Example 2===
{{tlx|Color by age|July 4, 2018|This is some example text.|note{{=}}This is an optional note for the tooltip.}}
+
{{tlx|Color by age|July 4, 2012|This is some example text.|note{{=}}This is an optional note for the tooltip.}}
  
 
which will render as
 
which will render as
  
{{Color by age|July 4, 2018|This is some example text.|note=This is an optional note for the tooltip.}}
+
{{Color by age|July 4, 2012|This is some example text.|note=This is an optional note for the tooltip.}}
  
because the specified date is old enough to render orange.
+
because the specified date is old enough to render red. It also uses the optional note that is appended to the tooltip.
  
 
<includeonly>{{sandbox other||
 
<includeonly>{{sandbox other||

Revision as of 10:55, 22 November 2020

This template is intended to visually indicate as age associated with some text via the background color, with older text being "hotter", and very recent ages green. This can be useful, for example, to show what entries in a list haven't had editor attention for a while.

The template currently has five tiers:

red
older than 1460 days (4 years)
orange
older than 1095 days (3 years) but less than 4 years
yellow
older than 730 days (2 year) but less than 3 years
lightyellow
older than 365 days (1 year) but less than 2 years
default background
younger than 1 year

Example usage

Example 2

{{Color by age|July 4, 2012|This is some example text.|note=This is an optional note for the tooltip.}}

which will render as

This is some example text.

because the specified date is old enough to render red. It also uses the optional note that is appended to the tooltip.