简体   繁体   English

一种限制分类法的方法在drupal中使用参数在视图中公开了过滤器选项

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

I'm building a product catalog where a particular section is displayed by views with an argument, a taxonomy id of a section. 我正在构建一个产品目录,其中特定部分由带有参数的视图显示,该部分的分类ID。

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. 看起来像views_selective_filter和view_hacks特别适用于此,但看起来开箱即用,他们都没有考虑视图参数。 Is there a remedy or workaround? 有补救措施或解决方法吗?

使用Firebug或devel_themer模块查找显示这些术语的表单的表单ID,然后使用自定义模块中的hook_form_alter拦截并修改该表单。

In the end I used views_taxonomy_selective_filter. 最后我使用了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. 我必须按照我在评论中描述的方式修补视图模块,以便在处理参数后生成选择选项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM