简体   繁体   中英

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. 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. 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. 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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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