Create related content block view based on terms in Drupal 7

Posted on Monday, December 9, 2013

 

Mostly in blogging site we need to create block view with related content list based on taxonomy terms associated to current node. It sounds complex but there are few simple step which we can take to create this block. Instead example of related content block you can see is on the right side of this blog page titled "Related Content", if its not showing that means there is no content matching with term of this blog node. These are step for creating related content block view:

  • Create block type view.
  • In format options select "HTML list" to show content as list.
  • Now select field you want to show in the list, best option is to select only title field.
  • In Contextual Filters option add filters “Content: Has taxonomy term ID (with depth)” and “Content: Has taxonomy term ID depth modifier”.
  • Configuration on this filter: WHEN THE FILTER VALUE IS NOT AVAILABLE - 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 under vocabularies 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 by adding "Content: Nid" contextual filter.
  • Set the ‘WHEN THE FILTER VALUE IS NOT AVAILABLE’ to ‘Provide default value’.
  • Set the default argument type to ‘Content ID from URL’.
  • Go to “MORE” at botton , and check the “Exclude” box to make sure this node is not shown in the list.
  • Move “Content: Nid” filter to the top position.
  • Save the view and add this block from block list to a particular region.

Comments

edwradcross (not verified)

Monday, May 15, 2017

Awesome article. I’m most definitely interest in this one. I am in reality happy with article quality and direction. This post is spot on in informative how some ideology applies to any script location. Thanks a lot for preservation huge stuff. I am extremely a good deal grateful used intended for this place. Thanks a lot for protection massive things. Visit here: https://www.speedycustomessaywriting.org/

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.