FETCH Widget

A free Javascript Widget to add live up-to-date course search capability to your website.

What is it

The widget is a javascript app that can be added to your website. It allows visitors on your site to search for F.E.T. courses with live up-to-date information.

Who is it for

The widget can be used on websites for Education and Training Boards, individual schools and colleges as well as independent web portals.

Why should you use it

The widget avoids duplication of work as it uses live data from the FETCH system. It removes the need for continuous alteration of your website as it is always up-to-date.

Service Updates

Follow us @SOLASFETCH and be notified of updates and enhancements

Follow us on twitter for service updates

Installing the Widget

Including the Widget in your website involves adding 2 lines of HTML code.

Your Provider Id

The provider id tells the widget whose courses to search. Use the data-providerId attribute in the <script /> tag.

To obtain your Provider Id please contact your E.T.B. Coordinator.

The data-provider id attribute can contain multiple ids separated by commas.

Note: Web portals that want to search courses from all providers, should omit the data-provider id attribute completely.

<!DOCTYPE html>

<html>

<!-- Your website-->

<!-- Loading the widget -->

<script src="https://widget.fetchcourses.ie/sfcw_init" data-providerid="yourcode"></script>

<!-- Widget Placeholder - somewhere on your page -->

<div id="sfcw" class="sfcw"></div>

</html>

Try It Out For Yourself

This is the widget in action...

Embedding the Widget

The target webpage requires 2 lines of code to be added to it. The first is a <script> tag that references the widget code and passes set-up parameters. The second is a <div> placeholder that represents where on the page the widget will actually appear.

The <script> tag

The script tag references the actual JavaScript application and passes along set-up parameters to it.

Script Tag Attributes

As well as using the src attribute to reference the widget, the script tag can pass configuration information to the widget by using data attributes.

Attribute Description Requirement Notes
src The url to the widget Required must be https://widget.fetchcourses.ie/sfcw_init Note: it does not end in a .js extension
data-providerid This represents the course provider to include in search results and contains one or more specific ids. Optional This value constrains the search results. If not provided it will return results from all providers. For multiple providers separate ids with commas.
data-style A reference to inbuilt customizations Optional Custom styles provided by the widget. E.g. fullwidth
data-style-url A url to a custom style sheet (CSS) Optional the style sheet will be loaded at the optimal time with the widget.
data-media-url A url to a custom js file for media information such as image and video placement Optional The js file is loaded after the widget is initialized allowing the media object to be altered.
data-keyword A search term to be used for an initial auto-search Optional If supplied the widget will automatically perform a search on the keyword when first loaded. A blank keyword is a valid entry triggering a global search.
data-callback The name of a function to call after the widget initializes Optional If supplied the widget will call this function after it has fully initialized.
data-map The way in which the widget uses Google Maps to map course locations. Optional If supplied the widget will load the Google Maps API using the data-googleapikey.

Valid values: Integrated, Independent and Both

Using Google Maps with the Widget
data-googleapikey The Google Maps Javascript API Key Required For Maps To use Google Maps with the Widget this key must be supplied.

You need to register with develops.google.com to get an API Key for Google Maps Javascript and Google Static Maps APIs.
Maps Javascript API

Using Google Maps with the Widget
data-flags A string of additional flags to modify widget behaviour. For a full list of possible flags see the data-flags table below. Optional Each flag must end with a semi-colon (;).

flag1;flag2;flag3;

Some flags can contain values in which case the format is

flag=value;

data-style values

Below is a complete list of valid values:

Value Description
fullwidth This causes the widget to use the full width of the page. It is a useful setting for websites that are restricted in width.

data-flags values

Below is a complete list of valid flags:

Flag Description
hidesearch; Will hide the search controls of the widget
nosection1; Will not include the HTML for section 1 – search controls
nosection2; Does not include the HTML for section 2 – search results table
nosection3; Does not include HTML for section 3 – course details
legend=value; Configures the legend on the search results sections. The value can be blank or a combination of one or more of the following letters: fpoe

