Search Results
Installation
For 1.6.x
You install the Search Results module with the standard Expression Engine 1.6.x method.
- Download your copy of the plugin.
- Extract the folder and files from the archived (zipped) file.
- Upload the key_search folder to the modules folder inside your system directory.
- Upload language/english/lang.key_search.php to:
- Navigate to CP Home | Modules, find the Key Search module and click Install.
/YOUR SYSTEM DIRECTORY/modules/
/YOUR SYSTEM DIRECTORY/language/english/
For 2.x
You install the Search Results module with the standard Expression Engine 2 method.
- Download your copy of the plugin.
- Extract the folder and files from the archived (zipped) file.
- Copy the entire folder (key_search) to your third_party folder located at:
/YOUR SYSTEM DIRECTORY/expressionengine/third_party/
Using the Template Tags
Search Input
This version of the module uses the result sets produced by the default search module (simple and advanced search forms) that ships with ExpressionEngine. Simply follow the ExpressionEngine 2.x User Guide to configure your search tags in the templates.
Embedding search results in templates
Result sets can be embedded into templates with a simple tag pair:{exp:key_search:results parameters=”values”}
HTML and EE field tags
{/exp:key_search:results}
Parameters
The following parameters are available to use in the primary tag pair to configure the way the records are returned to the template.| Parameter | Data Type | Description | Default Value |
|---|---|---|---|
| switch | any string | Allows you to set two or more values that will alternate between the result set rows | NULL |
| groupby | field name | Allows you to set a result set field to group the row. | NULL |
| group_repeat | "yes" or "no" | Directs the group field to repeat or not | yes |
| group_sort | "desc","asc" | Sets the sort order of the groupby field. Desc sorts the groups in a descending alphanumeric order. Asc sorts the groups in an ascending alphanumeric order.Products | asc |
| limit | integer | Limits the rows returned to the number set in this parameter. | no limit |
| orderby | field name | Sorts the result set rows (within a group) by a designated field | entry_id |
| sort | "desc","asc","rand" | Sets the sort order to be ascending or descending within a group. Desc sorts the records in a descending alphanumeric order. Asc sorts the records in an ascending alphanumeric order. Rand sorts the records in a random order. | desc |
| excerpt_size | integer | The number of words generated by the excerpt tag. | 50 |
| page_size | integer | The number of records to list on a page. Result sets larger than the page_size will be paged. |
Variables
All relevant channel entry tags are available to use between the primary tag pair. This you can also use the following variable tags:
| Tag | Description |
|---|---|
| switch | This variable is replaced by alternating values specified in the switch= parameter. A good way to use this tag is to alternate class names of HTML tags to style alternating rows to be more clear in the user interface. |
| auto_path | This parameter is replaced with the URL to the entry with the URL Title appended to the end. The path will automatically be determined by the Channel URL setting for the channel in Channel Management. |
| excerpt | An excerpt from the returned entry truncated to the number of words specified in the excerpt_size= parameter. The field specified for the excerpt is selected in the Channel Management settings for the channels. HTML markup is stripped prior to output. The tag adds an ellipse at the end of the excerpt. |
| read_more | This variable is replaced with a hyperlink to the entry permalink |
All ExpressionEngine conditional statements work within the primary tag pair.
A single variable tag is available to be used anywhere on a results page:
{exp:key_search:referring_page}
This tag returns a URI string that can be use in a link tag HREF parameter.
Other Features
Search terms are surrounded with <span class="terms"> and </span> tags. You can easily style the search terms by using the "terms" class in your stylesheets.
Example Use Case
{exp:key_search:results groupby="channel" group_sort="asc" group_repeat="no" size="60"}
<h4>{group}</h4>
<div class="result">
<a href="{auto_path}">{title}</a>
{excerpt}
{author}
{read-more}
</div>
{/exp:key_search:results}
How to get help
We want to you get the most out of this plugin so please contact us if you need help. Please send us your question at support@planet-ee.com