Skip to the content

Kansas State University

Calendars at K-State

Publishing information on upcoming events is common on the World Wide Web. Event information can be placed into a document in the Hypertext Markup Language (HTML) on any web server.

The K-State web site provides a way to publish event information in a slightly different method which provides several advantages:

  • Calendars are in a consistent format.
  • Calendars from several sources can be integrated into one combined calendar.
  • A familiar calendar navigation aid is placed at the top of every calendar.
  • Calendars are linked from a central location, so people can find your calendar easily. In particular, calendars are at http://www.k-state.edu/calendar/. From the K-State home page, you can reach the calendars by selecting the "Calendar" link near the top right-hand corner of the page.

To add your information to a calendar, the easiest option is to e-mail the event information to calendar@ksu.edu. Please allow at least three working days before the desired posting date.

However, if you have more than an occasional event, it is better to set up your own calendar. To create a calendar, two files are required:

  • Calendar data file.
  • Template file.

For these examples, assume that you are providing files for a department with a department code of dept and have chosen to call your calendar events.

Calendar Data File Basics

The calendar data file is named events.caldata, and it is stored in the department's web space directory, /usr/local/data/www/dept.

The format of the calendar data file is a single HTML definition list:

<DL>
<DT>date1
<DD>description of the event
<DT>date2
<DD>description of the event
</DL>

Several formats are acceptable for the date field:

April 30, 1995 This is the normal format.
April 30 A missing year defaults to the last year specified.
apr 30, 1995 Only 3 chars, case insensitive, of strings used.
Sunday, April 30, 1995 Day-of-week string is ignored; it doesn't matter even if the day of week is wrong.
Sunday April 30 1995 Commas and blanks are equivalent
April 1, 1995 -- May 2, 1995 Any two dates separated by '--' are a range. The event is duplicated for each date in the range, inclusive.

Other notes about the calendar data file:

  • There is no limit to the number of events that can be listed on a single day or the total number of events in a file.
  • Do not include any HTML tags in the date field. The date field is bold when displayed, but this bolding is added by the calendar formatting process.
  • You can put multiple events on a single date by using multiple <DD> tags. You could also repeat the date, i.e., use multiple <DT> and <DD> tags.
    <DL>
    <DT>date
    <DD>description of the first event on this date
    <DD>description of the second event on this date
  • Events do not have to be in chronological order within the calendar data files.
  • Everything in the calendar data file before the first <DL> tag and after the first </DL> tag is ignored.
  • The program that processes the calendar data file does not understand everything about HTML, and thus differences that do not matter to HTML may matter to a calendar file. In particular, the <DL>, <DT>, <DD>, and </DL> tags must all begin in column 1. If you use an HTML editor program to change the calendar file, be sure it produces files suitable for calendar data files. When in doubt, you can always check the file with a Unix editor such as vi or pico.
  • Don't try to grab attention by making the entire text of your event bold, all caps, larger, or a different color.

Wording of Event Text

The difficult part of creating a calendar file isn't the mechanics of getting the data into the proper HTML format. Instead, the emphasis is on wording the events in a clear, concise, and useful format.

  • Each event description must stand alone. Remember that each event will be processed into the master calendar, and thus will be seen without the context of the other events in your calendar.
  • Each event must be short. There is no enforced limit, but perhaps 30-40 words is the maximum. You can, of course, use a link to another web page with a more complete description.
  • Don't duplicate events of other calendars if your calendar is to be included in the master calendar. For example, the start of classes may be important to your organization. However, such events are already included in the Academic Calendar provided by the Registrar.
  • Be sure to include the basics:
    • what the event is
    • where the event is
    • when the event is
    • who is the intended audience/attendance of the event
    • who is sponsoring the event
    • are there admission charges?

Template file

The template file, named events-template.html contains the HTML code that surrounds the events. It has the title, top bar, etc., and must follow the K-State standards. Don't get too fancy--remember that the calendar processing will add the calendar table at the top.

This is only used when the calendar is viewed as its own calendar. When the calendar events are put into the master calendar, then the master calendar's template file is used.

Getting Your Calendar into Production

To get your calendar added to the list of calendars, and possibly included in the Master Calendar, contact webmaster@ksu.edu.

Simple Calendar Example

Suppose your department code is dept, and you are creating a calendar file named events. In the simplest case, you need to create two files: a calendar data file and a template file.

Here is an example calendar data file:

<DL>
<DT> January 1, 2001
<DD> Happy New Year!
<DT> January 16, 2001
<DD> Classes begin.
<DL>

For additional examples, see the existing calendars, most of which are in

/usr/local/data/www/calendar

Advanced Features

There can be multiple files that are all put together into one event database. All files of the form events*.caldata are read. For example, files named events-fall1996.caldata, events-regular.caldata, events-special.caldata, would all be processed together.

These calendar files must all be in the same directory, typically /usr/local/data/www/dept.