Examples:
legend=; will hide the legend and the course type column
legend=fp; will only show fulltime and parttime colours in the legend.
legend=oe; will only show online and evening time colours in the legend.
noprovider; This flag removes provider information from the search results screen.
nolocation; This flag removes location information from the search results screen.
pageSize=value; Sets the initial page size. Valid values are 10, 25 and 50. 10 is the default.
pagination; Tells the widget to use a fixed size of page and to provide page navigation buttons to the user.

If omitted the widget uses its default mode of lazyloading the course list. As the user nears the end of the search results list more results are loaded and the list grows.
nohistory; This flag prevents the widget from adjusting the page history object. Used when the widget is being integtrated with a Single Page Application that has its own page history handler.
isced=value; Tells the widget to only include courses that belong to the ISCED categories specified. The ISCED codes can be broad or detailed. If more than one code separate with commas.
iscontracted=value; Tells the widget to only include contracted courses (value=1) or to exclude contracted courses (value=0)
socialicons; Shows social media icons that enable visitors to share the page. Links include Facebook, Google Plus, Linked-In, Twitter and Pinterest. Note: the social icons use Font Awesome to render. The page hosting the widget needs to load the Font Awesome CSS separately.
progs=value; Tells the widget to only include courses that belong to the Programme Categories specified. If more than one code separate with commas.

The <div> Placeholder

The <div> placeholder represents where on the webpage the widget will be rendered. It has a fixed format.

Format

<div id="sfcw" class ="sfcw"></div>

Linking to the widget

Although the widget can operate in isolation it can also be linked to from other pages or from inside the same page.

One example is a link that refers to a specific course. Another example is a link or form items that refer to specific search filters.

sfcw-courseId parameter

When the widget initializes, if the sfcw-courseId parameter is passed with a course id number value, the widget will automatically display the details of that course.

Examples

https://web-page-with-widget.html?sfcw_courseId=1

https://web-page-with-widget.html?...&sfcw_courseId=1

Search Filter Parameters

Parameter Description
sfcw-keyword Supplies the search keyword to the keyword search control
sfcw-iscedid Automatically selects the category in the advanced search options
sfcw-categoryid Automatically selects the programme in a customized search scenario *
sfcw-areaid Automatically selects the area in the search options
sfcw-locationid Automatically selects the location in a customized search scenario *
sfcw-targetawardingbodyid Automatically selects the awarding body in the advanced search options
sfcw-targetawardid Automatically selects the award in the advanced search options
sfcw-deliverymodeid Automatically selects the delivery mode in the advanced search options
* Some search controls do not appear in the default widget and are only available when the developer provides customized HTML for the Search Section.

Examples

https://web-page-with-widget.html?sfcw_keyword=business

https://web-page-with-widget.html?...&sfcw_keyword= business

<form method="get" action ="web-page-with-widget.html">
     <input name="sfcw-keyword" value ="business"/>
     <input type="submit" value ="Submit"/>
</form>

Widget Methods

The widget comes with some helper functions that can be called from within javascript. The widget is embodied in an object called sfcw.widget.

showCourse

showCourse instructs the widget to display the details of a course by using the parameter sent to it as the course Id.

Parameter Name Description
courseId The ID of the course to show

Examples:

sfcw.widget.showCourse(1);

<a href="#" onclick ="sfcw.widget.ShowCourse(1); event.preventDefault();">Course 1</a>

showResults

showResults instructs the widget to close any course details that are displayed and shows the search results screen.

There are no parameters.

See the Search method for an example on usage.

search

search instructs the widget to perform a search using the first parameter as a search object containing search filters.

Parameter Name Description
Search Filters An object containing one or more search filter values

Field Meaning
Keywords A keyword to search for
ISCEDId The ISCED Category Id
CategoryId The Programme Category Id
AreaId The Area Id
LocationId The Location Id
TargetAwardingBodyId The Id of the Awarding Body
TargetAwardId The Id of the target Award
DeliveryModeId The Id of the course delivery mode
fnc An optional reference to a callback function. The callback function is called when the search is complete

