Help:Calendar tag

From QED

Jump to: navigation, search
Help
Related topics
This page is about the calendar tag. For help about including Google calendars on QED pages, see Help:Google Calendar. For help about creating calendars on QED in general, see Help:Calendar.

The main purpose of the QED calendar tag is to present a calendar for a single month with hyperlinks from each day and from the icons representing the previous, current and next months. For example, the calendar for the current month displayed at the right was generated by the following:

<calendar />

<< November 2009 >>
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30

Optionally, the calendar can be used to control the contents of an HTML "iframe" displayed along with the calendar.

Notice that if you are currently logged in, then any hyperlinks in the calendar to the right that are displayed in red are actually links that will allow you to create a page. This feature, in conjunction with the parameter named "default" described below, makes it quite easy to create a useful calendar.

Please note that the specification of the calendar tag available on QED is subject to change and that it differs from tags of the same name available elsewhere. One of the main differences is that QED calendars can be linked to an IFRAME displayed with the calendar.

Contents

Syntax

 <calendar />
 or:
 <calendar OPTIONS> </calendar>

where OPTIONS is a sequence of name=value pairs:

year=YYYY                             # omit year, month, day for current date
month=mM                    
day=dD                                # omit for no highlighting of any day
prefix=PREFIX                         # page is [PREFIX/]YYYY/mM/dD
suffix=SUFFIX                         # optional - append suffix to page name
external=true                         # treat all the page links as external
iframe=IFRAME                         # use the specified IFRAME
float=right|left|...                  # HTML float: value (default: right)
default=false|DEFAULT                 # what to do when the target page does not exist (see below)

Notes

All the parameters are optional.

If the page corresponding to a day or month on the displayed calendar is a QED page that does not yet exist, then whether or not a hyperlink is created for that day or month depends on the setting of the "default" parameter, and whether or not the viewer would be able to create the page. If the target page does not exist, and if the "default" parameter is not set, then a link will only be created if the viewer has editing privileges sufficient to create the target page.

default

If the parameter named default is set, then its value determines what happens if the target page does not exist:

  • if default=false is specified, then no hyperlink is created
  • otherwise, the value of the parameter is used to create the hyperlink

iframe

If iframe is specified as IFRAME, then the specified HTML iframe (if defined elsewhere on the page) will be displayed and its contents will vary depending on which item on the calendar is selected.

Examples

Using javascript

 <calendar default="javascript:alert('Events are only scheduled on weekdays')" />

produces:

<< November 2009 >>
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30


Using an HTML iframe

<< August 2007 >>
Su Mo Tu We Th Fr Sa
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

Here is the source for the above:

<calendar year=2007 month=8 
 iframe=CalendarFrame prefix=Test:calendar: /><html>
<iframe id="CalendarFrame" width="80%"  height=400
src="http://www.princeton.edu"
>
Your user agent does not support frames or is currently configured not to display frames.
</iframe>
</html>
Personal tools