Views: how to make an OR condition between filters and contextual filters I have been able to separate Views filters into groups and apply an OR condition, following this article: http://www.webomelette.com/drupal-views-filters-and-or-logic

I also understand how to use the hook_views_query_alter() to make a few contextual filters act with an OR statement between each contextual filter.

What I can't figure out is this: how do I make the conditional between the REGULAR filters and the CONTEXTUAL filters? After altering the query, this is what I've able to create:

WHERE 
(
  ( (og_membership_node.gid = '8' ) 
    AND (node.status = '1') 
    AND (node.type IN  ('event')) 
    AND (field_data_field_event_type.field_event_type_tid = '12') 
  )
  AND(
  ( (node.status = '1') 
     AND (node.type IN  ('event')) 
     AND (field_data_field_event_type2.field_event_type_tid IN  ('11', '10')) )
  )
)


and I want it to be:

WHERE 
(
  ( (og_membership_node.gid = '8' ) 
    AND (node.status = '1') 
    AND (node.type IN  ('event')) 
    AND (field_data_field_event_type.field_event_type_tid = '12') 
  )
  OR(
  ( (node.status = '1') 
     AND (node.type IN  ('event')) 
     AND (field_data_field_event_type2.field_event_type_tid IN  ('11', '10')) )
  )
)


To give some background of what I am trying to do: I am using Organic groups, and I want my view to show events, Global, Regional and Chapter events. However, if the event is of type Chapter, I want to only show Chapter events which are in the same group as the page content.

I had manually edited the query to move the regular filters associated with the Chapter filter into the contextual filter group, with this:

foreach($query-&gt;where[1]['conditions'] as $condition) {
  $query-&gt;where[0]['conditions'][] = $condition;
}
unset($query-&gt;where[1]);
There is a module for that (albeit a sandbox module). Download Views arguments in filters. As it is a sandbox module you will have to use git.

With this module you add your contextual filter as a global null contextual filter. Then in your normal filter's section, you refer to your contextual filter via the format %N (%1 etc). In this way you bring your contextual filter down to the normal filter section in views, and you can now apply the conditional clauses there, as well as the other filter logic.