2

I have two different content types: cars and boats. each one has a taxonomy vocabulary of the same name associated with it. I have two views, one for each, that shows listings based on this content type. I have to use the taxonomy/term/% to use the taxonomy term or id as an argument.

My problem is that this would work if both views had the same fields, but they don't they are quite different.

How can I get views to show results based on my taxonomy term as well as show different fields for each view? I would prefer not to use an existing module to handle this. Maybe I can configure the views differently or use a php snippet?

5 Answers 5

3

Best Solution is using the : Taxonomy Views Integrator allows you to choose which view to associate with which taxonomy through a very handy and intuitive drop down menu.

More Detail are Found here:

2

Give a try to Taxonomy Display module

The taxonomy display module allows administrative configurable term display pages. This allows administrators to override the default presentation of taxonomy term pages per vocabulary

1

You do not need an add-on module for this, just a contextual filter per view.

  1. Create two separate views, one for Cars, one for Boats,
  2. Filter them both by their content type
  3. Set a path with an argument for each view ex: boats/%/list & cars/%/list
  4. Add a contextual filter to each view with each taxonomy vocabulary of type: Content: Has taxonomy term ID (with depth)
  5. Configure the Contextual Filter

    1. When the filter value is NOT available: Provide Default Value: Taxonomy Term ID from URL
    2. Check Load default filter from node page, that's good for related taxonomy blocks
    3. Select your vocabulary
    4. When the filter value IS available or a default is provided: Specify validation criteria: Taxonomy Term
    5. Select your vocabulary
    6. Filter value type: Term name
  6. Save view

Test your filter: go to cars/red/list and see if your taxonomy terms are filtering per content type.

1
  • The problem with this method is now all the taxonomy term links in the whole site will need to be edited because the default link for a term is taxonomy/term/[id].
    – Gnuget
    Oct 19, 2013 at 7:07
0

Another way to approach this problem is using panels.

Instead to use a view for overwrite taxonomy/term/%term, panels also has a pre-created panel for overwrite taxonomy/term/%term page, and panels let you create "variations" where you can add "selection rules" for choice which view will be displayed.

In this way, you will be able to use the same path taxonomy/term/%term but display the content in a different way.

0

I cannot comment on arpitr's response so I have to write a separate answer but Taxonomy Display module worked for us along with these instructions to configure

Your Answer

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

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