Skip to content

Commit

Permalink
Updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
zanderwar committed Feb 14, 2018
1 parent 8f52542 commit 3bacef1
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## silverstripe-search
This module is a full text search replacement concept for SilverStripe that enables the use of tanks
This module is a single-line search replacement concept for SilverStripe that enables the use of tanks

![Preview](docs/images/example.jpg)

Expand Down Expand Up @@ -30,10 +30,6 @@ class Recipe extends DataObject
// this is optional and will default to "Main" if not provided
private static $search_tank = 'Recipes'

// The search filter name is used when displaying the filter map on the front end
// if not provided, it will default to the static class name
private static $search_filter_name = 'Recipes';

private static $db = [
'Title' => 'Varchar(255)',
'Content' => 'HTMLText',
Expand Down Expand Up @@ -87,7 +83,16 @@ This would ensure all records within that DataObject are stored under a custom t

This module ships within a default [SearchPage](src/Pages/SearchPage.php) page type. The provided template is for example only and you should create your own override for it.

## Result Item Rendering
## Renaming the filter title
If you want to change the name that appears for the search filter you will need to add the following to your DataObject/Page:

```
private static $singular_name = 'Instruction';
private static $plural_name = 'Instructions';
```


## Result item rendering
You may want to render your results differently based on what classes they represent (as in the preview image above).

In order to do this for the above `Recipe` class you must create the following folder structure in your theme directory:
Expand Down

0 comments on commit 3bacef1

Please sign in to comment.