User:Hersfold/Holiday header/doc

From Wikipedia, the free encyclopedia

This is a documentation subpage for User:Hersfold/Holiday header (see that page for the user itself).
It contains usage information, categories and other content that is not part of the original user 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.
Remember that you can conduct experiments, and should test all improvements, in either the general Template sandbox or your user space before changing anything here.

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)

Contents

[edit] What this does

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.

[edit] Usage

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      = 
}}

[edit] Holiday configuration

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.

[edit] Setting the dates

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  = [[Image:Herz1.gif]] Happy [[Valentine's Day]]!
}}

</nowiki>

will cause this message to appear every February 14th:

Image:Herz1.gif Happy Valentine's Day!

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.

[edit] Thanksgiving

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!

[edit] Additional relatively-dated holidays

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.

[edit] Style parameters

  • 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.

[edit] Other notes

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