DISCLAIMER: This should be tested on a development environment that is close to or the same as your production environment. Some of the mechanisms used here will not work in all server configurations. I will take any feedback and try to make it compatible with all setups.

Download

Download latest version: ct-community-college-course-search-latest.zip

Description

This WordPress plugin lets you add two types of course search engines on your website: a quick search and a custom search. Either one, or both, can be added with some simple shortcodes. The great part about the custom search is that each field is added with a different shortcode, so you can lay out the form how you like.

This plugin only searches the CT Community College system website for courses.

I built this modularly so you can implement only what you want on your site. There are two distinct components – the quick search and the custom/advanced search.

Quick Search

Option 1: Single Term (search only one term)

To implement this:

  1. install the plugin
  2. add the search form shortcode to a page: [ccccs-course-search-basic term=1173]
    note: change the term parameter from 1173 to the one you want to search*.
  3. on the same page, probably further down, add the results shortcode: [ccccs-course-results-basic term=1173]
    again, change the term parameter to match the previous.

* you can find term parameter codes by inspecting the HTML of the term select box on online.commnet.edu, or just ask me for some guidance here.

Option 2a: Top x Terms (a dropdown lets the user pick a term before running a quick search)

Demo: https://www.tunxis.edu/course-search/ (the first search area on the page)

To implement this:

  1. install the plugin
  2. add the search form shortcode to a page: [ccccs-course-search-basic term=top count=3]
    note: change the count parameter from 3 to the number of terms you want available (starts at most recent)*.
  3. on the same page, probably further down, add the results shortcode: [ccccs-course-results-basic term=top]

Option 2b: Specific Terms (a dropdown lets the user pick a term before running a quick search)

To implement this:

  1. install the plugin
  2. add the search form shortcode to a page: [ccccs-course-search-basic term="1173,1181"]
    note: change the term parameter to a list of term codes you want available*.
  3. on the same page, probably further down, add the results shortcode: [ccccs-course-results-basic term=top]

* you can find term parameter codes by inspecting the HTML of the term select box on online.commnet.edu, or just ask me for some guidance here.

Custom Search

Demo: 
https://www.tunxis.edu/course-search/
 (the second search area on the page)

To implement this:

  1. install the plugin
  2. add appropriate search field shortcodes to a page (see ccccs shortcode reference)
  3. on the same page, probably further down, add the results shortcode: [ccccs-course-results-advanced]
  4. add the class search-code-advanced to an HTML element (probably a div) which wraps the entire set of search field shortcodes

Shortcode Reference

Other Notes

The code is GPL2.0 so you can take it, modify it, port it to other languages or CMS’s as you like. The only requirement is that the code stay free and publicly accessible.

Core Features:

  • Keep users on your site for running searches
  • Style-free … so it will inherit the styles of your theme, or you can write/add your own flavor to the search form or results.
  • Automagically searches your college’s courses … it uses the host domain to figure out which college results to return
  • Mobile-friendly results – when long table rows won’t fit, it stacks table cells within a row so all returned data is still visible. If you prefer to allow horizontal scrolling, a few additional CSS styles can be applied to do that instead.
  • Modular – use quick search, custom search, or both wherever you like. Fields of custom search are also quite configurable.

Core Features of Quick Search:

  • FAST – it caches a complete listing of courses for your college on your site. It is set up to update once cached entries are > 20 minutes old.
  • Finds search term in any text of a course listing, including course code, CRN, title, instructor name, etc.
  • Can be set up with cron job so that search results are always cached and ready to be searched. If you don’t set up cron, then the page automatically tries to fetch the listing as soon as someone hits the page.
  • Multiple quick search forms and results can be on a page. That means you can set up multiple quick searches within accordion sections or any UI component.

Core Features of Custom Search:

  • Organize/display fields however you see fit, in any order. You can even omit fields.
  • Always up-to-date – it actually copies the fields from the online.commnet.edu website on the fly, so you won’t need to update the term selection box when a new semester’s courses are available on the main site

Changelog

@TODO

  • add college code param to quick search tags just in case plugin is NOT hosted on a CT community college site (currently javascript just picks a college to search based on host domain)
  • try to auto-wrap the advanced search fields
  • add shortcodes for opening/closing tag of advanced form so that implementation does not require adding custom classes
  • more error handling and checks for when data is not returned from main site
  • simplify the advanced search field shortcodes or at least make some shortcuts to typing them in (they’re really long right now)
  • do we really want to pull then entire form just to get the fields from online.commnet.edu? might be easier just to hard-code them and expect that we’ll update plugin code as needed
  • make it so that user can choose to have a multi-select be an array of checkboxes instead of the default select elements
Do NOT follow this link or you will be banned from the site!