This step should take place only after your department’s course-feeds directory has been created and a notification received from Webmaster suppport. It creates two files or sets of files: the Course Container (.CFT), which determines what courses are displayed, and the Course Template (.html), which determines how the course feed data is displayed.

Overview

Course Templates determine both the layout and content (information included) of individual course entries in your CD Feeds. You can create a single template file to control how all of your CD Feed data displays, or create multiple template files for multiple feeds, or to differentiate groups of courses within a feed. Templates can be referenced both in the<bub_base> and <bub_course> tags of the Course Container (.CDF) file.

Creating

You can create a course template file with any name; however, the recommended format is to use an .html document for your course template. You can create the starting .html document using any web editor (e.g., Dreamweaver), making sure to match the HTML format (e.g., XHTML Transitional 1.0) used by your website. Any Course Template file that you create should be located in course-feeds/templates.

Contents

Course Template files (hereafter “CTF”s) use a PHP-style syntax to indicate where the different data fields from course descriptions should go. This syntax {!element!} identifes a named element (e.g., “college”, “department”, or “title”) within {! and !}; the {!element!} in the template is then replaced by the corresponding data when your Course Description Feed is produced.

Complete List of Course Template Elements

Element Description Sample Output
{!college!} Three letter college ID “COM”
{!department!} Two letter department ID “JO”
{!course_num!} Three number course ID “411″
{!title!} Full title of course “Professional Journalism Internship”
{!prereq_u_form!} Undergrad course prerequisites “(COMJO307 & COMJO308)”
{!prereq_u_desc!} Undergrad non-course prerequisites “Must be a junior or senior.”
{!prereq_u!} Combination of both undergraduate course and non-course prerequisites “Prereq: COM JO 307 and COM JO 308; must be a junior or senior.”
{!prereq_g_form!} Graduate prerequisite courses “(COMJO308)”
{!prereq_g_desc!} Graduate non-course prerequisites “Must have completed qualifying exams.”
{!prereq_g!} Combination of both graduate course and non-course prerequisites “Grad Prereq: COM JO 308; Must have completed qualifying examsr.”
{!coreq_u_form!} Undergrad co-requisite courses Same as prereq_u_form, but displays co-requisite information.
{!coreq_u_desc!} Undergrad non-course co-requisites Same as prereq_u_desc, but displays co-requisite information.
{!coreq_u!} Combination of both undergraduate course and non-course co-requisites Same as prereq_u, but displays co-requisite information.
{!coreq_g_form!} Graduate course co-requisites Same as prereq_u_form, but displays co-requisite information.
{!coreq_g_desc!} Graduate non-course co-requisites Same as prereq_u_desc, but displays co-requisite information.
{!coreq_g!} Combination of both graduate course and non-course co-requisites Same as prereq_u, but displays co-requisite information.
{!instructor!} Names of all instructors “Daniel Segre and Calin Belta”
{!credits!} Number of credits “4″; can also be “Var”
{!offered!} Semester course appears; can be ongoing “2nd sem.”
{!description!} Written description of class. “A course in advanced photography for …”
{!course_link!} Link to course information, if any (same as Bulletin). “http://www.bu.edu/htbin/class.pl?hc= %23CC3333&t=COM+JO+411+ Professional+Journalism+Internship”

You can use additional text or HTML code in your CTF file to format the CD Feed; this is especially useful when integrating the CD Feed into a website. For example, your template could include the following code:

<div>{!title!}</div>

Because the {!title!} element is enclosed in a <div> tag with the class “titles”, if your webpage includes a CSS style “titles”, any course titles in your CD Feed will automatically use this style information. Advanced users can also create their own customized template elements.

Note that not all course descriptions include data in each of the above fields.

Example

<div>{!department!} {!course_num!} – {!title!}</div>
<div>
{!description!} <strong>{!credits!}</strong>
</div>

This example code displays the department (in two letter format), course number and title together in a single <div> tag (so that they’re styled as a single element). The course description is placed in a <div> tag of its own, with the number of credits indicated at the end in boldface (<strong>). This code produces HTML output such as the following:

<div>FT 314 – Writing for Television</div>
<div>
Required of all students in the Television Program. The theories
and techniques underlying writing for the principal radio and
television forms. Emphasis is on the relationship between writing
and production, establishing sound aesthetic bases for all broadcast
writing, and the writer’s social and ethical responsibilities.
Weekly writing assignments, lectures, and critiques. May be taken
sophomore year. <strong>4 cr.</strong>
</div>

Any data fields that are not specifically identified in your CTF file will not be displayed.