0

I am having two vocabularies, for example, styles and artists. Each of the artists term has a term reference field to styles voc.

When one of the styles term page is open i want to show all terms from artists vocabulary marked with this term.

Can't figure out why my contextual filter with term id doesn't work. Could you please help me to achieve it?

2 Answers 2

2
+50

2 steps are needed to achieve this with Views:

Relationship:

  1. Add a relationship
  2. 1st screen on the popup: Choose Taxonomy term: Styles
  3. 2nd Screen on the popup: Choose Require this relationship
  4. Apply

Contextual Filter:

  1. Add a contextual filter
  2. 1st screen on the popup: Choose Taxonomy term: Term ID
  3. On the Relationship dropdown choose the relationship you configured above
  4. Choose When the filter value is not available -> Provide default value -> Type dropdown = Taxonomy term ID from URL
  5. Apply

And you're done.

2
  • Great! That works! My mistake was not setting Relationship proper - i choose taxonomy term using Styles instead of taxonomy term Styles. If there'll be no better answer in 7 hours i'll be able to award my bounty. May 22, 2013 at 7:59
  • Glad to help :) May 22, 2013 at 8:21
1

If you simply add a block in your page, it won't work, as blocks don't receive arguments. There are several ways to bypass that :

  • Use Panels and re-build your page in a taxonomy/term/% page
  • Use Views URL Path Arguments
  • Trick your contextual argument by using custom php code in which you'll search your tid by using current_path() that should return taxonomy/term/[%tid].
1
  • Thanks for your answer, Gregory. But i don't want to use such weighty module as Panels for one little block. Views URL Path Arguments - is made for Nodes. I was also not successful in tricking the argument by custom code( May 21, 2013 at 15:50

Your Answer

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

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