{"id":37855,"date":"2010-09-24T11:30:24","date_gmt":"2010-09-24T15:30:24","guid":{"rendered":"http:\/\/www.bu.edu\/tech\/web\/departments\/non-wordpress\/how-to\/coursedescription\/creating-a-course-template-file\/"},"modified":"2013-04-11T13:55:27","modified_gmt":"2013-04-11T17:55:27","slug":"course-template-file","status":"publish","type":"page","link":"https:\/\/www.bu.edu\/tech\/services\/cccs\/websites\/www\/non-wordpress\/how-to\/coursedescription\/course-template-file\/","title":{"rendered":"Creating a Course Template File"},"content":{"rendered":"<p>This step should take place only after your department&#8217;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.<\/p>\n<h3>Overview<\/h3>\n<p>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&lt;bub_base&gt; and &lt;bub_course&gt; tags of  the Course Container (.CDF) file.<\/p>\n<h3>Creating<\/h3>\n<p>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.<\/p>\n<h3>Contents<\/h3>\n<p>Course Template files (hereafter &#8220;CTF&#8221;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., &#8220;college&#8221;,  &#8220;department&#8221;, or &#8220;title&#8221;) within {! and !}; the {!element!} in the  template is then replaced by the corresponding data when your Course  Description Feed is produced.<\/p>\n<h3>Complete List of Course Template Elements<\/h3>\n<table border=\"1\">\n<tbody>\n<tr>\n<th>Element<\/th>\n<th>Description<\/th>\n<th>Sample Output<\/th>\n<\/tr>\n<tr>\n<td><strong>{!college!}<\/strong><\/td>\n<td>Three letter college ID<\/td>\n<td>&#8220;COM&#8221;<\/td>\n<\/tr>\n<tr>\n<td><strong>{!department!}<\/strong><\/td>\n<td>Two letter department ID<\/td>\n<td>&#8220;JO&#8221;<\/td>\n<\/tr>\n<tr>\n<td><strong>{!course_num!}<\/strong><\/td>\n<td>Three number course ID<\/td>\n<td>&#8220;411&#8221;<\/td>\n<\/tr>\n<tr>\n<td><strong>{!title!}<\/strong><\/td>\n<td>Full title of course<\/td>\n<td>&#8220;Professional Journalism Internship&#8221;<\/td>\n<\/tr>\n<tr>\n<td><strong>{!prereq_u_form!}<\/strong><\/td>\n<td>Undergrad course prerequisites<\/td>\n<td>&#8220;(COMJO307 &amp; COMJO308)&#8221;<\/td>\n<\/tr>\n<tr>\n<td><strong>{!prereq_u_desc!}<\/strong><\/td>\n<td>Undergrad non-course prerequisites<\/td>\n<td>&#8220;Must be a junior or senior.&#8221;<\/td>\n<\/tr>\n<tr>\n<td><strong>{!prereq_u!}<\/strong><\/td>\n<td>Combination of both undergraduate course and non-course prerequisites<\/td>\n<td>&#8220;Prereq: COM JO 307 and COM JO 308; must be a junior or senior.&#8221;<\/td>\n<\/tr>\n<tr>\n<td><strong>{!prereq_g_form!}<\/strong><\/td>\n<td>Graduate prerequisite courses<\/td>\n<td>&#8220;(COMJO308)&#8221;<\/td>\n<\/tr>\n<tr>\n<td><strong>{!prereq_g_desc!}<\/strong><\/td>\n<td>Graduate non-course prerequisites<\/td>\n<td>&#8220;Must have completed qualifying exams.&#8221;<\/td>\n<\/tr>\n<tr>\n<td><strong>{!prereq_g!}<\/strong><\/td>\n<td>Combination of both graduate course and non-course prerequisites<\/td>\n<td>&#8220;Grad Prereq: COM JO 308; Must have completed qualifying examsr.&#8221;<\/td>\n<\/tr>\n<tr>\n<td><strong>{!coreq_u_form!}<\/strong><\/td>\n<td>Undergrad co-requisite courses<\/td>\n<td>Same as prereq_u_form, but displays co-requisite information.<\/td>\n<\/tr>\n<tr>\n<td><strong>{!coreq_u_desc!}<\/strong><\/td>\n<td>Undergrad non-course co-requisites<\/td>\n<td>Same as prereq_u_desc, but displays co-requisite information.<\/td>\n<\/tr>\n<tr>\n<td><strong>{!coreq_u!}<\/strong><\/td>\n<td>Combination of both undergraduate course and non-course co-requisites<\/td>\n<td>Same as prereq_u, but displays co-requisite information.<\/td>\n<\/tr>\n<tr>\n<td><strong>{!coreq_g_form!}<\/strong><\/td>\n<td>Graduate course co-requisites<\/td>\n<td>Same as prereq_u_form, but displays co-requisite information.<\/td>\n<\/tr>\n<tr>\n<td><strong>{!coreq_g_desc!}<\/strong><\/td>\n<td>Graduate non-course co-requisites<\/td>\n<td>Same as prereq_u_desc, but displays co-requisite information.<\/td>\n<\/tr>\n<tr>\n<td><strong>{!coreq_g!}<\/strong><\/td>\n<td>Combination of both graduate course and non-course co-requisites<\/td>\n<td>Same as prereq_u, but displays co-requisite information.<\/td>\n<\/tr>\n<tr>\n<td><strong>{!instructor!}<\/strong><\/td>\n<td>Names of all instructors<\/td>\n<td>&#8220;Daniel Segre and Calin Belta&#8221;<\/td>\n<\/tr>\n<tr>\n<td><strong>{!credits!}<\/strong><\/td>\n<td>Number of credits<\/td>\n<td>&#8220;4&#8221;; can also be &#8220;Var&#8221;<\/td>\n<\/tr>\n<tr>\n<td><strong>{!offered!}<\/strong><\/td>\n<td>Semester course appears; can be ongoing<\/td>\n<td>&#8220;2nd sem.&#8221;<\/td>\n<\/tr>\n<tr>\n<td><strong>{!description!}<\/strong><\/td>\n<td>Written description of class.<\/td>\n<td>&#8220;A course in advanced photography for &#8230;&#8221;<\/td>\n<\/tr>\n<tr>\n<td><strong>{!course_link!}<\/strong><\/td>\n<td>Link to course information, if any (same as Bulletin).<\/td>\n<td>&#8220;http:\/\/www.bu.edu\/htbin\/class.pl?hc= %23CC3333&amp;t=COM+JO+411+ Professional+Journalism+Internship&#8221;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>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:<\/p>\n<p>&lt;div&gt;{!title!}&lt;\/div&gt;<\/p>\n<p>Because the {!title!} element is enclosed in a &lt;div&gt; tag with  the class &#8220;titles&#8221;, if your webpage includes a CSS style &#8220;titles&#8221;, any  course titles in your CD Feed will automatically use this style  information. Advanced users can also create their own <a href=\"https:\/\/www.bu.edu\/tech\/services\/cccs\/websites\/www\/non-wordpress\/how-to\/coursedescription\/custom-template-elements\/\">customized template elements<\/a>.<\/p>\n<p>Note that not all course descriptions include data in each of the above fields.<\/p>\n<h3>Example<\/h3>\n<p>&lt;div&gt;{!department!} {!course_num!} &#8211; {!title!}&lt;\/div&gt;<br \/>\n&lt;div&gt;<br \/>\n{!description!} &lt;strong&gt;{!credits!}&lt;\/strong&gt;<br \/>\n&lt;\/div&gt;<\/p>\n<p>This example code displays the department (in two letter format),  course number and title together in a single &lt;div&gt; tag (so that  they&#8217;re styled as a single element). The course description is placed in  a &lt;div&gt; tag of its own, with the number of credits indicated at  the end in boldface (&lt;strong&gt;). This code produces HTML output  such as the following:<\/p>\n<p>&lt;div&gt;FT 314 &#8211; Writing for Television&lt;\/div&gt;<br \/>\n&lt;div&gt;<br \/>\nRequired of all students in the Television Program. The theories<br \/>\nand techniques underlying writing for the principal radio and<br \/>\ntelevision forms. Emphasis is on the relationship between writing<br \/>\nand production, establishing sound aesthetic bases for all broadcast<br \/>\nwriting, and the writer&#8217;s social and ethical responsibilities.<br \/>\nWeekly writing assignments, lectures, and critiques. May be taken<br \/>\nsophomore year. &lt;strong&gt;4 cr.&lt;\/strong&gt;<br \/>\n&lt;\/div&gt;<\/p>\n<p>Any data fields that are not specifically identified in your CTF file will not be displayed.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This step should take place only after your department&#8217;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&#8230;<\/p>\n","protected":false},"author":3321,"featured_media":0,"parent":37730,"menu_order":3,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/37855"}],"collection":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/users\/3321"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/comments?post=37855"}],"version-history":[{"count":7,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/37855\/revisions"}],"predecessor-version":[{"id":64879,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/37855\/revisions\/64879"}],"up":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/37730"}],"wp:attachment":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/media?parent=37855"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}