Help:Calendar

From: Everything Food & Drink.org
Jump to: navigation, search

Installation

The calendar extension is installed on all Everything Food & Drink project wiki's. To have it rendered in a usable and customizable you need to add a .css script to your custom .css file

Parameters

There are a number of parameters which allow calendars for different specific purposes.

title: The name of the article which each day in a calendar table links to is by default the date, eg 27 Jan 2008. If you want to have different calendars for different purposes, then the title parameter will precede the names with a separating slash character, for example, setting title to "Harry" will cause the dates to format as Harry/27 Jan 2008.

year: This changes the year of the calendar table, the default if no year is specified is the current year.

month: If a month is supplied, then only a single month will be rendered instead of a table containing all twelve months.

query: This allows extra query-string information to be appended to the links for days which don't exist. The main use for this would be to allow some preloaded content in the newly created calendar articles. See examples below - the syntax looks a little strange because it has two equals characters in it.

format: The default date format for date-articles linked to from the days in the calendar tables is, eg. 2 February 1972, but can be adjusted by supplying a PHP date format in the format parameter. See PHP-Manual/strftime for details about how to specify a date format.

dayformat: This sets the format of the titles of each day of the week at the top of the month tables. The default setting is M T W T F S S, but can be set to %a for abbreviated names in the current language such as Mon Tue..., or %A for full names in the current language.

Examples

Error creating thumbnail:
Example calendar for the month of January 2007

Note: the examples above use the CURRENTUSER variable which is not installed by default. See Extension:MyVariables if you're interested in adding variables.

{{#calendar: title={{CURRENTUSER}} }}
{{#calendar: title=User:{{CURRENTUSER}} }}
{{#calendar: title={{CURRENTUSER}} | year=2001 }}
{{#calendar: year=2007 | month=jan | title={{CURRENTUSER}} }}


This example renders the May table for the current year

{{#calendar: month=05 }}


This example uses the new query parameter to pre-load the NewDay template article into newly created dates. It looks a little confusing, but what it's saying is: add "preload=template" to the link

{{#calendar: query=preload=Template:NewDay }}

Customization

The generated calendar table uses CSS to allow customization of the look. Add the CSS rules to your "common.css". Here's the CSS basic configuration, which you can use and adjust. This will override the site's configuration while logged in:

table.calendar          { margin: 0; padding: 10px; }
table.calendar td       { margin: 0; padding: 2px; vertical-align: top; }
table.month .heading td { padding:2px; background-color:#d4d4d4; color:#aaa; text-align:center; font-size:120%; font-weight:bold; }
table.month .dow td     { color:#aaa; text-align:center; font-size:110%; }
table.month td.today    { background-color:#ddd; }
table.month td {
    border: 1px solid #000000;
    margin: 0;
    padding: 1pt 1.5pt;
    font-weight: bold;
    font-size: 8pt;
    text-align: right;
    background-color: #eee;
    }
#bodyContent table.month a { background:none; padding:0 }
.day-active { color:#0000cc }
.day-empty  { color:#cc0000 }



Language: English