Overview

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.

Creating a Course Container file

The Course Container file specifies which courses you would like to see in your CD Feed. This file should have a name ending with “.CFT” (e.g, “history.cft“) and be placed in your course-feeds directory (e.g.,http://www.bu.edu/history/course-feeds/). If you would like to have multiple CD Feeds, simply create a Course Container file (hereafter .CFT) for each feed. You can create a .CFT file using any text editor, such as Windows Notepad or OS/X TextEdit.

Tip: Choose an intuitive name for your .CFT file, such as “undergraduate.cft” for your department’s undergraduate courses, or “armenian.cft” for Armenian Studies courses.

Contents

A .CFT file consits of two custom tags and (optional) HTML. These tags are: the<bub_base> tag, which names the file that will contain your CD Feed, and the<bub_course> tag, which selects the courses contained in your CD Feed. Both the <bub_base> and <bub_course> tags must be included in your .CFT file.

<bub_base>

The <bub_base> tag has three basic functions: it states where your CD Feed files will go, how they will appear, and – in very broad terms – what types of courses to display or exclude.

The output attribute is the most basic attribute of the <bub_base> tag: it specifies where your CF Feed file will be produced. charset indicates the character set used in the CD Feed files; by default, this is “latin1“, the same as a standard webpage, but can be changed to match the character set used in your website. Other (optional) attributes are included below; note that you mustinclude an output attribute in your <bub_base> tag. All other attributes are optional.

Full List of Possible <bub_base> Attributes

Attribute Description Sample Value
blank_titles Indicates whether to include courses that have blank titles (and usually blank descriptions). Can be Y (default) or N. “Y”
charset Character set of the output, using MySQL syntax. Default is “latin1 utf8
output File to write resulting output to. This should indicate a file within course-feeds/output, preferably with a name ending in “.html”. com.html
semester Restricts course listings to a particular semester. Required if show_sections=”Y” or show_unscheduled_courses=”Y”. The first four digits must be the semester code: FALL, SPRG, SUM1, SUM2, or SUMM (which will return courses in both SUM1 and SUM2). The last four digits must be the calendar year. “FALL2007”
show_sections Whether to show section and schedule information in addition to course descriptions. Can be Y or N (default). “Y”
show_unscheduled_courses Whether to include courses that have no sections scheduled in the specified semester. Can be Y (default) or N. “Y”
template Specifies a template file to be used when formatting CD Feed data. This should indicate a file within course-feeds/templates. See below for additional information. history.tpl” or “com.html
terms Whether to include summer-term courses and descriptions. Can be one of: regular (default), summer, or all. “regular”

Examples

<bub_base output=”undergraduate.html”>

This code specifies an output file “undergraduate.html”, with the default “latin1” character set. Because this uses the default “latin1″ character set, there is no visible charset attribute. It will show all courses that fit the requirements outlined in the <bub_course> tag (see below).

<bub_base output=”all.html” charset=”utf8″>

This code specifies an output file “all.html”, with the “utf8″ character set. It will show all courses that fit the requirements outlined in the <bub_course> tag.

<bub_base output=”all.html” charset=”utf8″ semester=”FALL2008″ show_sections=”Y” show_unscheduled_course=”N”>

This code specifies an output file “all.html”, with the “utf8” character set. Additionally, it indicates to show all courses scheduled for the Fall 2008 semester, showing section and schedule information, and omitting any courses which aren’t scheduled for this semester. These courses are drawn from pool of courses specified in the <bub_course> tag.

<bub_course>

The <bub_course> tag specifies what courses to include or exclude courses from your CD Feed. Its properties do not specify scheduling information (e.g., whether a course is being offered) – this is set by the <bub_base> tag. To specify several sets of courses to be included in your CD Feed, you can add more than one <bub_course> tag to your .CFT file.

The <bub_course> tag must contain either an “id” attribute or both a “college” and a “department” attribute.

Attribute Description Sample Value
college Specifies courses to display; required if using department. Unlike id, this cannot be a list (e.g., college=”CAS,CFA” is not valid.) “COM”
department Specifies courses to display; required if using college. Unlike id, this cannot be a list (e.g., department=”AR,MU” is not valid.) “CO”
except Specifies course(s) to exclude from listing. Can be one or more courses or ranges, in the same format as id. “COMCM301” , “COMCM301-COMCM350”, “COMCM301, COMCM302, COMCM305”, “COMCM301, COMCM320-COMCM350”
id Specifies course(s) to display. Can be one or more courses or ranges. Overrides college/department. “COMCM301” , “COMCM301-COMCM350”, “COMCM301, COMCM302, COMCM305”, “COMCM301, COMCM320-COMCM350”
template Specifies a template file to be used when formatting CD Feed data. This should indicate a file within course-feeds/templates. See below for additional information. history.tpl” or “com.html

Note that you can include a template file in both the and tags. This allows one to have the courses indicated in one tag (e.g., classes outside your department) displayed differently than those indicated in another tag.

Hint: When adding multiple tags, some attributes (e.g., “show_unscheduled_courses”) can be used inside a tag to override the defaults set in .

Examples

<bub_base output=”undergraduate.html”>

This code selects all CAS History courses with numbers in-between 100 and 599 (i.e., all undergraduate courses). Note that it does not specify an output template.

<bub_base output=”all.html” charset=”utf8″>

This code adds an output template and selects all CAS History courses with numbers in-between 100 and 599, adding also CAS Anthropology 550. An example usage would be to include courses of interest in another department.

<bub_base output=”all.html” charset=”utf8″ semester=”FALL2008″ show_sections=”Y” show_unscheduled_course=”N”>

This code adds an output template and selects all CAS History courses with numbers in-between 100 and 599, adding also CAS Anthropology 550, but excluding CAS HI112. An example usage of “except” would be to exclude courses offered to non-majors that cannot be taken for credit by majors.

<bub_course>

The <bub_course> tag specifies what courses to include or exclude courses from your CD Feed. Its properties do not specify scheduling information (e.g., whether a course is being offered) – this is set by the <bub_base> tag. To specify several sets of courses to be included in your CD Feed, you can add more than one <bub_course> tag to your .CFT file.

The <bub_course> tag must contain either an “id” attribute or both a “college” and a “department” attribute.