[tab:{Usage}=Using the Coursefinder Shortcode]
The coursefinder shortcode allows you to embed content from the university coursefinder database into pages or posts.
Data can be embedded in a page from each of the fields available in the coursefinder serrvice (for a full list of field names, see the Coursefinder Fields tab) using the following syntax:
[coursefinder ucas_code="P390" field="entry_requirements"]
This will retrieve the entry_requirements
field for the course BA Hons New Media (UCAS code P390). The result of putting this code on the page would be:
Sites using the University WordPress theme have an additional entry box for pages where you can insert the UCAS code. If you enter the UCAS code in this box, you can omit it from the shortcode, like this:
[coursefinder field="fees"]
If you want to enforce the term for which the feed is retrieved, you can add it as a shortcode options, i.e. to get the same information as above for 2015/16:
[coursefinder ucas_code="P390" field="entry_requirements" term="201516"]
Which produces:
[tab:Shortcode Options]
The shortcode accepts the following options:
- course_id
- This is the ID of the course in the Coursefinder system.
- ucas_code
- The UCAS course code.
- major_code
- The banner major code for the course.
- field
- The name of the field you wish to retrieve and display (see below for a list of possible fields).
- term
- This is a six digit representation of the academic year for which data is returned, in the format
YYYYyy
, i.e. for the academic year 2012 – 2013, you would use201213
. This defaults to the current year/next year until the 1st of May (for undergraduate courses) or the 1st October (for postgraduate courses), at which point the term will switch to the following year. For example, on 2nd May 2012 the term used by default for an undergraduate course would be201314
. - display_term
- This will display the term for which the information applies in brackets preceding the content of the field.
- type
- Course type (PGR, PGT or UG – default is UG). This determines the correct rollover date for the term options if it isn’t supplied.
- cache
- The number of seconds a cached copy of the coursefinder data will be kept before a fresh copy of the data is retrieved from the system (default 3600 – 1 hour)
- clean
- Whether to clean any spurious code from the data before it is displayed – can take the values
yes
andno
(defaultyes
)
Unless a valid course_id
, master_code
or ucas_code
(either in the page where the shortcode is used or in the shortcode options) are provided, the shortcode will not generate any content. The order of precedence for using these three fields to identify a course is as follows:
major_code
course_id
ucas_code
The theme includes a field for each page where the UCAS code can be input when the page is edited – this is the code which will be used by default for the ucas_code
option, and is the code which will be used in the KIS widget. Including the ucas_code
option in the shortcode itself will override this value. If a major_code
or course_id
are used to identify the course, these will override the ucas_code
(either in the page or in the shortcode attributes).
Additional Options
There are some additional shortcode options which access features of the Coursefinder API which are not currently in use (they return lists of courses rather than information concerning a single course). These are summarised below:
- category_id
- Retrieves a paginated list of all courses within a given category.
- faculty
- Retrieves a paginated list of all courses matching specified faculty. Used in conjunction with the term and type (optional).
- letter
- Retrieves a paginated list of all courses matching specified initial letter. Used in conjunction with the term.
- search
- Retrieves a paginated list of all courses matching the supplied query. Used in conjunction with the term and type (optional).
- type
- Retrieves a paginated list of all courses matching type (PGR, PGT or UG). Used in conjunction with the term.
This is currently used to indicate the type of programme you are retrieving from the system in order to determine the correct rollover date for the term, so has a different use case when theucas_code
is the method employed for identifying courses. - per_page
- The number of results to display per page
- page
- The number of the page to display
[tab:{Coursefinder Fields}=List of available fields in Coursefinder]
Below is a summary of the fields in the database which you can embed using this shortcode:
Field name | Field title |
---|---|
program_title | Programme title |
ucas_code | UCAS code |
qualification | Qualification |
entry_requirements | Entry requirements |
professional_accreditations | Professional accreditations |
how_to_apply | How to apply |
entry_test | Entry test |
selection_principles | Selection principles |
fees | Fees |
scholarships_and_bursaries | Scholarships and bursaries |
modes_of_study | Modes of study |
why_study | Why study? |
what_you_study | What you study |
learning_and_assessment | Learning and assessment |
modules | Modules |
facilities | Facilities |
study_abroad_opportunities | Study abroad opportunities |
work_placement_opportunities | Work placement opportunities |
careers | Careers |
visitation_contact | Visitation contact |
information_contact | Information contact |
other_information | Other information |
related_courses | Related courses |
[tab:Term Date rollover]
If the UCAS code is used to identify a course, and the term attribute is not set, the shortcode will adjust the term automatically to reflect the term which is currently live in the coursefinder system. This is done by showing the current/following year until the switchover date of May 1st (for Undergraduate courses – October 1st for Postgraduate courses), after which the following year/subsequent year are used. For example, the shortcode will use the term 201314
for undergraduate courses from 1/5/2012 to 30/4/2013, then 201415
from 1/5/2013 to 30/4/2014.
Term dates are only used when the UCAS code is the method employed for identifying the course. If course_id
is used, the course ID is specific to the year the course is running for, so the term date is irrelevant and will be ignored (the same course running in different years will have separate course IDs for each year). If major_code
is used to identify the course, the terms will roll-over automatically.
[tab:END]