wamp
wamp

Reputation: 5949

How to add a conditional filter for drupal's view?

Only apply the filter when there is filter=1 in the query string,

has anyone managed to do this kind of conditional filter with drupal?

Upvotes: 1

Views: 1490

Answers (1)

Vinicius Braz Pinto
Vinicius Braz Pinto

Reputation: 8289

For some reason I think there's something wrong with your approach, but since there's no specifics, I can't really give my opinion.

Answering your question: you can try implementing hook_views_query_alter(), testing if the parameter filter equals 1 and, if so, removing the condition added by the filter.

Upvotes: 1

Related Questions