Score:1

Create a view showing all nodes tagged with the same term

de flag

I'm trying to create a view that shows all nodes tagged with the same term as the current node. Note that the field only allows a single term. So each node (of this type) will only have a single term (of this vocabulary) attached to it.

I have a node ID in the URL for my contextual filter. I cannot figure out the right combination of relationships and contextual filters to show only nodes that have the same term, and NOT show the node referenced in the URL. Can anyone provide assistance?

Score:2
de flag

I figured out the problem. I had built my view correctly, I was testing it incorrectly on the page however. The view had two contextual filters, both set to pull a value from the same key in the URL when the argument wasn't present. I was only testing it with a single argument, eg 5, thinking that this would cover both contextual filters, as they were set to get their value from the same source. However, when testing the view, the argument needs to be entered twice, eg 5/5, and returns the correct values.

No Sssweat avatar
ua flag
`argument needs to be entered twice` a little gotcha of the view preview system.
Jaypan avatar
de flag
I was a PHP developer before Drupal, so I learned coding in Drupal. It's only late into my career that I've put myself to a bit of a challenge of building a site only using code for bugfixes. I always just got frustrated with this stuff in the past and switched to a code based streamlined solution.
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.