(This is a cross post from the web team blog. The original can be read and commented on at http://blogs.city.ac.uk/web/2013/02/12/funnelback-widgets-how-they-work)
On www.city.ac.uk many pages have a sidebar which can be populated with various “widgets” in the editing environment. Editors can add widgets from a list of options:
- Free text
- Free text (2)
- Call to action
The widgets are built behind the scenes in different ways, the ones in italics above are all similar in that they use Funnelback (our search engine) queries to generate the list of items (news, events, courses, etc.)
When you add one of these widgets to a page you will have options to determine which items should be included in the widget.
The news and events widgets share the same search criteria options, while the course widget is slightly different. The options available in the first group are:
- Related Courses
- This Course
All the criteria are in respect to the current pages’ metadata, so choosing school will search for (for example) news items which have the same school metadata value as the current page. A page which is given the value School of Arts in it’s school metadata field with an events widget set up to match on school will bring back any events which also have a value of School of Arts in their metadata.
The same direct matching of metadata applies to the other options, apart from This Course, which only makes sense on a course page. When this is used for a widget on a course page it will bring back any (again, for example) news items which have been setup with the course page as a related course.
The course widget has fewer options, but they work in exactly the same way as above. The courses explicitly related option will only bring back the courses that have been chosen as the related courses of the page on which the widget is being added.
It gets a bit more complicated when you choose more than one search criteria. And again the course widget works slightly differently in this regard.
When you choose more than one option for the news or events widget any of the chosen criteria is used to match an item (logical OR for the geeks). This means if you choose school and related courses together then any (e.g.) news items which have the same school will be returned along with any that have any the related courses in their list of related courses regardless of the school metadata.
With the course widget the options can’t be combined, the widget will only allow one criteria choice.