Examples:

var myCallBackFunction = function () { sfcw.widget.showResults(); }

sfcw.widget.search({ Keywords: 'business' });

sfcw.widget.search({ Keywords: 'business' }, myCallBackFunction);

<a href="#" onclick ="sfcw.widget.search({ Keywords: 'business' }, myCallBackFunction); event.preventDefault();">Search For 'Business'</a>

searchParameters

Returns the current searchParameters object containing the active search filters. See the search method for the structure of the searchParameters object.

There are no parameters.

setFilters

Takes a searchParameters object and sets the filter controls of the widget.

Parameter Name Description
searchParameters See the search method for the structure of the searchParameters object.

getCourseObject

Returns the current active Course Object. The widget Course Object is populated when a user clicks on a single course.

There are no parameters.

setCourseObject

Sets the widget's active Course Object and populates HTML elements with sfcw-data-* class names with corresponding course information. See Populating Course Data for more information.

Parameter Name Description
Course Object

enableLogging

Enables or disables console logging by the Widget. Used for debugging purposes.

Parameter Name Description
onoff Boolean value to determine whether the Widget should use javascript console logging.

Widget Events

The javascript programmer can hook in to certain Widget events with custom functions. When an event is triggered the widget calls the custom function.

Simply assign a function reference to one of the following variables.

event_searchComplete

This event is triggered every time a search is completed.

Parameter Passed Description
searchParameters See the search method for the structure of the searchParameters object.

event_addFavouriteCourse

This event is triggered every time the user adds a course to their favourites.

Parameter Passed Description
Course Id The ID of the Course saved to favourites

event_removeFavouriteCourse

This event is triggered every time the user removes a course from their favourites.

Parameter Passed Description
Course Id The ID of the Course removed from favourites

event_courseView

This event is triggered every time the user views a course.

Parameter Passed Description
Course Id The ID of the Course viewed

event_resultView

This event is triggered every time the user views the search results.

Parameter Passed Description
None

Event Example:

Log the course id every time a course is viewed by the widget user

sfcw.widget.event_courseView = function(courseId) {
console.log(courseId);
};

Widget Customization

The widget can be styled and customized to suit the host website. There are 3 areas of customization:

Customization Type Description
HTML The widget uses internal HTML to layout the information. The implementer can override the HTML layout.
CSS Style Sheet The widget uses internal CSS based on Bootstrap 3.3.5. The implementer can override CSS instructions
Image and Video Course Media Course related images and videos are not part of the widget however implementers can customize the widget to include course-related material.

HTML Customization

The widget normally uses internal HTML to layout the course search results and details. There are 3 HTML sections. The implementer may choose to override one or more of these.

Customizing Section 1 - Search Courses

To custom build the course results section follow these steps:

Search Controls

The user can search for courses using a keyword and/or selecting criteria from drop down boxes. To facilitate controls for each criteria you want to use is required. For example keyword text box, area drop down control and a search button.

The following table is a list of input form control ids the widget uses.

DOM ID Description
sfcw_input_keyword Input control for the search keyword
sfcw_select_area Select control for the area. This control will be automatically populated on widget initialization.
sfcw_select_sublocation Select control for the course location. If used this control is automatically linked to the sfcw_select_area control. Changing the sfcw_select_area changes the content of this control.
sfcw_select_category Select control for the course category. This control will be automatically populated on widget initialization.
sfcw_select_awardingBody Select control for the course awarding body. This control will be automatically populated on widget initialization.
sfcw_select_award Select control for the target award. This control will be automatically populated on widget initialization.
sfcw_select_provider Select control for the course provider. This control will be automatically populated on widget initialization.
sfcw_select_programme Select control for the programme/category. This control will be automatically populated on widget initialization.
sfcw_select_delivery Select control for the course delivery mode. This control will be automatically populated on widget initialization.
sfcw_button_search Button for user to initiate the search

Advanced Search Controls

