how to make a search in modx ??
thanks
Hi Bruno,
I've been following some of your previous posts on this - and noticed your separate posts of your custom driver and also filterresources snippet. We're using simple search to search all articles on a website - it works well, including the TV values. We need to extend this so that - rather than searching a keyword through all articles posted - the user is presented with a predefined list of the the TVs, their value options with multi-select checkboxes in addition to the simpleSearchForm box. So when the simpleSearchForm is submitted, the search searches for the keyword only in articles which have one or more of the checked TV values.
Any thoughts greatly appreciated.
reading the documentation, there are the properties ids and idType.
So you can prefilter the ids, which match the checkbox-selectons, put that result into a placeholder as commaseparated list of ids and use
&ids=`[[+selected_resources]]`
&idType=`children`
with the simpleSearch - snippet - call
Nice one, Bruno. We'll give it a try.
And we failed. I've no idea how to output the +selected_resources. We have bunch of pages created in articles. All of them have TVs assigned - Location (USA, UK, France, Sector (Automotive, Aeronautical) for example.
For browsing the TVs - location/sectors, we've successfully employed Taglister to retrieve a list of all pages tagged "France" or Automotive". This is limited to pages created within Articles. Separately, we've successfully used SimpleSearch and SimpleSearchForm to search all article resources with a specific keyword. What we want to do now is allow the use to tick "UK, "USA" and "Aeronautical" in a form, also being able to search using a keyword. So a user might want to search any of the Articles pages' content for the word "defence" but limit the resources searched to those tagged via the Tvs with "USA" and "UK" for location and "Aeronautical" for sector.
I'm presuming that we need to create a snippet to get the page ids of all the resources tagged with any of the values submitted in the form, then set those to the [[+selected_resources]] placeholder mentioned by Bruno. Thanks in advance for any pointers.