SiteSearch

Adds global search capabilities to October CMS

Back to SiteSearch Support

tobias7884
tobias7884

Hello I have some problems using SiteSearch plugin.

  1. When the search form is submitted without entering any query in the search field, thus an empty ?q= parameter is submitted, I get an unhandled error: "The query field is required.(vendor/october/rain/src/Database/Traits/Validation.php line 340)" instead of displaying the noResultsMessage. Any idea what could cause it ?

  2. On the SERP page I get only an output of {{ result.excerpt | raw }} from default content of the rainlab.pages, not from custom backend fields (in my case repeater fields), is there any possibility to change it ?

Last updated

OFFLINE
OFFLINE

Hello

  1. This is a bug with the query log, I have released a bugfix for this, thanks!
  2. For the pages plugin the rendered markup is used as the excerpt. If your custom fields are not part of this markup they won't be displayed:

https://github.com/OFFLINE-GmbH/oc-site-search-plugin/blob/develop/classes/providers/RainlabPagesResultsProvider.php#L36

Last updated

tobias7884
tobias7884

Thank you for the fast reply and fix ! In respect to #2. I am going to overwrite/extend the plugin with my own 'RainlabPagesResultsProvider' that puts out an excerpt created from viewBag in case a result is found and $result->text = $page->parsedMarkup; is empty. But there is one problem, maybe you can give me a hint. When I load my own Provider with the offline.sitesearch.extend-function I have RainlabPagesResultsProvider which results in a double result because now there are two 'RainlabPagesResultsProvider'. How could I overwrite the class in my plugin so that only my own updated 'RainlabPagesResultsProvider' is used ? Unfortunately I found no appropriate solution.

Last updated

1-3 of 3