Score:0

Related content by taxonomy term but using a relationship between terms

cn flag

There are many posts and tutorials for creating views with contextual filters to display content that shares the same taxonomy term, but my requirement is slightly different.

I want to create a view that displays content that is related to the content being viewed via taxonomy terms BUT I do not want the related content to be based on the SAME taxonomy term, but instead a related taxonomy term.

I think I need to create a term reference field on the actual term itself, so say its called 'Related Term', and in that field I reference the other term, so I have a relationship between the two terms.

The bit where I'm stuck is how then to create a view much like the contextual filter views that show content with the same term as the content being viewed, except it will instead show content of the related term referenced in the field described above.

The general idea is that if for example content with the term 'Car' is being viewed, that the view will list content with the term 'Car Accessories'.

Is this possible or is there a better way to approach this?

cn flag
Yes, a term reference will help. But the specifics depend on how you have structured your content. In general, I would use Panels for this, because Panels will allow you to set contextual filters in Views using the UI, which makes this relatively straightforward to test and debug.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.