On my current setup I'm exposing a view that outputs json through a service.
The view can be called like this: http://domain.com/api/books.json
.
I also exposed a filter to a referenced content type "Author". I'm NOT using context filters
, I'm using the regular Filters
and exposed that particular filter to the user, this way I can give my filter a nice argument name author_nid
.
So now I can call this: http://domain.com/api/books.json?author_nid=38
. And this returns all books of the author with that nid.
But I can't seem to figure out how to get the list of books of both author 38 or author 32.
The things i tried:
http://domain.com/api/books.json?author_nid=38,32
http://domain.com/api/books.json?author_nid=38+32
http://domain.com/api/books.json?author_nid[]=38,32
http://domain.com/api/books.json?author_nid[]=38+32
http://domain.com/api/books.json?author_nid[0]=38&author_nid[1]=32
I seem to have the feeling that this isn't supported right now. Am I correct? If so, what are my options? I'd like to give my arguments a name because I'm about to expose 10 to 15 filters (some optional, others required). Using context filters and filtering like this: args[]=2&args[]=43,23&args[]=44
isn't very readable/maintainable.
hook_views_query_alter
.