To include SiteSearch into your web site, include the box sitesearch/search via one of the following methods:
- Include this tag in your templates: <xt:box name="sitesearch/search" />
- Provide a link to this URL: http://www.example.com/index/sitesearch-app
- Create a page that is an alias to the path: /index/sitesearch-app
Box Include Parameters
SiteSearch allows you to customize the search form presented with the following list of optional parameters:
| Parameter Name | Description |
| ctype | This contains either a comma-separated list of collection types to search, or it can be presented as an array of collection types to search, or even just a single collection type. This allows you to focus your search on a single or combination of multiple data types. |
| show_types | If this is set to "yes", it will display a select box of collections that the search can be limited to, defaulting to "All Types". |
| multiple | If this is set to "yes", the select box displayed when show_types is also "yes" will render as a multiple-selection select box. This gives users even more power in selecting combinations of data types, but takes up extra vertical space, and may be overkill depending on the intended audience. |
Parameters can be passed through the URL, or in your box call. For example:
http://www.example.com/index/sitesearch-app?ctype=sitellite_news
And similarly:
<xt:box name="sitesearch/search" ctype="sitellite_news" />
Result Highlighting
In order for the search result highlighting to appear on pages once they've been clicked on from the search result screen, the following CSS needs to be present in your site.css file:
span.highlighted {
color: #ff0;
padding: 2px;
padding-bottom: 0px;
}
This will create a yellow background behind the highlighted search terms within the body of a page, a news story, a forum posting, or other data types and apps that support SiteSearch term highlighting.
Next: XML-RPC interface
Revised on August 1, 2007 1:27 PM by lux
Back in time (4 more) | Linked from: Site Search, Site Search Indexer