ColdFusion Calendar Custom Tag

If you think to have a nice looking quick calendar on your ColdFusion web site then you may want to use this custom tag.

This tag allows you to do the following cool things:

- To have an interactive calendar on any page of your site.
- To attach single and multiple events to particular dates and make it visible on the calendar.
- To access multiple and single event pages from the calendar in one click.
- To add, edit, and delete events at the calendar administrator panel

How to make this tag work on my web site?

It is very simple. After you purchased the tag do the following:

1.) Unzip calendar.zip archive and extract all files in some temporary location
2.) Copy the following files:

calendar.cfm
arrow_l.gif
arrow_r.gif
calendar_add_event_show.cfm

and put them in the same folder with your .cfm page on which you are going to insert the calendar custom tag.

3.) If you do not have your own application.cfm file, then use my file. Theapplication.cfm file must be located in the root of your web site. If you have you own application.cfm in the root you have to add the following lines of code into it:

<cfset ctable = " NameOfEventTable">
<cfset cdatasource = " NameOfYourDataSource ">
<cfapplication name = " YourApplication "
sessionmanagement = "yes"
setclientcookies="yes"
sessiontimeout="#CreateTimeSpan(2,0,0,0)#">

where:

NameOfEventTable is a name of the table where you store event records. In my application.cfm, it's “calendar”. If you are going to use my datasource use this name.

NameOfYourDataSource is a name of your datasource. In my application.cfm, it's “calendar”. If you are going to use my datasource use this name.

YourApplication is a name of your ColdFusion application. You can use any name.

For example, this is how it looks like in my application.cfm on doctorjackson.org web site.

<cfset ctable = "calendar">
<cfset cdatasource = "calendar">
<cfapplication
name = "RobertJackson"
sessionmanagement = "yes"
setclientcookies="yes"
sessiontimeout="#CreateTimeSpan(2,0,0,0)#">

4.) Set up your ColdFusion datasource and name it as you specified in the application.cfm.

If you want to use my MSAccess database copy my “db” folder that consists of calendar.mdb file in any location youuse to store data on your ColdFusion server and register this datasource in ColdFusion Administrator with the name “calendar

If you have your own datasource then you can either import my “calendar” table and use it in your database or if you already have a table where you store event records then in this table the following fields must be presented:

ID – key field, (integer, autoincrement)
cdata – datetime field (Igeneral date/time format in my MS Access datasource)
ctitle – text field (255 length)
cdescription – (memo field in MS Access)

Check cdata format compatibility if you use other database than MS Access. In any case the name of your datasource and the event table must be the same as you specified them in application.cfm.

5.) The last thing to do is to copy and put on your site the “admin” folder that consists of files that allow you managing the calendar. You may put this folder in your web site root or at any other level of your web site. Just be sure you can access this folder through the web.

How to use the calendar custom tag?

To use the tag you have to insert the following code at the place where you would like to put the calendar:

<cf_calendar
page="NameOfThisPage"
cdatasource="NameOfYourDataSource"
ctable = " NameOfEventTable ">

The tag use three attributes:

page – this is a name of some yourpage.cfm in which you are inserting the calendar
cdatasource – a name of the ColdFusion datasource as you specified it in application.cfm
ctable – a name of the event table as as you specified it in application.cfm

For example this is how I used this tag to insert the calendar to this page

<cf_calendar
page="index.cfm"
cdatasource="calendar"
ctable = "calendar">

If everything is Ok, the nice looking calendar should appear on your page and show the current month.

Read more at http://www.doctorjackson.org/calendar/index.cfm