一种通过 drupal 中的参数限制分类法公开过滤器选项的方法
我正在构建一个产品目录,其中特定部分由带有参数(部分的分类 ID)的视图显示。
但我还需要让用户能够通过在公开的过滤器中选择另一个词汇中的术语来指定生产者,从而进一步缩小搜索范围。
我试图将选择限制为所选部分中存在的节点的术语。看起来views_selective_filter和view_hacks特别适合这一点,但看起来开箱即用,它们都没有考虑视图参数。有补救措施或解决方法吗?
I'm building a product catalog where a particular section 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?
使用 Firebug 或 devel_themer 模块查找显示这些术语的表单的表单 ID,然后使用自定义模块中的 hook_form_alter 来拦截并修改该表单。
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.