开发者

A way to limit taxonomy exposed filter options in view with arguments in drupal

开发者 https://www.devze.com 2023-02-24 02:49 出处:网络
I\'m building a product catalog where a particular secti开发者_高级运维on is displayed by views with an argument, a taxonomy id of a section.

I'm building a product catalog where a particular secti开发者_高级运维on is displayed by views with an argument, a taxonomy id of a section.

But I also need to give user the ability to further narrow down the search by specifying the producer by choosing term in another vocabulary in the exposed filter.

I'm trying to limit the selection to terms for which nodes in a chosen section exist. Looks like the views_selective_filter and view_hacks are especially for that, but looks like out of the box neither of them takes into account the view argument. Is there a remedy or workaround?


Use Firebug or the devel_themer module to find the form ID of the form displaying those terms, then use a hook_form_alter in a custom module to intercept, and modify that form.


In the end I used views_taxonomy_selective_filter. I had to patch views module as I described in the comment in order to make it generate select options after processing arguments.

0

精彩评论

暂无评论...
验证码 换一张
取 消