User:Hersfold/Holiday header/doc

From Wikipedia, the free encyclopedia

This template is not visible until it is properly used with parameters as described below. See testcases for more information on how this looks. (Coming soon)

What this does[edit]

This template allows you to set an automatic holiday greeting for up to 10 custom holidays and Thanksgiving. It uses MediaWiki time variables to instantly add the header for the holidays you set.

Usage[edit]

Please read all parameter usage carefully. Failure to set all parameters correctly could result in a non-functional template or some ugly side effects.

{{User:Hersfold/Holiday Header
|date1     = 
|msg1      = 
|date2     = 
|msg2      = 
.
.
.
|date10    = 
|msg10     = 
|thxgiv    = 
|thxgivmsg = 
|border    = 
|bgcolor   = 
|font      = 
}}

Holiday configuration[edit]

Due to the limitations of the software and template code, only those holidays with fixed dates can be used (with the exception of Thanksgiving - for the special coding used for that, see "Thanksgiving" below. If you wish to add a holiday that is not fixed to a certain date in the Gregorian calendar, such as Easter or Hanukkah, you will have to manually update the dates each year ahead of time to ensure the header appears on time.

Setting the dates[edit]

Each date must be set in MMDD format, with leading zeros. For example:

The associated message will appear on the date you set. The code:

<nowiki>{{User:Hersfold/Holiday Header
|date1 = 0214
|msg1  = [[File:Herz1.gif]] Happy [[Valentine's Day]]!
}}

</nowiki>

will cause this message to appear every February 14th:

You may set up to 10 custom dates and messages with this format. Dates need not be in chronological order, however this will make reading them easier.

Thanksgiving[edit]

Due to the relative nature of the date of Thanksgiving, and the variance of that date between the United States and Canada, this holiday has a special coding that allows users to select if they wish to use the United States version, the Canadian version, or none at all.

  • thxgiv = USA - Causes thxgivmsg to be displayed on the fourth Thursday in November. (Also accepts US or U, not case sensitive)
  • thxgiv = CAN - Causes thxgivmsg to be displayed on the second Monday in October. (Also accepts CANADA, CA, or C, not case sensitive)
  • Any other value will disable the thanksgiving code.

You may set a custom message for Thanksgiving by using the thxgivmsg parameter. The default message is below:

Happy Thanksgiving!

Additional relatively-dated holidays[edit]

The template currently does not support additional relatively-dated holidays. It is unlikely that any other such holidays will be incorporated into the template, as many are based upon celestial events (such as Easter) or are based on other calendar systems (virtually any religious holiday except for those in Christianity). If you do not believe a holiday fits within either of those unavoidable limitations, contact Hersfold to work on adding the holiday to the template. If you are really sure you know what you're doing, you are of course welcome to try it yourself, but be aware that this code is very complex already and you are responsible for repairing any damage.

Style parameters[edit]

  • border = - Causes a border to appear around the message. Format this as though you were writing a <div> tag; for example, border = 1px solid black. The default is no border.
  • bgcolor = - Enter a hex value (including #) or color name to set a background color. Default is none.
  • font = - Enter the name of a font face to change, or set to none to remove text formatting. Default is Comic Sans MS.
  • noformat = - Any value will disable all formatting tags. Useful for using this template to change table colors or other formatting.

Other notes[edit]

default = allows you to set a message that will appear on all non-holiday days.