You can put some of the controls in a separate div that is normally hidden but is shown when the user opts for ‘advanced search’ or ‘more search options’. Use the following classes to achieve this.

Class Description
sfcw-subsection-advancedSearch A div with this class will be hidden and shown based on the user’s requirement.

It is recommended that this div be given style=”display:none;” in the HTML to hide it initially.
sfcw-el-showHideAdvanceSearch Any HTML element with this class will activate as a toggle control for showing and hiding the advanced search options.

Overlay Mask

There is an additional section with id sfcw_section_overlay. This section is normally included with the search courses section. It is hidden by default and is only shown during a search to indicate activity. The overlay can be dismissed at any time by the user by pressing the ESC key.

If the nosection1 data-flag is used this overlay feature will be excluded.

Example HTML

<!--
///////////////////////////
Section 1 - Search Courses
Widget was passed nosection1; flag so we can
customize our own here. section 1 contains
sfcw_section_search and optionally sfcw_section_overlay.
////////////////////
-->

<!-- This section is only displayed during a search -->
<section id="sfcw_section_overlay" style="display: none;">
<h1>Searching...</h1>
</section>

<!-- Custom search section -->
<section id="sfcw_section_search">
<!-- 3 search controls -->
<input id="sfcw_input_keyword" />
<select id="sfcw_select_area"> </select>
<select id="sfcw_select_sublocation"> </select>
<button id="sfcw_button_search" class="btn">Search</button>

<!-- Advanced search toggle control -->
<a href="#" class="sfcw-el-showHideAdvanceSearch"> </a>

<!-- Advanced search options - initially hidden -->
<div class="sfcw-subsection-advancedSearch" style= "display: none;">
<!-- advanced search controls -->
<select id= "sfcw_select_awardingBody"> </select>
<select id= "sfcw_select_award"> </select>
<select id= "sfcw_select_provider"> </select>
<select id= "sfcw_select_programme"> </select>
<select id= "sfcw_select_delivery"> </select>
</div>

</section>

Customizing Section 2 - Search Results

To custom build the course results section follow these steps:

Inline Search Result Data

The following classes are used to populate html controls such as p, div, span, h2 etc.

Class Description
sfcw-data-resultTotals Search Totals

Shows the total number of courses found. Also used as an activity indicator during a search – ‘searching…’

Search Results in Tables

The following classes are used to populate html tables

Class Description
sfcw-table-results This class must be assigned to <table /> element.

The table must have a <thead /> element with one or more <th /> elements using classes shown below. These elements determine what information is displayed.

A <tbody /> child element must exist for the data.
sfcw-data-referenceCol A column with this class in the <th /> element will show the course Id
sfcw-data-nationalInitiative A column with this class in the <th /> element will show the description of the national initiative
sfcw-data-titleCol A column with this class in the <th /> element will show the course title
sfcw-data-providerCol A column with this class in the <th /> element will show the course provider’s name
sfcw-data-locationCol A column with this class in the <th /> element will show the course location
sfcw-data-dateCol A column with this class in the <th /> element will show the starting date
sfcw-data-categoryCol A column with this class in the <th /> element will show the category the course belong to
sfcw-data-typeCol A column with this class in the <th /> element will show a coloured indicator as to course type

Results Pagination

Search results are displayed in pages of 10, 25 or 50 courses at a time. Controls are provided to navigate from page to page and to change the number of courses displayed at a time.

DOM ID Description
sfcw_div_pages Parent control for page navigation buttons
sfcw_div_perpage Parent control for size of results table

Example HTML

