简体   繁体   English

用于分类法的高级Drupal View过滤器

[英]Advanced Drupal View filter for taxonomy

I have a content type called product-templates. 我有一个称为产品模板的内容类型。 In this content I capture the following fields: Title (core), content body, taxonomy term reference, and 6 different file types. 在本内容中,我捕获了以下字段:标题(核心),内容主体,分类术语参考和6种不同的文件类型。 A new product-template content is created for each template we have. 将为我们拥有的每个模板创建一个新的产品模板内容。 So let's say our products are widgets, broken down by color.. blue, black, brown, pink, green, etc... 假设我们的产品是按颜色细分的小部件。..蓝色,黑色,棕色,粉红色,绿色等。

The taxonomy has the primary product template categories, for example: blue widgets, black widgets, etc.. Each will have multiple templates for the different sizes, so the term will reference size/style, widget small, medium, large, square, round, etc. 该分类法具有主要的产品模板类别,例如:蓝色小部件,黑色小部件等。每个小部件将具有用于不同大小的多个模板,因此该术语将引用尺寸/样式,小,中,大,正方形,圆形的小部件。等

Using the default taxonomy override that comes with views taxonomy/term/% and limiting the filter to product-templates and using fields, rather than full content I get a list something like this: blue-widget small -> template b1s, template b2s, template b3s… / blue-wiget medium -> template b1m, template b2m, and so on. 使用视图分类法/术语/%随附的默认分类法替代,并将过滤器限制为产品模板并使用字段,而不是全部内容,我得到的列表如下:blue-widget small-> template b1s,template b2s,模板b3s…/蓝色假发媒介->模板b1m,模板b2m等。 So what I end up with is a full listing on all the product templates with their associated template files. 因此,我最后得到的是所有产品模板及其相关模板文件的完整清单。

What I would like to have happen is that when the visitor is on taxonomy/term/% they are presented with a drop down or jump menu that shows the different options, then when they click on (for example) blue-widget small the associated templates render/populate on the page. 我想发生的事情是,当访问者使用分类法/术语/%时,他们会看到一个下拉菜单或跳转菜单,其中显示了不同的选项,然后当他们单击(例如)蓝色小组件时,模板在页面上呈现/填充。 So basically I want to remove the listing and turn it into a selectable area. 所以基本上我想删除该列表并将其变成一个可选区域。 Since there could be a large number of options/sizes I don't want to have a list that goes 20 scrolls, and I don't want to have to use a pager. 由于可能有大量的选项/尺寸,所以我不想有20个滚动条的列表,也不想使用寻呼机。 It seem more logical to present them a drop down list that has all the options/sizes they select the one they want and then just those templates pull up. 向他们显示一个下拉列表似乎更合乎逻辑,该列表具有他们选择所需的所有选项/大小,然后仅将这些模板上拉。

Any suggestions on how this would be accomplished? 关于如何实现的任何建议?

You should be able to accomplish this by adding filter to the view which is taxonomy term, then set it to exposed and use the following url to access all documents. 您应该能够通过将过滤器添加到作为分类术语的视图中,然后将其设置为公开并使用以下URL来访问所有文档来完成此操作。

taxonomy/term/all (this should display all documents) 分类/术语/全部(应显示所有文档)

This will mean that it is applied for all vocabularies, so not a problem if you only have one. 这意味着它将适用于所有词汇表,因此如果您只有一个词汇表就不会有问题。

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

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