4

image Hi, I want to create a drupal view that display as the uploaded image. There are two select list. First select list is static. According to the selected category sub category should by populated. All categories and subcategories are stored as taxonomy term. Any idea would be appeciated.

0

2 Answers 2

2

Your usage of the word "view" and the tag in your question is misleading, since IMO your question is not about the Views module.

As an alternative to using taxonomy terms, you should give it some thought to rework what you're trying to do using regular fields. By doing so, you can use the Conditional Fields module to achieve your goal. Excerpt from the Conditional Fields project page:

Conditional Fields allows you to manage sets of dependencies between fields. When a field is “dependent”, it will only be available for editing and displayed if the state of the “dependee” field matches the right condition.

When editing a node (or any other entity type that supports fields, like users and categories), the dependent fields are dynamically modified with the States API.

You can, for example, define a custom “Article teaser" field that is shown only if a "Has teaser" checkbox is checked.

So if you have a field labeled (say) Category with 11 possible values Electronics, ..., Other (as in your question), you could combine this with a Subcategory field labeled (say) Electronics with 12 possible values Mobile Phones, ..., Video Games & Consoles (as shown in your screenprint for subcategory). Then add 10 more similar subcategory fields for Cars & Vehicles, ..., Other and you're done.

PS: I'm assuming this question is about D7.

2

You can take a look at the Taxonomy menu module. Some details about it (from its project page):

Transforms your taxonomy vocabularies into menus with ease!

  • Custom Menu per vocabulary
  • Uses the default taxonomy term path or custom paths
  • Integrate with Views
  • Integrate with Pathauto: use URL/path aliases
  • Does not interfere with other menu modules

Also look at this post:

How do I direct link a view to a taxonomy menu?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.