<!--
///////////////////////////
Section 2 - Search Results
Widget was passed nosection2; flag so we can customize
our own here. section 2 contains sfcw_section_results
used for displaying the search result including result
totals, a table for the list of courses, a container for
pagination buttons and a container for page-size buttons.
////////////////////
-->
<section id="sfcw_section_results" style="display: none;">
<!-- legend -->
<div class="sfcw-div-legend">
<table class="sfcw-table-legend">
<tr>
<td class="legend_f fulltime_bck">F = Fulltime</td>
<td class="legend_p parttime_bck">P = Parttime</td>
<td class="legend_o online_bck">O = Online</td>
<td class="legend_e evening_bck">E = Evening</td>
</tr>
</table>
</div>
<!-- search result totals -->
<h2 class="sfcw-data-resultTotals"></h2>
<!-- table for the search results -->
<table class="sfcw-table-results">
<!-- the th elements define which data to show -->
<thead>
<tr>
<th class="sfcw-data-referenceCol"></th>
<th class="sfcw-data-titleCol"></th>
<th class="sfcw-data-providerCol"></th>
<th class="sfcw-data-locationCol"></th>
<th class="sfcw-data-dateCol"></th>
<th class="sfcw-data-categoryCol"></th>
<th class="sfcw-data-typeCol"></th>
</tr>

</thead>
<!-- required by widget -->
<tbody></tbody>
</table>

<!-- container for pagination buttons -->
<div id="sfcw_div_pages"></div>
<!-- container for page-size buttons -->
<div id="sfcw_div_perpage"></div>
</section>

Customizing Section 3 - Course Details

To custom build the course details section follow these steps:

Course Navigation

If the course details section is being used in conjunction with search results then it is possible to have forward, back and close navigation links.

Class Description
sfcw-btn-prev Navigate to previous course in search result

Note: if on the only course or first course then control will be hidden.
sfcw-btn-next Navigate to next course in search result

Note: if on the only course or last course then control will be hidden.
sfcw-btn-close Close (hide) the course details section and show the search results section

Populating Controls with Course Data

The following classes are used to populate html controls such as p, div, span, h2 etc.

Class Description
sfcw-data-courseId The Course ID
sfcw-data-courseTitle Course Title
sfcw-data-courseDescription Course Description
sfcw-data-learnerEducation Entry requirements
sfcw-data-learnerAptitude Entry requirements
sfcw-data-learnerPreviousExperience Entry requirements
sfcw-data-learningOutcomes Learning Outcomes
sfcw-data-furtherDetails Further Details
sfcw-data-targetAwardTitle Final Award Title
sfcw-data-providerName Course Provider Name
sfcw-data-venueName Name of the Course Venue
sfcw-data-address1
sfcw-data-address2
...
sfcw-data-address6
Address of the Course Venue
sfcw-data-providerGps GPS Co-ordinates
sfcw-data-contactName Contact Name
sfcw-data-contactPhone Contact Phone Number

Note: creates a child <a /> element
sfcw-data-contactEmail Contact Email Address

Note: creates a child <a /> element
sfcw-data-contactWeb Contact Website Address

Note: creates a child <a /> element
sfcw-data-mediaP1
sfcw-data-mediaP2
sfcw-data-mediaP3
sfcw-data-mediaP4
sfcw-data-mediaP5
sfcw-data-mediaP6
Media placeholders for images and videos.

Note: these are not populated by default. A custom media js file is required that links media urls to course codes and positions.
sfcw-data-accessAndProgression Course access and progression details
sfcw-data-capacity Course capacity
sfcw-data-courseCode Course Code
sfcw-data-courseFee Course Fee
sfcw-data-deliveryMode Course delivery mode. E.g. Classroom
sfcw-data-delivertTime Delivery time. E.g. Daytime
sfcw-data-delivertType Delivery type. E.g. Fulltime, Parttime
sfcw-data-regFee Registration fee
sfcw-data-hoursPerWeek Hour per week
sfcw-data-tuitionType Type of tuition. E.g. Group
sfcw-data-workPlacementDays Work placement days
sfcw-data-workPlacementWeeks Work placement weeks

Course Data in Tables

The following classes are used to populate html tables.

Class Description
sfcw-table-courseModules Course Modules

Required: assign to <table /> element. <tbody /> child element must exist.

A row with 3 columns is added for each module
  • The module title
  • The award code
  • The awarding body
sfcw-table-dates Course dates and duration

