14

In Drupal 7, I've got a content type called "Asset" with a taxonomy field called "Category". All I need is a Block on the Asset pages that looks at the current node's Category term(s), finds all other Asset nodes tagged similarly, and spits out a list of their titles, links to them, and a few other bits of info from their node.

A Views Block was my first thought... but I'm having a heck of a time making this happen in Drupal 7. Maybe it's problematic because my URL doesn't include the Term ID? Anyway, I've searched and followed a bunch of tutorials (like this one and this one), but to no avail. So, here are my questions:

  1. If Views is the answer, what am I doing wrong?
  2. Is there a Drupal 7 module that can do this for me?

closed as off-topic by kiamlaluno Sep 6 '15 at 10:52

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions asking to recommend or find a book, tool, module, theme, distribution, tutorial, or other off-site resource are off-topic for Drupal Answers as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – kiamlaluno
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 3
    The first tutorial you listed should do exactly what you wish. (Forget the second one!) If you are not able to get it to work, it just means you are not understanding. Have another go, and see where you can take it. – Triskelion Mar 8 '13 at 2:57
  • @Triskelion, I'll surely give it another go... but I followed it precisely! – Sam Mar 8 '13 at 3:12
  • Once you have the view, let me know what problems you are having. – Triskelion Mar 8 '13 at 3:13
  • With a little tweaking... IT WORKED! I'm at the refining stage of the Views build process, so it's not perfect, but it's getting there. I'll be honest, I don't really understand the Aggregation part. – Sam Mar 8 '13 at 15:59
  • This answer on StackOverflow did the trick... with a little tweaking: Creating list of similar nodes in Drupal 7/Views 3 – Sam Mar 8 '13 at 16:00
29

I've done a little tweaking myself, and I seem to have gotten a working solution here.

  1. Create a new block for the nodes you'd like to display
  2. Add a new Contextual Filter: Content: Has Taxonomyterm-ID Select: "when the filter is not available, provide a default value: Taxonomyterm-ID from URL." Put a check next to "Load Standard Filter from node-page, useful for related taxonomyblocks" And you will probably want to limit the vocabulary as well

In order to exclude the current Node you have to add a second Contextual Filter for Node-ID, provide default value as the content ID from URL and at the bottom of the modal pop open 'More' and check 'Exclude'

  • Brilliant answer. Just what I was looking for! – cwiggo Mar 1 '16 at 11:20
  • But it matches only with first term available in that node, how to match with all? – Tanvir Ahmad Sep 27 '16 at 11:36
  • 5 years later, this answer is still relevant, concise and most importantly flawless. Thank you! – WebMW May 26 '18 at 21:20

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