This is an old revision of the document!
Table of Contents
Building a Recommendations Module
IMPORTANT: This is a new feature that was introduced after the release of VuFind 1.0RC2. In order to take advantage of it, you will need to download a version of the trunk code at r2033 or later.
What is a recommendations module?
Sometimes it is useful to make suggestions to a user based on their search terms. Depending on the type of search performed, the best recommendations may vary. For example, you may wish to suggest popular author names based on an author search, or common subject headings based on a subject search. The recommendations module system allows custom code to be easily dropped in place so that you can display custom messages for any search type.
How does it work?
To create a recommendations module, follow these steps:
- Look at the interface specification in web/sys/Recommend/Interface.php. You will need to build a class based on this interface. The existing modules in web/sys/Recommend provide examples of how this may be done.
- Create templates to accompany your new class. These will be dynamically loaded into the search results screen. Some examples can be found in the Search/Recommend folder under both the classic and default themes.
- Once your module is built, you can turn it on by editing web/conf/searches.ini – see the comments above the [Recommendations] section of the file for details.