Up to 3 possible rows created each with 2 columns
  • Start Date Row
  • End Date Row
  • Duration Row

2 columns
  • Name
  • Value
sfcw-table-timeTable Timetable

Required: assign to <table /> element. <tbody /> child element must exist.

A row is added for each day of the week with 4 columns
  • Day
  • Tick if morning
  • Tick if afternoon
  • Tick if evening

Course Data in Lists

The following classes are used to populate ul controls with li items.

Class Description
sfcw-ul-providerFacilities Location Facilities

Required: assign to <ul /> element.

Show / Hide Triggers

Some controls can be shown and hidden depending on the specific course data.

Name Type Description
sfcw_section_details Id Must be used as the parent for the entire course details section. Is shown and hidden when navigating to and from the search results screen.
sfcw_section_results Id Must be used as the parent for the entire search results section. Is shown and hidden when navigating to and from the search results screen.
sfcw-el-providerPhoneNumber Class Can be used as parent for Contact Phone Number. Is shown when there is data.
sfcw-el-providerEmailAddress Class Can be used as parent for Contact Email Address. Is shown when there is data.
sfcw-el-providerWebsite Class Can be used as parent for Contact Website Address. Is shown when there is data.
sfcw_div_fees Id When the Course Fee is greater than 0 this field is shown. When 0 it is hidden.

Can be used to display text such as "There may be fees associated with this course. Please check with the course provider"
sfcw_div_furtherDetails Id The Further Details section is hidden if there is no further details text for the course.
sfcw_div_learningOutcomes Id The Learning Outcomes section is hidden if there is no learning outcome text for the course programme.
sfcw_div_timeTable Id Can be used as parent for course timetable.

This is hidden unless it is a parttime or evening course and timetable data is present.

Example HTML

<!--
///////////////////////////
Section 3 - Course Details
Widget was passed nosection3; flag so we can customize our
own here. Section 3 contains sfcw_section_details used for
displaying the details of the selected course. It also
contains navigation controls for walking up and down the
search results list.
////////////////////
-->
<section id="sfcw_section_details" style="display: none;">
<!-- 3 navigation controls -->
<div>
<span style="margin-right: 20px;" class="sfcw-btn-prev">previous</span>
<span style="margin-right: 20px;" class="sfcw-btn-close">close</span>
<span style="margin-right: 20px;" class="sfcw-btn-next">next</span>
</div>

<!-- placeholder for course details -->
<div>
<h2 class="sfcw-data-courseTitle"></h2>
<p class="sfcw-data-courseDescription"></p>
<p class="sfcw-data-accessAndProgression"></p>
<p class="sfcw-data-capacity"></p>
<p class="sfcw-data-courseCode"></p>
<p class="sfcw-data-courseFee"></p>
<p class="sfcw-data-deliveryMode"></p>
<p class="sfcw-data-delivertType"></p>
<p class="sfcw-data-regFee"></p>
<p class="sfcw-data-hoursPerWeek"></p>
<p class="sfcw-data-tuitionType"></p>
<p class="sfcw-data-workPlacementDays"></p>
<p class="sfcw-data-workPlacementHours"></p>
<p class="sfcw-data-learnerEducation"></p>
<p class="sfcw-data-learnerAptitude"></p>
<p class="sfcw-data-learnerPreviousExperience"></p>
<p class="sfcw-data-learningOutcomes"></p>
<p class="sfcw-data-furtherDetails"></p>
<p class="sfcw-data-targetAwardTitle"></p>
<p class="sfcw-data-providerName"></p>
<p class="sfcw-data-address1"></p>
<p class="sfcw-data-address2"></p>
<p class="sfcw-data-address3"></p>
<p class="sfcw-data-address4"></p>
<p class="sfcw-data-address5"></p>
<p class="sfcw-data-address6"></p>
<p class="sfcw-data-providerGps"></p>
<p class="sfcw-data-contactName"></p>

