Adding a related content view in Drupal 7

posted Oct 21, 2011, 5:21 AM by magic stone

The most gracious commenter "nordic material" provided working instructions for performing this task using Views 3 in D7. I just went through the directions and they work perfectly. Below is a recap. Thanks again Nordic Material!

  1. Create view (block)
  2. Add fields (title, a small image, date, whatever you like). Or teasers, what works as well.
  3. "Arguments" is from now on called "Contextual filters", so go there.
  4. Add the filter: "Content: Has taxonomy term ID"
  5. Configuration on this filter: -> When the filter value is NOT in the URL: -> Provide default value -> Type: Taxonomy Term ID from URL -> under that, check the box "Load default filter from node page, that's good for related taxonomy blocks." -> now check the boxes of the taxonomies you want involved here
  6. Now you need to add the second filter in order to exclude the current node from the list. Click [+] button of the contextual filters section.
  7. Select Content: Nid
  8. Set the 'when argument is not present' to 'Provide default argument'
  9. Set the 'Default argument type' to 'Content ID from URL'
  10. Go to "MORE" , and check the "Exclude" box.
  11. Add a block to your view and embed the block on your node pages
  12. Save your view