Template:Infobox holiday/doc: Difference between revisions
m (add Category:Infobox templates using Wikidata (via JWB)) |
m (1 revision imported) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 27: | Line 27: | ||
|scheduling = <nowiki><!-- e.g. "same day each year" --></nowiki> | |scheduling = <nowiki><!-- e.g. "same day each year" --></nowiki> | ||
|duration = <nowiki><!-- e.g. "1 day", "1 week" --></nowiki> | |duration = <nowiki><!-- e.g. "1 day", "1 week" --></nowiki> | ||
|frequency = <nowiki><!-- e.g. " | |frequency = <nowiki><!-- e.g. "Annual", "Every 4 years", "Once" --></nowiki> | ||
<nowiki><!-- Use next three if holiday is the same day of the same week every year --></nowiki> | <nowiki><!-- Use next three if holiday is the same day of the same week every year --></nowiki> | ||
|week_ordinal = <nowiki><!-- "first", "second", "last", etc. --></nowiki> | |week_ordinal = <nowiki><!-- "first", "second", "last", etc. --></nowiki> | ||
Line 63: | Line 63: | ||
|scheduling = same day each year | |scheduling = same day each year | ||
|duration = 1 day | |duration = 1 day | ||
|frequency = | |frequency = Annual | ||
|celebrations = | |celebrations = | ||
|observances = | |observances = | ||
Line 123: | Line 123: | ||
;scheduling: define the how the date varies (not displayed). Sample value: "same day each year" | ;scheduling: define the how the date varies (not displayed). Sample value: "same day each year" | ||
;duration: time the holiday or observance last. Sample values: "1 day", "1 week", "3 days" | ;duration: time the holiday or observance last. Sample values: "1 day", "1 week", "3 days" | ||
;frequency: the frequency with which the holiday or observance re-occurs. Sample values: " | ;frequency: the frequency with which the holiday or observance re-occurs. Sample values: "Annual", "Weekly", "Monthly" | ||
;week_ordinal, weekday, month: For days that are observed on the same day of the same week every year, these specify the week (week_ordinal), day of the week (weekday), and month. | ;week_ordinal, weekday, month: For days that are observed on the same day of the same week every year, these specify the week (week_ordinal), day of the week (weekday), and month. If you use these, you no longer have to specify '''date{{#expr:{{CURRENTYEAR}}-1}}''', '''date{{CURRENTYEAR}}''', '''date{{#expr:{{CURRENTYEAR}}+1}}''' and '''date{{#expr:{{CURRENTYEAR}}+2}}'''. If you specify '''week_ordinal''', then '''weekday''' and '''month''' are required also. | ||
;date{{#expr:{{CURRENTYEAR}}-1}}, date{{#expr:{{CURRENTYEAR}}+1}}: recommended for holidays that don't stay on the same [[Gregorian calendar|Gregorian]] date - The template will display the previous and next year's dates along with that of the current year, if they are provided. | ;date{{#expr:{{CURRENTYEAR}}-1}}, date{{#expr:{{CURRENTYEAR}}+1}}, date{{#expr:{{CURRENTYEAR}}+2}}: recommended for holidays that don't stay on the same [[Gregorian calendar|Gregorian]] date - The template will display the previous and next year's dates along with that of the current year, if they are provided. Again, it's a good idea to provide dates for a few years further into the future as well. (Not necessary if '''week_ordinal'''/'''weekday'''/'''month''' are specified instead.) | ||
;mdy: if set to a non-blank value, auto-formatted dates will be displayed in "month day, year" format instead of the default "day month year" order. | ;mdy: if set to a non-blank value, auto-formatted dates will be displayed in "month day, year" format instead of the default "day month year" order. | ||
;firsttime: first time/year the holiday was observed (if available) | ;firsttime: first time/year the holiday was observed (if available) | ||
Line 198: | Line 198: | ||
|observedby = [[Chicago]], [[Illinois]] | |observedby = [[Chicago]], [[Illinois]] | ||
|date = Five days after every 13th moon | |date = Five days after every 13th moon | ||
| | |date2020 = June 27 | ||
|date2021 = July 12 | |||
| | |date2022 = September 1 | ||
| | |date2023 = June 8 | ||
| | |||
|observances = Night of the Moon Cheese | |observances = Night of the Moon Cheese | ||
}}</pre> | }}</pre> | ||
Line 211: | Line 210: | ||
|observedby = [[Chicago]], [[Illinois]] | |observedby = [[Chicago]], [[Illinois]] | ||
|date = Five days after every 13th moon | |date = Five days after every 13th moon | ||
| | |date2020 = June 27 | ||
|date2021 = July 12 | |||
| | |date2022 = September 1 | ||
| | |date2023 = June 8 | ||
| | |||
|observances = Night of the Moon Cheese | |observances = Night of the Moon Cheese | ||
}} | }} | ||
Line 244: | Line 241: | ||
</pre> | </pre> | ||
==TemplateData== | |||
{{templateData header}} | |||
<div style="width:auto; autoflow: scroll"> | |||
<templatedata> | |||
{ | |||
"params": { | |||
"type": { | |||
"example": "international", | |||
"default": "e.g. secular, national, international, cultural, historic, ethnic, patriotic, default, asian, judaism, shinto, islam, christian, commercial", | |||
"suggested": true, | |||
"description": "Type of holiday, sets banner color", | |||
"type": "string", | |||
"required": true | |||
}, | |||
"holiday_name": { | |||
"suggested": true, | |||
"description": "Usually the same as the page name", | |||
"example": "World AIDS Day", | |||
"required": true | |||
}, | |||
"image": { | |||
"description": "Do not include File: and do not wikilink", | |||
"example": "Easter.svg", | |||
"suggested": true | |||
}, | |||
"image_size": {}, | |||
"imagesize": {}, | |||
"alt": { | |||
"description": "Image description for visually impaired readers", | |||
"example": "orange awareness ribbon", | |||
"suggested": true | |||
}, | |||
"caption": { | |||
"description": "Image caption", | |||
"type": "string" | |||
}, | |||
"official_name": { | |||
"suggested": true | |||
}, | |||
"nickname": { | |||
"suggested": true, | |||
"description": "Nickname for the date, or translations", | |||
"example": "SAAM" | |||
}, | |||
"observedby": { | |||
"description": "Countries or people who celebrate or observe the date ", | |||
"example": "[[Muslim]]s and [[Islam]], people worldwide", | |||
"type": "string", | |||
"suggested": true | |||
}, | |||
"litcolor": { | |||
"description": "Color used for the holiday", | |||
"example": "Blue", | |||
"type": "string", | |||
"suggested": true | |||
}, | |||
"longtype": { | |||
"description": "Lengthier alternative to type", | |||
"example": "Cultural, ethnic and Buddhist" | |||
}, | |||
"significance": { | |||
"description": "Lengthier description of holiday's significance", | |||
"type": "string", | |||
"suggested": true | |||
}, | |||
"celebrations": { | |||
"description": "What usually happens on that date. Observances can be used instead.", | |||
"type": "string", | |||
"suggested": true, | |||
"example": "gift-giving, Church services" | |||
}, | |||
"observances": { | |||
"description": "Can be used instead of celebrations to describe what happens on the date ", | |||
"type": "string" | |||
}, | |||
"begins": { | |||
"example": "1 October", | |||
"suggested": true, | |||
"description": "Required for multi-day holidays" | |||
}, | |||
"ends": { | |||
"example": "31 October", | |||
"suggested": true, | |||
"description": "Required for multi-day holidays" | |||
}, | |||
"date": { | |||
"description": "Date of event, do not use \"1st\", \"5th\" use 1, 5", | |||
"example": "1 October", | |||
"required": true, | |||
"suggested": true | |||
}, | |||
"week_ordinal": { | |||
"description": "For the first, second etc weeks in a month ", | |||
"example": "first" | |||
}, | |||
"weekday": { | |||
"description": "Day of week if always the same", | |||
"example": "Sunday", | |||
"suggested": true | |||
}, | |||
"month": { | |||
"description": "Use for long observances", | |||
"example": "October", | |||
"suggested": true | |||
}, | |||
"date2023": {}, | |||
"date2022": {}, | |||
"date2020": { | |||
"description": "Use when the date changes every year " | |||
}, | |||
"scheduling": { | |||
"example": "same day each year", | |||
"type": "string", | |||
"suggested": true, | |||
"description": "Not displayed" | |||
}, | |||
"mdy": { | |||
"description": "if set auto-formatted dates will be displayed in \"month day, year\"", | |||
"example": "yes", | |||
"type": "string" | |||
}, | |||
"duration": { | |||
"example": "1 day", | |||
"type": "string", | |||
"default": "e.g. 1 day, 1 week, 1 month ", | |||
"suggested": true | |||
}, | |||
"frequency": { | |||
"description": "How often it occurs", | |||
"example": "Annual", | |||
"default": "e.g. Annual, Every 4 years, Once", | |||
"suggested": true | |||
}, | |||
"firsttime": { | |||
"suggested": true, | |||
"description": "either first date or calculation of how long ago ", | |||
"example": "{{start date and age|df=yes|1988}}" | |||
}, | |||
"lasttime": { | |||
"description": "Useful for events no longer held or not held every year " | |||
}, | |||
"startedby": { | |||
"suggested": true, | |||
"description": "Person or organization" | |||
}, | |||
"relatedto": { | |||
"description": "Any other dates or wiki pages linked to it ", | |||
"example": "[[World Mental Health Day]]", | |||
"suggested": true | |||
}, | |||
"date2021": {} | |||
} | |||
} | |||
</templatedata> | |||
</div> | |||
=== Tracking categories=== | === Tracking categories=== | ||
Pages using the template with unsupported parameters are tracked in {{clc|Pages using infobox holiday with unknown parameters}}. | Pages using the template with unsupported parameters are tracked in {{clc|Pages using infobox holiday with unknown parameters}}. | ||
Line 249: | Line 401: | ||
Other maintenance categories include: | Other maintenance categories include: | ||
* {{clc|Infobox holiday with missing field}} | * {{clc|Infobox holiday with missing field}} | ||
<includeonly>{{ | <includeonly>{{Sandbox other|| | ||
<!-- ADD CATEGORIES BELOW THIS LINE --> | <!-- ADD CATEGORIES BELOW THIS LINE --> | ||
[[Category:Events infobox templates|Holiday]] | [[Category:Events infobox templates|Holiday]] |
Latest revision as of 18:10, 22 April 2021
This is a documentation subpage for Template:Infobox holiday. It contains usage information, categories and other content that is not part of the original template page. |
This template employs intricate features of template syntax.
You are encouraged to familiarise yourself with its setup and parser functions before editing the template. If your edit causes unexpected problems, please undo it quickly, as this template may appear on a large number of pages. You can conduct experiments, and should test all major changes, in either this template's sandbox, the general template sandbox, or your user space before changing anything here. |
This template uses Lua: |
The {{Infobox holiday}}
template adds an infobox with data fields for defining a particular holiday.
Usage
{{Infobox holiday |holiday_name = required |type = required |image = |imagesize = |caption = |official_name = |nickname = |observedby = |litcolor = |longtype = |significance = |begins = |ends = |date = |scheduling = <!-- e.g. "same day each year" --> |duration = <!-- e.g. "1 day", "1 week" --> |frequency = <!-- e.g. "Annual", "Every 4 years", "Once" --> <!-- Use next three if holiday is the same day of the same week every year --> |week_ordinal = <!-- "first", "second", "last", etc. --> |weekday = <!-- "Sunday", "Monday", "Friday", etc. --> |month = <!-- "January", "February", "December", etc. --> <!-- Use next four if the date changes in an unusual pattern each year --> |date2023 = <!-- only for days that change each year --> |date2024 = <!-- only for days that change each year --> |date2025 = <!-- only for days that change each year --> |date2026 = <!-- only for days that change each year --> |celebrations = |observances = |relatedto = }}
For an annual holiday occurring on the same day each year:
{{Infobox holiday |holiday_name = Template Day |type = |image = |imagesize = |caption = |official_name = |nickname = |observedby = |litcolor = |longtype = |significance = |begins = |ends = |date = 30 February |scheduling = same day each year |duration = 1 day |frequency = Annual |celebrations = |observances = |relatedto = }}
Parameters
Required
- holiday_name
- This is the most common holiday name, which appears at the top of the infobox. It should almost always be the name of the article.
- type
- The type of the holiday, for example: national, Judaism, Islamic, etc. The type parameter has this relation:
Type (param "type") | Color |
---|---|
islam, islamic | LightGreen |
judaism, juda, jewish, jew | LightSkyBlue |
buddhism, buddhist, buddha | PaleGoldenRod |
christian, christ, christianity | Lavender |
asian, asian festival | RosyBrown |
secular | DarkGray |
national, international, local, group | LightViolet |
historical, cultural, patriotic, ethnic | LightSalmon |
pagan | DarkKhaki |
commercial | Yellow |
hindu, hinduism | Orange |
shinto, shintoism | Light red |
default | LightSteelBlue |
- begins
- required for multi-day holidays - This is the starting date for a multi-day holiday.
- ends
- required for multi-day holidays - This is the ending date for a multi-day holiday.
- date
- required for single-day holidays - This is the date of a single-day holiday. (If you use the week_ordinal/weekday/month parameters below, date will default to a phrase like "First Sunday in January". Otherwise it has no default and is required.). Specific phrases for other rules are decoded in Template:Infobox holiday/date. Sample: "first Thursday after 18 April". If no value is given, the value of d:Property:P837 of the holiday's Wikidata item is displayed instead.
- date2024
- highly recommended for holidays that don't stay on the same Gregorian date - This is the Gregorian date on which the holiday will occur in 2024. At the end of 2024, this will be replaced with date2025, which will later be replaced with date2026. Therefore, it's a good idea to specify the Gregorian date for a few future years. (Not necessary if week_ordinal/weekday/month are specified instead.)
Optional
- image
- This should be an image that represents the holiday. The value is just the simple target-name, not a full wikilink.
- imagesize
- The size of the image (default is 225px).
- caption
- This is a caption that describes the image.
- official_name
- This should contain the official name of the holiday if it is not the holiday_name; this can also be the name of the holiday in its original language
- nickname
- This should hold any nicknames, alternatives, and translations for the holiday_name or official_name
- observedby
- highly recommended - These are the people who celebrate/observe the holiday (e.g. Muslims and Islam, United States, people worldwide)
- litcolor
- This is the liturgical color of the day, if applicable to a religious holiday; or other color which is applicable to the holiday (e.g. green for Saint Patrick's Day)
- longtype
- This is a lengthier description of the type, for example if there are two types that could be defined, for example "Cultural, Historical, Islamic"
- significance
- This is a lengthier description of the holiday's significance
- scheduling
- define the how the date varies (not displayed). Sample value: "same day each year"
- duration
- time the holiday or observance last. Sample values: "1 day", "1 week", "3 days"
- frequency
- the frequency with which the holiday or observance re-occurs. Sample values: "Annual", "Weekly", "Monthly"
- week_ordinal, weekday, month
- For days that are observed on the same day of the same week every year, these specify the week (week_ordinal), day of the week (weekday), and month. If you use these, you no longer have to specify date2023, date2024, date2025 and date2026. If you specify week_ordinal, then weekday and month are required also.
- date2023, date2025, date2026
- recommended for holidays that don't stay on the same Gregorian date - The template will display the previous and next year's dates along with that of the current year, if they are provided. Again, it's a good idea to provide dates for a few years further into the future as well. (Not necessary if week_ordinal/weekday/month are specified instead.)
- mdy
- if set to a non-blank value, auto-formatted dates will be displayed in "month day, year" format instead of the default "day month year" order.
- firsttime
- first time/year the holiday was observed (if available)
- lasttime
- last time/year the holiday was observed (if no longer observed)
- celebrations
- This contains the celebrations that occur on the holiday.
- observances
- This contains essentially the same thing as the celebrations attribute. However, the word observances is used. This may be more appropriate than celebrations when referring to prayer or more solemn observances. Most likely, you will not need both celebrations and observances.
- relatedto
- This contains holidays that relate to the current holiday.
Examples
Same date every year
{{Infobox holiday |holiday_name = Nice Safe Day |type = national |official_name = The Nice Safe Holiday Day |nickname = The Nice & Safe Day |observedby = [[Atlantis]] |significance = The Nice Safe Day for everyone |date = January 31 |celebrations = The Nice Safe Day parade |relatedto = [[Unsafe Day]] }} |
|
Same day of same week every year
Different days and dates each year
{{Infobox holiday |holiday_name = Inscrutable Day |type = cultural |official_name = Day of the Phantom Inscrutable Cheese |observedby = [[Chicago]], [[Illinois]] |date = Five days after every 13th moon |date2020 = June 27 |date2021 = July 12 |date2022 = September 1 |date2023 = June 8 |observances = Night of the Moon Cheese }} |
|
Formulas for calculating occurrences
Sample formulas used in Template:Infobox holiday/date:
- For First Day of Summer: first Thursday after 18 April:
- {{Weekday after date|{{{year}}}|April|18|Thursday}}
- See also: Template:Weekday after date
- For Victoria Day (Scotland): last Monday before or on 24 May
- {{Weekday before date|{{{year}}}|May|25|Monday}}
- See also: Template:Weekday before date
- For Sexagesima: second Sunday before Ash Wednesday (56 calendar days before Easter Sunday)
- {{#invoke:Easter|Calculate|{{{year}}}|day=-56|format=F j}}
- See also: Module:Easter
For some holidays, this is still defined on the holiday page itself. For First Day of Summer, this would be:
|date = first Thursday after 18 April |date{{LASTYEAR}} = {{Weekday after date|{{LASTYEAR}}|April|18|Thursday}} |date{{CURRENTYEAR}} = {{Weekday after date|{{CURRENTYEAR}}|April|18|Thursday}} |date{{NEXTYEAR}} = {{Weekday after date|{{NEXTYEAR}}|April|18|Thursday}} |date{{#time:Y|+2 years}} = {{Weekday after date|{{#time:Y|+2 years}}|April|18|Thursday}}
TemplateData
TemplateData for Infobox holiday
No description.
Parameter | Description | Type | Status | |
---|---|---|---|---|
type | type | Type of holiday, sets banner color
| String | required |
holiday_name | holiday_name | Usually the same as the page name
| Unknown | required |
image | image | Do not include File: and do not wikilink
| Unknown | suggested |
image_size | image_size | no description | Unknown | optional |
imagesize | imagesize | no description | Unknown | optional |
alt | alt | Image description for visually impaired readers
| Unknown | suggested |
caption | caption | Image caption | String | optional |
official_name | official_name | no description | Unknown | suggested |
nickname | nickname | Nickname for the date, or translations
| Unknown | suggested |
observedby | observedby | Countries or people who celebrate or observe the date
| String | suggested |
litcolor | litcolor | Color used for the holiday
| String | suggested |
longtype | longtype | Lengthier alternative to type
| Unknown | optional |
significance | significance | Lengthier description of holiday's significance | String | suggested |
celebrations | celebrations | What usually happens on that date. Observances can be used instead.
| String | suggested |
observances | observances | Can be used instead of celebrations to describe what happens on the date | String | optional |
begins | begins | Required for multi-day holidays
| Unknown | suggested |
ends | ends | Required for multi-day holidays
| Unknown | suggested |
date | date | Date of event, do not use "1st", "5th" use 1, 5
| Unknown | required |
week_ordinal | week_ordinal | For the first, second etc weeks in a month
| Unknown | optional |
weekday | weekday | Day of week if always the same
| Unknown | suggested |
month | month | Use for long observances
| Unknown | suggested |
date2023 | date2023 | no description | Unknown | optional |
date2022 | date2022 | no description | Unknown | optional |
date2020 | date2020 | Use when the date changes every year | Unknown | optional |
scheduling | scheduling | Not displayed
| String | suggested |
mdy | mdy | if set auto-formatted dates will be displayed in "month day, year"
| String | optional |
duration | duration | no description
| String | suggested |
frequency | frequency | How often it occurs
| Unknown | suggested |
firsttime | firsttime | either first date or calculation of how long ago
| Unknown | suggested |
lasttime | lasttime | Useful for events no longer held or not held every year | Unknown | optional |
startedby | startedby | Person or organization | Unknown | suggested |
relatedto | relatedto | Any other dates or wiki pages linked to it
| Unknown | suggested |
date2021 | date2021 | no description | Unknown | optional |
Tracking categories
Pages using the template with unsupported parameters are tracked in Category:Pages using infobox holiday with unknown parameters (2).
Other maintenance categories include: