Permanently protected template

Template:Highlighted date list

From Historical Hastings
Template documentation[view] [edit] [history] [purge]

This module creates a list of items sorted by date. The item for today, or for the closest date in the future, is highlighted.

Syntax[edit]

{{highlighted date list
| item1 = 
| date1 = 
| item2 = 
| date2 = 
...
| class = 
| style = 
| highlighter = 
| highlightercolor = 
| graceperiod = 
}}

Parameters[edit]

All parameters are optional.

  • item1, item2, item3... - The list items. Note: the list items will be sorted by their dates, not their parameter numbers.
  • date1, date2, date3... - The dates for each list item. date1 corresponds to item1, date2 corresponds to item2, etc.
  • class - a class attribute for the list's ul element.
  • style - inline CSS for the list's ul element.
  • highlighter - a custom highlighter. The default is <span style="background-color:#FC6;font-size:120%">→</span> (→).
  • highlightercolor - if |highlighter= is not specified, this specifies the background color of the highlighter. The default is "#FC6".
  • graceperiod - the period of time that the template should wait after a date has passed before highlighting the next date in the list. This should be a value accepted as a relative date by the #time parser function, for example "1 day" or "2 months".

Examples[edit]

Default[edit]

{{highlighted date list
| item1 = Egg
| date1 = 21 September 2026
| item2 = Beans
| date1 = 28 September 2026
| item3 = Spam
| date3 = 5 October 2026
| item4 = Sausage
| date4 = 12 October 2026
}}
  • Egg
  • Beans
  • → Spam
  • Sausage

Two-day grace period[edit]

{{highlighted date list
| item1 = Egg
| date1 = 21 September 2026
| item2 = Beans
| date1 = 28 September 2026
| item3 = Spam
| date3 = 5 October 2026
| item4 = Sausage
| date4 = 12 October 2026
| graceperiod = 2 days
}}
  • Egg
  • → Beans
  • Spam
  • Sausage

Custom highlighter color[edit]

{{highlighted date list
| item1 = Egg
| date1 = 21 September 2026
| item2 = Beans
| date2 = 28 September 2026
| item3 = Spam
| date3 = 5 October 2026
| item4 = Sausage
| date4 = 12 October 2026
| highlightercolor = pink
}}
  • Egg
  • Beans
  • → Spam
  • Sausage

Custom highlighter[edit]

{{highlighted date list
| item1 = Egg
| date1 = 21 September 2026
| item2 = Beans
| date2 = 28 September 2026
| item3 = Spam
| date3 = 5 October 2026
| item4 = Sausage
| date4 = 12 October 2026
| highlighter = THIS ONE! >>>
}}
  • Egg
  • Beans
  • THIS ONE! >>> Spam
  • Sausage