<div>
<p class="sfcw-el-providerPhone">Phone Number</p>
<p class="sfcw-data-contactPhone"></p>
</div>
<div>
<p class="sfcw-el-providerEmail">Email Address</p>
<p class="sfcw-data-contactEmail"></p>
</div>
<div>
<p class="sfcw-el-providerWeb">Website</p>
<p class="sfcw-data-contactWeb"></p>
</div>

<p>Modules</p>
<table class="sfcw-table-courseModules">
<tbody></tbody>
</table>

<p>Dates</p>
<table class="sfcw-table-dates"></table>

<div class="sfcw-el-timeTable">
<p>Timetable</p>
<table class="sfcw-table-timeTable">
<tbody></tbody>
</table>
</div>

<p>Facilities</p>
<ul class="sfcw-ul-providerFacilities"></ul>

<div id="sfcw_div_fees">
<p>Fees</p>
<p>Fees may apply!</p>
</div>

</div>

<div>
<span style="margin-right: 20px;" class="sfcw-btn-prev">previous</span>
<span style="margin-right: 20px;" class="sfcw-btn-close">close</span>
<span style="margin-right: 20px;" class="sfcw-btn-next">next</span>
</div>
</section>

CSS Style Sheet Customization

The widget HTML is organized under the widget placeholder with a class name of sfcw.

The html sections are each assigned a class and id as follows:

Section Class Id
Search sfcw-section-search sfcw_section_search
Overlay sfcw-section-overlay sfcw_section_overlay
Search Results sfcw-section-results sfcw_section_results
Course Details sfcw-section-details sfcw_section_details

Each table has been given their own unique id to aid in CSS precedence.

Section Table Class Id
Search Search Results sfcw-table-results sfcw_table_results
Course Details Course Modules sfcw-table-courseModules sfcw_table_courseModules
Course Details Dates sfcw-table-dates sfcw_table_dates
Course Details Timetable sfcw-table-timeTable sfcw_table_timeTable
Course Details Contact Details sfcw-table-contactInfo sfcw_table_contactInfo

Example: Changing Background and Text Colour

To change the background and foreground colours, the top-level class and some tables need to be altered.

/* Change the top level widget style */
.sfcw { background-color: #0070ba !important; color: #fff; }

/* change the results table content including a elements */
#sfcw_table_results th, #sfcw_table_results td,
#sfcw_table_results td a,
#sfcw_table_results td a:visited,
#sfcw_table_results td a:hover {
color: #fff;
border: none;
}
/* Change the courseModules table content */
#sfcw_table_courseModules th, #sfcw_table_courseModules td {
color: #fff;
border: none;
}

/* Change the navigation links on the course details screen */
.sfcw-div-detailsNav a,
.sfcw-div-detailsNav a:visited,
.sfcw-div-detailsNav a:active,
.sfcw-div-detailsNav a:focus {
color: #fff;
text-decoration: underline;
}

Course Colours

There are pre-defined course colour codes that are picked by delivery type i.e. fulltime, parttime, evening and online. These colours appear in the search results section and the course details section.

Each colour can be used as the foreground text colour or the background colour. The following classes are used

Class
fulltime
parttime
evening
online
fulltime_bck
parttime_bck
evening_bck
online_bck

The widget will assign the appropriate foreground colour to any element with class sfcw-course-colour.

The widget will assign the appropriate background colour to any element with class sfcw-course-colour-bck.

Example: Changing the fulltime course colour to purple

/*
Change the fulltime course colour to purple
*/


/* the general style */
.sfcw .fulltime {
color: purple;
}

/* the more specific styles attached to headings */
.sfcw h1.fulltime, .sfcw h2.fulltime, .sfcw h3.fulltime {
color: purple;
}

/* the general background style */
.sfcw .fulltime_bck {
color: #fff;
background-color: purple;
}

/* the more specific background styles attached to headings */
.sfcw h1.fulltime_bck, .sfcw h2.fulltime_bck, .sfcw h3.fulltime_bck {
color: #fff;
background-color: purple;
}

Implementing the Customization

