0

I want to filter taxonomy terms in common to nodes related to the viewed node, but I cannot figure out how. What I am getting are all the terms that the related nodes have (with repeated terms too). Please take a look at this recipe page, side block STAG RICETTA

I am filtering seasonality terms (months) in common to ingredients nodes (the ones related to the node being viewed) used in a recipe node (the viewed one).

How can I achieve this?

4
  • I don't completely understand what you're trying to show. What do you mean by "filtering"? How are the nodes related to one another?
    – beth
    Sep 12, 2013 at 18:29
  • I'll try to clarify, maybe it's my poor english, sorry. I would be able to prepare that recipe only when all ingredients are available! thus I want to show the month in which ingredients needed (1st block in the sidebar, from top) are all available but I get all the month in which any of the ingredients is available.
    – gUtto
    Sep 12, 2013 at 21:30
  • ingredients are related to recipes by a "recipe_uses_ingredient" relation. seasonality of the ingredients is a taxonomy vocabolary having months as terms.
    – gUtto
    Sep 12, 2013 at 21:32
  • So you want to show, when viewing a recipe, a list of the seasons on its ingredients? Am I understanding correctly now?
    – beth
    Sep 13, 2013 at 19:39

1 Answer 1

1

To show a list of season terms on the ingredient nodes related to the recipe node:

  1. Create a view of taxonomy terms of type season.
  2. Add a relationship: Taxonomy term: Content with term
  3. Add a relationship: Entity Reference: Referencing entity (A bridge to the entity that is referencing Content via field_recipe_uses_ingredient) via the relationship created in step 2.
  4. Check "require this relationship".
  5. Save.
6
  • thank you beth, step 3: relationship not found... is it that I'm using 'relation' module, not 'reference' module? why do I need to relate to the User? how do I relate with the viewed node?
    – gUtto
    Sep 13, 2013 at 21:10
  • Oops, the 'user' thing was a cut and paste error. Use the content entity that applies, not a user.
    – beth
    Sep 16, 2013 at 14:23
  • thanks beth; your method (I edited it introducing relations) returns all the months that any product has, not the ones in common to all the products, as needed. would you suggest any alternative method or modification?
    – gUtto
    Sep 23, 2013 at 21:52
  • You'll have to add the relevant contextual filters as needed.
    – beth
    Sep 24, 2013 at 17:33
  • sure, i did it even if i didn't mention (gathering recipe's NID), but it doesn't help as a recipe may have more that one associated ingredient :(
    – gUtto
    Sep 24, 2013 at 22:22

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.