I've got an advanced search form which culminates in:
craft.entries.section('whatsOn').relatedTo(
'and',
{ element: artCategories },
{ element: locationCategories },
{ element: bbfcCategories }
).search(searchTerm).order('score').limit(8)
This works, but only if the item being searched for has populated artCategories, locationCategories, and bbfcCategories.
Any of those are optional; i.e., the bbfcCategories line may not be needed at all... and likewise the searchTerm - is there a way to do this dynamically?
craft.request.getQuery()and accessing it's parameterquery.art(I haven't seen this method before). DoesgetQueryString()do the same thing? – Rob Jan 19 '16 at 20:27getQueryString()returns the complete query string andgetQuery()(without a param) returns the query string converted to an array. – carlcs Jan 19 '16 at 21:13