Search

5 February 2018 | 10 views | Tags: Documentation

The search functionality is fairly simple and handled by searchContent() in the base TfishContentHandler class. Search functionality is offered on search.php and also on error.php which is the custom 404 error page.

If multiple search terms are entered a drop down allows the results to be filtered by:

  • All (AND)
  • Any (OR)
  • Exact match

searchContent() allows a limit and offset to be passed in as parameters. The default number of results returned (limit) is set by Search pagination in site preferences, but it can be overriden.

Search terms are subject to a minimum length check, which is set by Min. search length in site preferences. Search terms that are shorter than the minimum length requirements (default value 3) are discarded, to prevent overloading the system.

Search terms are trimmed then passed in directly to searchContent(). Escaping is handled through use of prepared statements with named placeholders. 

Copyright, all rights reserved.

Related

Tuskfish CMS Developer Guide

This guide will give you an overview of the architecture of Tuskfish CMS, how to write code to perform common operations and how to extend the system to suit yourself. The guide accompanies the Tuskfish API documentation. Keep a copy handy as you read this guide. It is best to review links to the API where provided, as not every detail will be discussed in the text. This is the first version of the guide, so it is still a work in progress.