Skip to content

Commit

Permalink
Merge pull request #13 from PlasticStudio/feature/sort_order
Browse files Browse the repository at this point in the history
Update readme around sorts and defaults
  • Loading branch information
monkeyfeet committed Mar 25, 2021
2 parents 68818fe + 2ab6b5e commit ca35d29
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ The built-in SilverStripe search form is a very simple search engine. This plugi
* `JoinTables`: associative list of relationship mappings (use the `key` from the `types` array)
* `Table`: relational join table
* `Column`: column to join by
* `sorts`: associative list of sort options (if `sorts` are not defined, results will be sorted by default to `Title ASC`)
* `sorts`: associative list of sort options. These are used to popoulate a "Sort by" dropdown field in the Advanced Search Form. Sort order of search results will default to the top item in this list.
* `Label`: front-end field label
* `Sort`: SQL sort string
* `defaults`: Default attributes or settings, as opposed to those submitted through the search form (currently only configured to use `sort`).
* `submit_button_text`: Text to use on search form submit button (defaults to "Search")

TODO: `defaults`: Default attributes or settings, as opposed to those submitted through the search form.


# Example configuration

Expand Down Expand Up @@ -112,7 +113,8 @@ PlasticStudio\Search\SearchPageController:
published_desc:
Label: 'Publish date (oldest first)'
Sort: 'DatePublished ASC'
defaults:
sort: 'Title ASC'
submit_button_text: 'Go'
## TODO:
## defaults:
## sort: 'Title ASC'
```

0 comments on commit ca35d29

Please sign in to comment.