logo

Show Related Content by Category Using Views Drupal 8 or 9

01
June

Show Related Content by Category Using Views Drupal 8 or 9
By: Anonymous | Published On: Thu, 06/01/2023 - 11:20

Follow these step to make block using views to show the related content according to category of the current content page.

Edit the views and open Advance section

  1. Add the  'Content: Has taxonomy term ID' in CONTEXTUAL FILTERS.
  2. Check 'Provide default value' option and then select the 'Taxonomy term ID from URL'.

 Step 1 Views create

3.     Check the 'Load default filter from node page, that's good for related taxonomy blocks' option.

4.     Check the 'Limit terms by vocabulary' option and the check the vocabulary.

Step 2

5.    Also, you need to create the "Content: ID" filter to exclude the current node from the view result.

Step 3

Select provide default value: Content ID from URL.
6.     Scroll down to the bottom of the window and click on the "More" link. In the more field-set check Exclude.

Step 6

 

Need Help ?