”
Often when displaying a node in Drupal, such as a news article, event or profile page, it is useful to display a few related pieces of content. This can be achived by using a taxonomy field on your content and a view.
To create a view to display other nodes with the same taxonomy term as the current node
- Create a view and use a block display.
- Add fields to display (title, a small image, date, whatever you like) or just use the node teasers.
- Add the contextual filters: Content: Has taxonomy term ID (with depth) and Content: Has taxonomy term ID depth modifier
- Set the following configuration options 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
- 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 to add a new one.
- Select Content: Nid
- Set the when argument is not present option to Provide default argument
- Set the Default argument type to Content ID from URL
- Go to MORE and check the Exclude box.
- Move the filter Content: Nid to the top position.
- Add a block to your view and embed the block on your node pages
- Save your view