URL Parameter Tutorial
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/cal/view/
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/cal/view/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 a semicolon (;).
All calendar URLs begin with:
http://www.huntcal.com/cal/view/
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/cal/view/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 a semicolon (;).
-
The first example is the most common and useful parameter setting:
http://www.huntcal.com/cal/view/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:
- bg=w sets the window background color to white:
http://www.huntcal.com/cal/view/mother/nature?bg=w
bg=b sets the window background color to black:
http://www.huntcal.com/cal/view/mother/nature?bg=b - s=g sets the calendar style to grid:
http://www.huntcal.com/cal/view/mother/nature?s=g
s=l sets the calendar style to list:
http://www.huntcal.com/cal/view/mother/nature?s=l - cs=b sets the color scheme to blue:
http://www.huntcal.com/cal/view/mother/nature?cs=b
Other colors are:
tan: http://www.huntcal.com/cal/view/mother/nature?cs=t
red: http://www.huntcal.com/cal/view/mother/nature?cs=r
green: http://www.huntcal.com/cal/view/mother/nature?cs=g
purple: http://www.huntcal.com/cal/view/mother/nature?cs=p
clear: http://www.huntcal.com/cal/view/mother/nature?cs=c (or light gray) - There are four different versions of the controls used to navigate
to the next or previous month.
nav=1 is used to specify the first navigation control:
http://www.huntcal.com/cal/view/mother/nature?nav=1
The other choices are:
nav=2 http://www.huntcal.com/cal/view/mother/nature?nav=2
nav=3 http://www.huntcal.com/cal/view/mother/nature?nav=3
nav=4 http://www.huntcal.com/cal/view/mother/nature?nav=4
- You can elect to show or hide past events:
pe=h hides past events:
http://www.huntcal.com/cal/view/mother/nature?pe=h
pe=s shows past events:
http://www.huntcal.com/cal/view/mother/nature?pe=s
- fldow=1 shows the previous month days of the first week and next month days of the last week of the current month (e.g. 29 30 31 ... 1 2 3)
http://www.huntcal.com/cal/view/mother/nature?fldow=1
fldow=0 shows only the days of the current month.
- bg=w sets the window background color to white:
- 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/cal/view/mother/nature?cs=t;bg=w;pe=h
Notice that parameters are separated by a semicolon (;). - There are 5 event viewing modes: day, week, month,
advanced, and printer
friendly. The default viewing mode is month view.
- You can switch to day view using v=d:
http://www.huntcal.com/cal/view/mother/nature?v=d
- v=w is for week view:
http://www.huntcal.com/cal/view/mother/nature?v=w
- v=m is for month view:
http://www.huntcal.com/cal/view/mother/nature?v=m
- Printer friendly is a radically different view that removes most
graphics, and produces a simple list of events that uses very little ink.
pf=1 produces a printer friendly view:
http://www.huntcal.com/cal/view/mother/nature?pf=1
- You can switch to day view using v=d:
- 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 left side can be completely hidden using vm=-L:
http://www.huntcal.com/cal/view/mother/nature?vm=-L
- vm=-R removes the right side:
http://www.huntcal.com/cal/view/mother/nature?vm=-R
- vm=-c removes the calendar:
http://www.huntcal.com/cal/view/mother/nature?vm=-c
- vm=-w removes the week view "eye" icons:
http://www.huntcal.com/cal/view/mother/nature?vm=-w
- vm=-m removes the month navigation controls:
http://www.huntcal.com/cal/view/mother/nature?vm=-m
- vm=-v removes the viewing options selector:
http://www.huntcal.com/cal/view/mother/nature?vm=-v
- vm=-l removes the legend:
http://www.huntcal.com/cal/view/mother/nature?vm=-l
- vm=-we is used to not show weekends (Saturday & Sunday):
http://www.huntcal.com/cal/view/mother/nature?vm=-we
- vm=-h is used to remove the header:
http://www.huntcal.com/cal/view/mother/nature?vm=-h
- vm=-f is used to remove the footer:
http://www.huntcal.com/cal/view/mother/nature?vm=-f
This tells the calendar system to remove the editing controls, month navigation, viewing options and week view icons:
http://www.huntcal.com/cal/view/mother/nature?vm=r-l-m-v-w
- the calendar table,
- 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/cal/aview/holidays/holidays?vm=rs-L;m=1;tw=414
Of course, you can also widen the calendar display:
http://www.huntcal.com/cal/view/conf/rooms?tw=800 - By default, events without start times are grouped by category. If you prefer to list
such events by the time they were created, use the se parameter. The value of the parameter should be "t".
Example:
http://www.huntcal.com/cal/view/mother/nature?se=t
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 view 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 view.
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.
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:Name Possible values m 1 - 12 d 1 - 31 yr 1998 - 2020
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/cal/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/cal/aview/mother/nature?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/cal/aview/mother/nature?m=1;m2=12;cat=2,3;vm=rs
(Note: a comma is used to separate the category IDs.) - Events can also be exported using the advanced view capabilities. Use the exp URL parameter to
export events within a range of dates. The "vm=s" URL parameter must also be used with the exp parameter
to retrieve events without form input. For example, this exports all 2010 events:
http://www.huntcal.com/cal/aview/mother/nature?exp=1;vm=s;m=1;d=1;yr=2010;m2=12;d2=31;yr2=2010 - 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/cal/aview/mother/nature?vm=rs-L;showDescr=1
If you need a calendar view not supported by
the parameters specified above, contact us.

