0

I'll try to explain this as simply as possible...

I'm using the Views Datasource plugin to create a JSON view to output a restaurant list.

We need to be able to filter the list via several fields - We'll just use "Cuisine" as an example.

I setup a contextual filter and when I browse to the view with "/sushi" at the end of the URL, I get only the results with Sushi in the Cuisine field. This is working correctly.

However, the Cuisine field can hold several types, such as "asian," or "carryout," or whatever.

Now, when I select "Allow multiple values," I SHOULD be able to browse to the view with "/sushi+asian" and get anything with either Sushi or Asian in the cuisine.

Instead, I get NO results.

I'm running out of hair to pull out - Anyone got any ideas? I'm at a total loss.

-- UPDATE --

Here's some SQL Query stuff - I've stripped everything but the WHERE clause as this is the only place where anything changes.

### WITHOUT MULTIPLE VALUES CHECKED ###

// Ran "/restaurants/all/$/all"
WHERE (( (field_data_field_price_0.field_price_0_value = '$' ) )AND(( (node.status = '1') AND (node.type IN  ('franchise')) )))

// Ran "restaurants/all/$+$$/all"
WHERE (( (field_data_field_price_0.field_price_0_value = '$+$$' ) )AND(( (node.status = '1') AND (node.type IN  ('franchise')) )))

### WITH MULTIPLE VALUES CHECKED ###

// Ran "restaurants/all/$/all"
WHERE (( (field_data_field_price_0.field_price_0_value = '$' ) )AND(( (node.status = '1') AND (node.type IN  ('franchise')) )))

// Ran "restaurants/all/$+$$/all"
WHERE (( (field_data_field_price_0.field_price_0_value = '$+$$' ) )AND(( (node.status = '1') AND (node.type IN  ('franchise')) )))

Obviously the query isn't changing regardless of whether I tell it to allow multiple values - How do I get this to take values separated by a + and make them ('$', '$$')?

1

Try using commas instead of plus signs, i.e. sushi,asian,italian since some apache configs do not support plus signs. Slashes should only be used between different contextual filters like cuisine and street, etc.

Also, make sure to check that the operator between filters is set to and not or. hth.

0

Instead of /sushi+asian use a / to separate your arguments /sushi/asian

  • I seem to recall having some success with that before (I apparently can't remote into my work computer right now to confirm, though ><) - However, I'm trying to use three different filters (cuisine/price/keywords, respectively) I tried doing "asian/sushi+all+all" and this wasn't working for me either. Nor was "asian+sushi/all/all" – Ryan Jul 4 '12 at 4:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.