Documentation:WordPress/Plugins/UBC Courses Plugin

From UBC Wiki
Jump to: navigation, search

UBC Courses Options

A WordPress plugin that allows the listing of UBC courses, sections and instructors with data from the UBC calendar.

# 1.Activate the plugin via the "Plugins" menu. 
# 2.You collect the instructor information using the settings page.
# 3.You display the information using the shortcodes and parameters (below).

1. Activate the plugin via the "Plugins" menu.

Slide0.png


2. You collect the instructor information by going to Settings -> UBC Courses page.

Slide1.png


3a. Add the shortcode and parameters to the page content (details below).

Slide2.png


3b. How it displays on a page.

Slide3.png


4a. Add the shortcode and parameters within the Profiles -> Settings page (Profile View Tab - details below).

Slide4.png


4b. How it displays within a profile.

Slide5.png


UBC Courses Settings Page

In order to collect instructors from a particular course code, please choose the course code from the drop down selection list and click the "Get Instructors" button. Once the operation is complete, click the "Save Changes" button.

To delete instructors from the list, click on the red delete button (the list item should fade) and click on "Save Changes".

If you make a mistake in deleting or click once too many, do not panic - just click "Clear" and then "Save Changes" and begin again - Remember the data is just being gathered from UBC Calendar and is being cached so, you are not calling the remote Calendar server over and over again. Hint: For instructors in multiple disciplines, select course code and click the "Get Instructors" button again. Continue to build the list of instructors to suit your website.

Hint: For instructors that wish to use a different name than that which appears in the calendar, double-click on the name in the list, type in the preferred name, click change and make sure to save the changes - note: these name changes are NOT persistent and will need to be re-done if the instructor is removed from the list and is brought in again.

In order to view course lists within your content, use the ubccourses shortcode. and to view courses that an instructor teaches use the ubcinstructors shortcode.

[ubccourses] parameters

In its basic form the [ubccourses department=x] shortcode allows the listing of UBC courses with data obtained from the UBC Calendar. Some of the allowed parameters are as below:


   department - **required  - USE THE FOUR LETTER DEPT/SUBJECT CODE e.g. ANTH, SOCI, CHEM etc
   course - You can explicitly request a single course - e.g. 101A or if empty you get ALL courses in session
   tabs - default false – if true, the data is setup with tabs for each year level of courses.
   pills - if true, the data is setup with pills instead of tabs
   tabcount - default 4 – if set, the data is truncated at the year level of courses. If set to 'u', levels 100 through 400 are displayed. If set
   to 'g', levels 500 and 600 are displayed. To display courses for a single year level, use 'n*' (e.g. n3 shows 300 level courses only). Note:
   tabcount parameter can be used without tabs or pills as a list filter.
   parentslug - if entered, any page title (of the form e.g. “ANTH201A” that matches and has a parent equal to the slug will be linked to from the
   course list with a “Details” button
   desc_category - the category slug - if entered, any post title (of the form e.g. “ANTH201A” that has the category equal to the slug will shown
   in an accordion format below the calendar description with the accordion header being set to the category name (not slug).
   opentab - default 1 – has to be between 1 and tabcount – if entered will auto open at that tab/pill
   profileslug - if entered, and a profile exists on the website, shows a link next to instructors name in the sections listing.
   stickywinter - if true, session remains as Winter even if Summer term has begun. This can be explicitly set as "W" (winter) or "S" (Summer)
   stickyyear - if true, session year is forced to current year.
   instructors - if true and plugin configured (via the settings panel), will list instructors on the main course listing page (without users
   having to click on the "sections" button to see them). Note: If the calendar name differs from the profile name, the cross match can be made on
   the plugin admin page by double clicking the instructor name on the list and setting it to be the same as the profile name.

[ubcintructors] parameters

In its basic form the [ubcinstructors instructorname="lastname, firstname"] shortcode allows the listing of UBC courses that the instructor teaches in the current session. The instructor name has to match exactly (no fuzzy matching - see Note below) with the name in the UBC Calendar. Some of the allowed parameters are as below:

    • If used without the instructorname parameter and on a profile singular page, will show courses taught by that instructor. Hint: Can be placed in "if empty" container in a profile field.
    • Note: If the calendar name differs from the profile name, the cross match can be made on the plugin admin page by double clicking the instructor name on the list and setting it to be the same as the profile name.


   instructorname - if entered and plugin configured (via the settings panel), will list all courses that an instructor teaches within the
   current session.
   parentslug - if entered, any page title (of the form e.g. “ANTH201A” that matches and has a parent page equal to the slug will be linked
   to from the course list with a “Details” button
   profileslug - if entered and a profile exists on the website, shows a link next to instructors name in the sections listing.
   stickywinter - if true session remains as Winter even if Summer term has begun.
   stickyyear - if true session year is forced to current year. 
   instructors - if true and plugin configured (via the settings panel), will list instructors on the main course listing page 
   (without users having to click on the "sections" button to see them). Note: If the calendar name differs from the profile name, the cross match
   can be made on the plugin admin page by double clicking the instructor name on the list and setting it to be the same as the profile name.
   **If used without the instructorname parameter and on a profile singular page, will show courses taught by that instructor. Hint: Can be
   placed in "if empty" container in a profile field.

Frequently Asked Questions


The current courses being taught by instructors are not showing on their profile pages.

When you are configuring profiles (under Profile -> Settings), make sure you enter the shortcode [ubcinstructors] into one of the fields on the "Profile View" tab - usually entering into an "if empty" container works. The plugin will automatically match the "current" instructor with their current courses.


On the settings page, I select my subject code from the dropdown but, it shows me zero courses.

Make sure you check the current session courses are available at UBC Calendar.


I entered the [ubccourses department=x] but, I see no courses.

Make sure you check the current session courses are available at UBC Calendar.

I can not make a cross reference between courses and an instructor profile

Make sure you have the "instructors" parameter set to true and that the name on the profile matches exactly with the name on the list on the settings page. If it differs then edit the name on the list in the settings page (by double clicking on the name) and have it match the profile name. In some cases, there may be a special character in the name that interferes with the matching - just use the HTML special char (e.g. ') in both the profile and the list name.


I want to show just the undergraduate courses on the page.

Use the "tabcount=u" parameter.


I want to have multiple subject areas showing on a page.

You CANNOT use the "tabs" or "pills" parameter for this - instead use the plain list format and use multiple shortcodes on the page and use other means to get tabs (tabs shortcode)


We need custom course descriptions for our course list.

Create posts with the titles being the same as the course codes e.g. "ANTH100" etc and assign these to a category. Then use the "desc_category=x" parameter (where x=category slug). An accordion link will show below the title in the course list that will show an excerpt of the matching post and a link to the details page.