Skip to content

Commit ec30d42

Browse files
committed
TASK: Document AJAX search controller
1 parent 2c29ac6 commit ec30d42

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,13 @@ These can be used to provide autocompletion on the search input using a JS libra
3636
In case you need to build the URI to the suggest controller yourself, this is what the form uses:
3737

3838
{f:uri.action(action: 'index', controller: 'Suggest', package: 'Flowpack.SearchPlugin', format: 'json', absolute: 1)}
39+
40+
## AJAX search
41+
42+
The plugin comes with a controller that can be reached like this per default, using `GET`:
43+
44+
{f:uri.action(action: 'index', controller: 'AjaxSearch', package: 'Flowpack.SearchPlugin', absolute: 1)}
45+
46+
It expects the search term as a parameter named `q` (as defined in `AjaxSearch.ts2`). This controller
47+
renders the search results and returns them as HTML without any of the page template. It can therefore
48+
be used to request search results via AJAX and display the result by adding it to the DOM as needed.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
prototype(Flowpack.SearchPlugin:AjaxSearch) < prototype(TYPO3.TypoScript:Template) {
22
templatePath = 'resource://Flowpack.SearchPlugin/Private/Templates/NodeTypes/AjaxSearch.html'
33
searchResultRenderer = Flowpack.SearchPlugin:SearchResultRenderer {
4-
@override.searchResults = ${Search.query(site).fulltext(request.arguments.q).execute()}
4+
@context.searchResults = ${Search.query(site).fulltext(request.arguments.q).execute()}
55
}
66
}

0 commit comments

Comments
 (0)