To instruct the widget to use your css style sheet, pass a url reference to the widget using the data-style-url attribute.

<script src= "https://widget.fetchcourses.ie/sfcw_init" data-providerid ="" data-style-url= "https://www.yourdomain.ie/mystyles.css"> </script>

Image and Video Course Media Customization

Custom images and videos can be embedded in the course details screen.

To include media with your course data follow these steps:

Media Placeholders

The widget HTML contains 6 elements each with a media class reference from the table below.

Class
sfcw-data-mediaP1
sfcw-data-mediaP2
sfcw-data-mediaP3
sfcw-data-mediaP4
sfcw-data-mediaP5
sfcw-data-mediaP6

The widget provides all 6 of these media locations in the course details section. If the HTML of the course details section is being customized then these elements will have to be placed manually (see HTML Customization).

Example

<div class=”sfcw-data-mediaP1”></div>

Custom JS File

In order to instruct the widget about which images to associate with which courses, custom javascript code is required.

The widget is contained in an object called sfcw.widget. The widget contains a public array called Course_Media that can be populated with references to images. The details required for each object entry are:

Member Description Type
courseId The course id String
type The media type: image or video Int
url The URL to the media resource String
position The media placeholder to use Int

The javascript code used to add an entry to the Course_Media array is in the following format:

sfcw.widget.Course_Media.push({ courseId: "", type: 0, url: '', position: 1});

The widget also provides public constant value types that can be used

Example

Supposing the image happy_student.jpg, hosted at www.solas.ie, was to be associated with course id 1000 and to be displayed using media placeholder 1.

The information required is

courseId 1000
type MEDIATYPE_IMAGE
url https://www.solas.ie/happy_student.jpg
position MEDIALOCATION_P1

Create a blank javascript file and enter the following line of code

sfcw.widget.Course_Media.push({ courseId: '1000', type: sfcw.widget.MEDIATYPE_IMAGE, url: 'https://www.solas.ie /happy_student.jpg', position: sfcw.widget.MEDIALOCATION_P1 });

A separate line can be added for each image and video to be included.

Instruction to Widget

The link to the widget should include the data-media-url attribute with the url to the customer js file.

Example:

<script src ="https://widget.fetchcourses.ie/sfcw_init" data-media-url = "https://www.yourdomain.ie/media.js"> </script>

Using Google Maps

The widget can be integrated with Google maps to map course locations. The maps can be integrated with the widget and/or can sit independently on the page.

Course locations are indicated with a Google Pin/Marker. The user can click on the Marker to get further information about the venue and even initiate a new search just for that location.

NOTE: To use Google Maps you require a Google Maps Javascript API Key and to place it in the data-googleapikey attribute when loading the widget. For more information visit Maps Javascript API. For the print feature the key must also be enabled with the Google Static Maps API.

The data-map attribute

Value Description
Integrated This activates two maps in the widget: the Map View of the search results and course location map on the course details page.
Independent This activates one or more maps that are independently positioned on the page.
Both This will activate both types of maps.

Independent Maps

The Independent mode will draw maps on your page wherever a map placeholder is found. There are two types of maps that can be drawn.

Placeholder Class Map Type
sfcw-map-courses A map that shows the locations of all courses for the given provider.
sfcw-map-course-heat A heat map that indicates the quantity of courses on a map.

<script src= "https://widget.fetchcourses.ie/sfcw_init" data-map= "both" data-googleapikey= "<<>>"> </script>

Using Social Media Icons

The widget can display social media icons with each course description. This enables the visitor to share the link to the course information on Facebook, Twitter, Google Plus, Linked-In, Twitter and Pinterest.

Setting up the widget to show social media icons is a 2 step process.

1. Font Awesome CSS

The page hosting the widget needs to include the font awesome CSS used to render the social media icons.

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

2. Widget Flag

Tell the widget to display the social media icons. Do this by adding the socialicons; flag to the data-flags attribute.

<script src= "https://widget.fetchcourses.ie/sfcw_init" data-flags = "socialicons;"> </script>