You could use SimpleSearch and use hooks to do additional searching, or use AdvSearch which is more aimed at custom searches (tho I don't have first hand experience with it, sorry). Both of them are available via package manager and documented at the RTFM.
We actually went with a much simpler approach because this search is limited to documents all within a specific parent document. We created a standard search form and passed the variables onto a search results pages with a getPage/getResources call on it. For the filtering, we used the tvFilters parameter in combination with getUrlParam:
[[!getPage@Directory?
&elementClass=`modSnippet`
&element=`getResources`
&parents=`132`
&limit=`10`
&pageVarKey=`page`
&includeTVs=`1`
&includeContent=`1`
&tvPrefix=``
&tvFilters=`busname==%[[!getUrlParam? &name=`bname` &max=`999`]]%,directorycategories==%[[!getUrlParam? &name=`category` &max=`999`]]%,directoryproperties==%[[!getUrlParam? &name=`properties` &max=`999`]]%`
&tpl=`directorymemberTPL`
]]
A user can input one or a combination of search fields and it works wonderfully.
-
- 1 Posts
I am trying to do it like rx2 above but having issue with getUrlParam not returning value when inside getPage snippet call (or is it an issue w/ getResources ?).
Weird because I swear rx2's snippet works when used with a raw value supplied in tvFilters and I have verified my getUrlParam returned correct value when used in isolation.
My snippet call
[[!getPage@Directory?
&elementClass=`modSnippet`
&element=`getResources`
&parents=`8,9` &depth=`2`
&limit=`10` &tvPrefix=``
&pageVarKey=`page`
&includeTVs=`1`
&includeContent=`1`
&tvFilters=`locationTV==[[!getUrlParam? &name=`location` &max=`999`]]` &tpl=`eachListingTpl`
]]
Any input would be appreciated, thanks.
You want something. Go Get it. Period.