1

I have built a series of views to build a Drupal Commerce display for products based on the Taxonomy terms of those products. These terms have a hierarchy. There are nearly 40,000 products being imported through Commerce Feeds, the taxonomy terms are attached to the products during the import.

Currently I have a series of 3 views working together to achieve what I want and am attempting to build a fourth view that I am having a strange problem with. View http://cde.gttechlife.com/products for reference.

View 1(Product Taxonomy Children) pulls in all Taxonomy terms based on the Parent Term context in the URL. (Term Alias is the name displayed, Product Code for Image pulls in an image based on product code) It pulls that in through Term Name converted to ID and turns term name spaces into dashes. See Below:

View 2((Top Level Products) Pulls in all Taxonomy Terms that do not have Parents and displays them. View 2 is attached to view 1 if View 1 has no results based on the Contextual URL, this is the only time view 2 is displayed. So no contextual filter on the URL it displays all terms with no parents.

If View 2 DOES have a contextual URl, there it displays a no results attachment View 3. View 3 pulls in all products with that Term Name in the URL.

All of these views work exactly as needed. But I want to add another view. I want View 4 to also be pulled into view 2 with view 3. View 4 (Taxonomy Description). View 4 pulls in the Taxonomy Term Description and the custom field Category Alias, and Product image of the current term in the URL. Oddly enough this ONLY works for contexts with no dashes. Just like the other Views I made sure to check "Transform dashes in URL to spaces in term name filter values" but for some odd reason it still only works for one word terms. For example (cde.gttechlife.com/products/vibratite) works fine but (cde.gttechlife.com/products/Gasket-Flange-Sealant) does not. It seems like such a simple problem to have but I have hit a wall looking for the solution. Any help would be appreciated.

Also trying to figure out the best way to get the Breadcrumbs to reflect the parent terms and even ideally in the url, but I still have some effort to put in on that end. Have been using the Crumbs module thinking I will be able to do what I need if I put in the time. But the problem stated above has me stumped because I can't think of why it wouldn't work correctly.

0

If the contextual id is working on the 3rd view, then you should set the validation criteria to convert the term to an id:

enter image description here

That might fix the "inherit filters" of your views footer.

EDIT: An answer to your second question about reflecting your architecture in the url structure and breadcrumbs.

I have made two videos where I've concocted two different ways to make a Drupal Commerce Catalog using hierarchical taxonomy (either with one vocabulary or multiple vocabularies). Both of these ways of using Views and Taxonomy creates urls that reflect where you are. I'd bet with a little creativity you could make views create a breadcrumb as well.

  1. Hierarchical Views Catalog using Taxonomy

  2. Multi-vocabulary Hierarchy Views Catalog

Hope that helps!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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