user2593200
user2593200

Reputation: 41

How Can I Override Drupal 7's Default Taxonomy Page with a Term View Instead of a Content View?

On my taxonomy term pages for a specific vocabulary I want to display the child terms and any products associated with those child terms.

My taxonomy for this vocabulary is 2 levels deep in some areas and 3 levels deep in others.

I can override the default taxonomy page with a view based on CONTENT but that doesn't easily allow me to display the child terms AND associated products.

I have sucessfully created a view based on TERM that will display child terms AND associated products correctly but Drupal is serving the default taxonomy page over this view even though this view's URL is set correctly.

I assume it is because Drupal wants to display a content view for a taxonomy term by default.

Is there anyway to override this behaviour or another way to accomplish this?

Can I use a page preprocess function to set a specific view and override the default taxonomy page?

The only other possible solution I have would be to create a custom template for the vocabulary and manually query the database for what I need.

Upvotes: 0

Views: 1419

Answers (2)

user18231
user18231

Reputation: 1

Using TVI module might help you overriding default taxonomy views

The TVI (Taxonomy Views Integrator) module allows selective overriding of taxonomy terms and/or vocabulary with the view of your choice. Using TVI you can easily create custom views to output all terms in X vocabulary.

Upvotes: 0

Alan Dixon
Alan Dixon

Reputation: 561

You might need to use the path "taxonomy/term/%" instead of just "taxonomy/term".

Upvotes: 3

Related Questions