        
 |
This tutorial describes how to alter the view of your calendar using
URL parameters. Your calendar may need to look and behave differently
based on the viewer. The URL used by people that maintain the calendar
may need to be different than the URL used by the general public.
Using URL parameters, you can have links from your
Web site to different calendar views -- a year calendar, 10 day calendar, etc.
All calendar URLs begin with:
http://www.huntcal.com/cgi/calview.cgi/
followed by the group ID and the calendar ID.
This tutorial will use the
Mother Nature's Calendar,
which is one of our sample calendars.
The group ID of the Mother Nature's Calendar is mother. The
calendar ID is nature. This calendar is set up to view events as a list rather than
a wall calendar grid. The standard calendar URL for the Mother Nature's Calendar is:
http://www.huntcal.com/cgi/calview.cgi/mother/nature.
Note that the group ID and calendar ID are separated by a
forward slash: /
For the tutorial examples below, you may want to replace the group ID and
calendar ID with your own to see how the URL alterations affect your calendar.
The URL parameters follow the calendar ID and begin with a question mark (?).
Each parameter has a name and a value. Parameters are separated from one
another by an ampersand (&).
-
The first example is the most common and useful parameter setting:
http://www.huntcal.com/cgi/calview.cgi/mother/nature?vm=r
The parameter name is vm, and the value is r. This
tells the calendar system that the view mode is
read-only. Use this parameter setting to hide all editing buttons,
such as "Add Event" and "Calendar Admin". We'll show several other additional
settings for vm later on.
- Several calendar attributes can be changed from the Calendar Administrator's
page, but they can also be set dynamically using URL parameters:
- You can use more than one parameter to combine settings. For example:
cs=t&bg=w&pe=h tells the calendar system to use the tan color
scheme, a white background, and hide past events:
http://www.huntcal.com/cgi/calview.cgi/mother/nature?cs=t&bg=w&pe=h
Notice that parameters are separated by an ampersand (&).
- There are 5 event viewing modes: day, week, month,
advanced, and printer
friendly. The default viewing mode is month view.
- The "list view" calendar display is divided into two sections, a left side
and a right side.
The left side includes:
- the calendar table,
the eye icon that appears to the left of each week's row,
- month navigation controls (next/previous),
- and a viewing options selector.
|
The right side includes:
- the list of events,
- and a legend that identifies the edit, delete and reminder icons.
|
The values for vm can be combined. For example:
This tells the calendar system to remove the editing controls, month navigation,
viewing options and week view icons:
http://www.huntcal.com/cgi/calview.cgi/mother/nature?vm=r-l-m-v-w
- The width of the table surrounding the calendar and events can
be set using the tw parameter. This is useful if you have
a custom header, and the width of your
header is less than the default 702 pixels.
Example:
http://www.huntcal.com/cgi/aview/holidays/holidays?vm=rs-L&m=1&tw=414
Of course, you can also widen the calendar display:
http://www.huntcal.com/cgi/calview.cgi/conf/rooms?tw=800
Advanced viewing offers several useful features including keyword search,
event listing by date range or category.
A different CGI program handles advanced viewing commands, which requires
a different URL.
For advanced viewing commands, replace calview.cgi with
aview in the URL. Most of the parameters listed above also
apply to advanced view. However, only the m,
d, and yr parameters are supported by calview.cgi.
Advanced viewing allows the viewer to enter a beginning and ending date,
a list of keywords, and select one or more categories. This input can
be specified using URL parameters to provide useful views of
the calendar events.
- The vm=s parameter tells the calendar system to accept
the input from the URL parameters and show the results.
This parameter is required for all aview URL parameter settings.
Without this setting, the parameters will set the input fields
on the left side of the display, but will not produce a list of events.
- The beginning date is specified using the m, d, and
yr attributes. The default month is the current month. The default
year is the current year. The default day is the current day.
| Name | Possible values |
| m | 1 - 12 |
| d | 1 - 31 |
| yr | 1998 - 2012 |
The m, d, and yr attributes can also accept values
using now, which represents the current month, day and year.
Dates can also be specified using + and -.
For example:
m=now+1 represents next month and
m=now-1 represents last month.
- The ending date is specified using the m2, d2, and
yr2 attributes. The default ending month is the current month.
The default ending year is the current year. The default ending day is the
last day of the month.
m2, d2, and yr2 accept the same values as
m, d, and
yr.
Examples:
A read-only view of the next two months:
A read-only view of events for last 10 days:
A read-only view of all events for this year, and no left side (events only):
- The default advanced view output style is "list". This displays events in a vertical list.
Use the avStyle parameter to change this to "grid" view. To do so, use this setting: "avStyle=g".
For example:
http://www.huntcal.com/cgi/aview/mother/nature?vm=rs-L&avStyle=g
- Keywords can be specified using the keywords attribute. The
words should be separated by a plus sign +. For example:
Show all events this year that include the words heavy and snow.
?m1=1&m2=12&keywords=heavy+snow&vm=rs
(Note: The first part of the URL above isn't shown to
ensure that the line doesn't wrap.)
- The allWords attribute is used to specify that all of the search
words must appear in the event description. Values for allWords
can be yes or no. The default value is yes.
- By default all search words must appear in the order they are entered.
Use phrase=no to change this and specify that the order of the words
in not important.
For example:
Show all events this year that contain either "hurricane" or "snow":
(Note: The first part of the URL above isn't shown to
ensure that the line doesn't wrap.)
- If you have a created categories, events can be listed
by category using the cat parameter. Use the category
IDs to specify which categories to include. Category IDs appear to the
left of the category names on the Category Management page, which is accessible
from the Calendar Admin page.
Go here to view the
Mother Nature Category Management page (Login: sample
Password: sample).
The category IDs are typically numbers beginning with 1.
Examples:
For the Mother Nature calendar, we can list only "Weather" events
for the year using this URL:
http://www.huntcal.com/cgi/aview?m=1&m2=12&cat=1&vm=rs
(Note: the category ID for the "Weather" category
is 1.)
Show events that belong to either the "Human Disaster" or Spectacle" categories:
http://www.huntcal.com/cgi/aview?m=1&m2=12&cat=2,3&vm=rs
(Note: a comma is used to separate the category
IDs.)
- The advanced view interface offers the ability to show the event title and the event description.
By default, the event title is displayed if it exists. The event title is a link, which displays
a small popup window that includes the event description. You can display both the title and the
description using the "showDescr" parameter. For example:
http://www.huntcal.com/cgi/aview/mother/nature?vm=rs-L&showDescr=1
If you need a calendar view not supported by
the parameters specified above, let us know.
|
|
|