You can create a course list, automatically drawn from the course catalog, for any academic program or department at Williams. Because the data is being pulled from the registrar’s database, you won’t need to update any course details in WordPress. Typically this will already be set up when your site is moved into WordPress.
Creating the shortcode
To create the [wms_courses] shortcode:
- Place your cursor in the visual editor where you’d like the course list to appear.
- Click on the “Shortcodes” button, located in the 2nd row of your visual editor’s toolbar (outlined in orange below). If you only see 1 row of tools, click on the kitchen sink (outlined in green below) to reveal the 2nd row.
- Hover over the “Embed External Content” menu to reveal its submenu, and select “Course Catalog”, outlined in red below.
Fill out the form in the dialog popup box. Hovering over the input boxes will reveal hints, helping you fill out the form. Clicking “OK” will insert the shortcode into the visual editor.
In the department/program box, enter the 3-4 letter department code used in the course catalog (ENGL, BIOL, etc).
You can create a course list based on a subject attribute instead of a department- for example, the international studies program breaks down its courses by regional and thematic tracks such as African studies, east Asian studies, economic development, and global health. To do something like this, you'll need to visit the course catalog search page, and look at what subject attributes are available (see below, red box).
You'll need the catalog code for the subject attribute, which you can get by viewing the above page's source (control-U on most browsers). Search for the HTML corresponding to your subject attribute in the pulldown menu. For Global Health Studies Electives, you'd use the red text below.
<option value="INST_INSTECON">INST Economic Development Studies Electives</option>
<option value="INST_INSTGLOB">INST Global Health Studies Electives</option>
<option value="INST_INSTLAT">INST Latin American Studies Electives</option>
Description detail level
The detail level controls how much information is displayed for each course. By default, expandable descriptions are used- they show the first few sentences of the course description, with a link you can click to see a longer description. For more detailed information on a course, the viewer can click on the “Catalog details” link, which brings them to the course catalog.
Editing the shortcode
In the editor (in both visual and text modes), the shortcode will look something like this:
[wms_courses dept="ENGL" detail="short"]
You can edit the shortcode attributes (the values inside the quotes above) directly, or you can delete the shortcode, and create a new one using the shortcode builder tool again.
Multiple course listings on the same page
You can put as many course listing shortcodes on the same page as you’d like. For example, the classics site uses separate shortcodes to list Classics (CLAS), Greek (CLGR), and Latin (CLLA) on the same page, separated by HTML headers.
Updating course information
The course lister will display all the courses (that meet the criteria of your shortcode settings) offered in the current academic year, plus courses that are not offered this year (but may be offered again in the future) shown greyed out. If there is an error in this data, please contact Barb Casey in the registrar’s office.