3

I'm trying to make a block, with views, that shows me a list of nodes that has the same term of the node that I'm viewing:

  • I open node/1 that has a term reference field to the term "10"
  • I want to display other nodes that have a reference to the same term

I use a contextual filter, but how should I pass the term? Have I to use a php value as default argument?

6

Oh, it is really easy with powerful Views module.
There is cool option for contextual filters “Content: Has taxonomy term ID” and “Content: Has taxonomy term ID (with depth)” — Load default filter from node page, that's good for related taxonomy blocks.
enter image description here

Tip: don't forget to exclude node, which is current!
enter image description here

| improve this answer | |
  • Good, I didn't know this function!! :) – arrubiu Nov 7 '12 at 8:54

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.