gemwebsolutions.com
Quickstart Guide...
How to Install
How to Upgrade
Admin Menu
General Settings
User Accounts
Section Editor (List)
Add New Editor
Section Editor (Edit)
Field Editor
Text Field
Text Box
Wysiwyg
Date/Time
List
Checkbox
Upload
Separator
Regional Settings
Code Generator
Show Code
Viewers
Viewer Options
Displaying Uploads
Search Engines
Advanced Topics
In-Depth Getting Started Guide
Working With Generated Code Guide
Using SlideShowPro With CMS Builder
Special Fieldnames
Changing and Removing File Extensions
Creating an RSS Feed
View Changelog »
Glossary
Need Help? Questions?
Post in forum »

Viewer Search Engines

CMS Builder makes it easy to quickly create custom search engines.

Search Field Format
You create a basic search engine by entering the name of the field you want to search followed by the type of search you want to do, then adding that to the url or search form.

Format Search Type Notes
fieldname Exact match
fieldname_match Exact match
fieldname_keyword Contains keyword
fieldname_prefix Starts with Starts with keyword (or letter) (since v1.21)
fieldname_query Matches query Allows google-style query searches such as: +dog -cat "multi word phrase". Only records matching EVERY word or quoted phrase are returned. Words or phrases that start with - mean "must not match". Plus is optional and not required. (since v1.11)
fieldname_min Minimum value For numeric searches
fieldname_max Maximum value For numeric searches
fieldname_year Year number For date searches (since v1.08)
fieldname_month Month number For date searches (since v1.08)
fieldname_day Day of month For date searches (since v1.08)

Tip: You can combine date searches with other types of searches. For example 'articleList.php?date_year_min=2005' would show all articles with a date of 2005 or later.
Basic Url Search
You can create a special link that only lists specific records. Just add a ("?") after your url, following by the search conditions (fieldname=value).

Example: listViewer.php?color=blue
Multiple search conditions can be combined with ("&").

Example: listViewer.php?color=blue&size=XXL
Note that if 'where' clause is specified in the list options then any form field keywords will be ignored.

Tip: When hand-coding urls non-alphanumeric characters need to be encoded so browsers understand them (like this: %21%22). This is called 'url encoding'. You may have seen it before when doing a Google search. If your search value isn't working, try encoding the value below before copying it into the url.

Multi-field Search
You can search multiple fields just as easy as one field. Just create a comma seperated list of fields followed by the search prefix.

Example: articleList.php?title,summary,content_keyword=Vancouver
Custom Search Forms
You can create search forms by naming the fields after what you want them to search. Here is a simple search form that searches the "title" field for a keyword.

<form method="POST" action="/path/to/your/listViewer.php">
  <input type="text" name="title_keyword" value="">
  <input type="submit" name="submit" value="Search">
</form>
SEO Search Urls (Advanced)
Many servers support having extra "Path Info" after the url like this: "viewer.php/size-3/". This makes it appear as if a page or directory exists even if it doesn't and is great for search engine optimization.

The format is the same as for "Basic Url Searches" except instead of = you use - and instead of & you use /. Here's the same example as above:

Example: listViewer.php/color-blue/size-XXL/
The quickest way to determine if your server support "Path Info" searches is to try one. Servers that don't support it will give a not found or other error message.
MySql WHERE Searches (advanced)
If you are comfortable with MySql you can specify a custom MySql WHERE clause in List Viewer options. Note that any form field keywords will be ignored if a 'where' option is specified. Example:

Example: 'where' => 'price >= 250000 AND bedrooms = 2',
Copyright © 1999-2008 gemwebsolutions.com, inc.