Skip to main content

Search

The search functionality is fairly simple and handled by searchContent() in the base TfSearchContent 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

TfSearchContent allows a limit and offset and the search type to be specified for search results using setLimit(int $limit) and setOffset(int $offset). If not specified the default limit is that set in the Search pagination of site preferences and the default operator is AND.

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 escaped for use in the database query through use of prepared statements with named placeholders / bound values. 

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.