I’m using simplesearch to search the event resources. However, I only want events that are still upcoming and not displaying events with a date less than the current date. The TV to check is [[*event-date]].
I presume I need to use a custom hook for it but not sure how to start.
Current snippet calls are:
I could be wrong, but I don’t think there is an easy way with SimpleSearch to filter the search.
The easiest way is probably to write a custom snippet for the &exclude property that creates a list of IDs of events that already took place.
There are also postHooks in SimpleSearch, but you basically have to write the whole query yourself. So it may be easier to just use pdoResources/pdoPage for the search instead, and create a custom snippet for the &where property.
You could also create your own driver class by copying and adjusting the class SimpleSearchDriverBasic. Then change the system settings simplesearch.driver_class and simplesearch.driver_class_path to use your custom driver.
What do you mean by “use pdoResources/pdoPage for the search instead”?
How would I use pdotools to do the search? Can I call SimpleSearch via PdoTools?
Depending on your use case, something like this might be a viable replacement for SimpleSearch and is probably easier to implement than a custom postHook.