Applying AgCal to your Web Site
This page describes the process and details for enabling the presentation of AgCal events on your web site.
Before applying these instructions you should have already requested and been issued a calendar instance and ID. If you have not done so Click Here to request your calendar account.
Step 1: Configuring the AgCal presentation string
The AgCal calendar listings are delivered via a web URL request within an IFRAME. The request is used normally in the form of:
http://agcal.tamu.edu/ageventlist.php?calid=34aj4921ma9&level=local
By default, this will display a list of the next 5 events (from the current date) as shown below.
Example:
- Mar 25 Monthly Departmental Staff Meeting
- May 12 Semester Final Exam Day
Parameters for the request string are:
| calid = <#> | Required: This number references your calendars ID. |
| level = <intranet,local> | Required: Determines what level events to display. |
| listnum = <#> | Optional: # being the number of events to list. This will list the next # of events no matter what month.* Default with no value will be 5. |
month = <#> | Optional: # being the numerical equivalent for the year of the month. This value limits the listing to only calendar events for that month.* Default of "0" is used for no month specification. |
global = <on/off> | Optional: Selecting "on" will display not only your local calendar events but also events from the top level college or agency site depending on your calendar setting. The default behavior is off is this parameter is not used or if "off" is defined as the parameter value. This parameter is also avalialbe for the "Subscribe" link so that visitors to you calendar to subscribe to your calendar events as well as events at the agency or college level, based upon your calendar setting. |
*Note: Events that have expired will be automatically removed from the calendar and will no longer be displayed. An example utilizing all parameters would be:
http://agcal.tamu.edu/ageventlist.php?calid=34aj4921ma9&level=local&listnum=10&month=5&global=on
Levels
The level parameter is used to determine what events to show on any given web page or site. For instance, you may have a departmental intranet site. You can choose to display events that have been categorized as "intranet" for this intranet web site, while on your public department web site choose not to display "intranet" leveled events by choosing the "local" parameter.
Step 2: Plugging into your web page
To support all web environments an IFRAME method has been utilized to insert the AgCal event listing in a web page. Below is an example of the code. This code will be available to you on your AgCal management screen once your account has been set up.
<iframe name="agcal" id="agcal" width=230 height=100 src="http://agcal.tamu.edu/ageventlist.php?calid=#&level=<intranet,local,group>&listnum=#" frameborder="0" scrolling="0"></iframe>
<img alt="Subscribe to this Calendar" src="http://agcal.tamu.edu/images/button.jpg"> <a href="webcal://agcal.tamu.edu/phpMyCal/ics.phpMyCal.php?calid=#">Subscribe to this Calendar</a>
Width and Height values can be changed as required by your web page design.
Step 3: Styling your Event List
Styling your event list is optional but recommended. To enable and control styling of your event list you will need to do the following:
- Create a directory in the document root of your web server "css" (please note that to use all lower case)
- Download and place a copy of the cascading style sheet called "agcal.css" in this directory.
- Adjust the style classes as required within the agcal.css file to meet your design needs.
A copy of the agcal.css file can be found here: agcal.css file download
Please follow the instructions within the style sheet file and do not rename any of the classes as the event listing software utilizes these class IDs.

