So I am building two sites and I came across something I needed to do but don't know how.

I want to have one view block on multiple pages (so I'm not cluttered with millions of views) and i want the view to display content that has the same Taxonomy term as the basic page that the view block is being displayed on.

My site is a tutorial video site. there are many different categories and sub categories.

The view will be displaying a media file field rendering a YouTube link as a video.
This view will be displayed on all pages that are suppose to have video tutorial playlists on them.

I want a way to filter the videos so only the ones that are relevant to the content present on that particular page are showing.

Example that might clear things up:

when you click the link "Begging guitar: Lesson #1" you land on a page with the view displaying the 3 videos that are "beginning guitar: lesson #1" related content.

My thought was giving both the main page and the video content (that is being displayed in the view) the same taxonomy term and using some setting in the view to use that taxonomy term as the way to filter.

I cannot figure that out.

I would really like to have someone show me how to do this and give an example of this on my site.

Any help is greatly appreciated. Thanks all!

Comments

nevets’s picture

If the link "Begging guitar: Lesson #1" displays all content tagged with some term, the easiest approach is to make the path for "Begging guitar: Lesson #1" be taxonomy/term/{tid} where {tid} the the taxonomy term in question.

Then the view can have a contextual filter on taxonomy term, setting the default to take the term from the path.

destinationsound’s picture

Thanks for the tip.

with your advice i was able to make the content's url display a field which is a taxonomy term.

I still dont know how to make that taxonomy interact with the view to display content that has the same taxonomy term. I used the pathauto module and changing the default url to [node:title]/[node:field_choose_course] (where field_choose_course is a taxonomy term)

Would you be willing to either give me step by step instructions or make it work for me and then tell me the steps you took so i can get it working and learn along the way?

thanks!

nevets’s picture

There are two main use cases here,

From your recent post

with your advice i was able to make the content's url display a field which is a taxonomy term.

it sounds like the page is displaying a single piece of content (ie a node).

From your earlier post though it sounds like the main page is listing content with a particular term.

Each requires a different approach in views to list related content.

destinationsound’s picture

To clarify the page with the view block on it is displaying a single node.

nevets’s picture

The Views Node Taxonomy Filter is meant for what you want to do (I have not tried the module).

destinationsound’s picture

WOW Thanks You SOOO MUCH!

this Module Worked perfectly!!!

It is super easy to use. Install, then under filter criteria there will be a new option called " Taxonomy Filter: Node Taxonomy Filter (for Vocabulary: Specific Course) " select it choose the taxonomy parent item. Then the view filters!

thanks for pointing me to this module!

submit.dk’s picture

I had exactly the same problem and i then found this thread. The module Views Node Taxonomy Filter is solving my problem. Thanks for the tip :o)

Kenneth, www.submit.dk/drupal