Skip to main content
Home
Nav opener/closer Search

Main navigation

  • Big Blue Door’s Handbook
  • Who Big Blue Door is
    • Mission statement
    • Our values
    • Organisational structure & ownership
    • Our office
  • Staff handbook
    • Employee onboarding approach
    • When and where you work
    • Pay, pension, bonuses
    • Benefits
    • Leave
    • Maternity, paternity and shared parental leave
  • Learning resources
    • Drupal user guides
    • Snippets (Drupal knowledge base)
    • Drupal learning
    • Accessibility

Main navigation

  • Big Blue Door’s Handbook
  • Who Big Blue Door is
    • Mission statement
    • Our values
    • Organisational structure & ownership
    • Our office
  • Staff handbook
    • Employee onboarding approach
    • When and where you work
    • Pay, pension, bonuses
    • Benefits
    • Leave
    • Maternity, paternity and shared parental leave
  • Learning resources
    • Drupal user guides
    • Snippets (Drupal knowledge base)
    • Drupal learning
    • Accessibility

Related posts to be based on tags - 0 lines of code.

Drupal 10
Drupal 9
Drupal 8
Basic
Drupal 10
Views
Site building

 

This is a quick tutorial about how to implement a view which displays 3 latest posts tagged with the same topic as the article you're viewing.

Let’s pretend we have node type `Article` and a view of “Related articles” displayed at the bottom and now we need to action the following:

  • Exclude current article form “Related articles” view (1).
  • Display only articles which have same topic as current (2).

 Exclude current article form “Related articles” view:

  1. Add contextual filter - ID

2. Set “When the filter value is NOT available” value to “Provide default value” and choose type  “Content ID from URL” for  “Type” field.

 

3. In “More” section check “Exclude”.

Display only articles which have same topic as current

  1. Install “Views Same field Contextual Default” module https://www.drupal.org/project/views_samefield_contextual_default
  2. Add your taxonomy field to contextual filters.
  3. Set “When the filter value is NOT available” value to “Provide default value” and choose type. Type "Same field value from route context"

4. Don't forget to check "Allow multiple values" in "More" section if your taxonomy reference field is multiple. 

 

That's it!

 

Contact us
Address

Big Blue Door Ltd
60 Queen Elizabeth Street
London, SE1 2PZ

Email

hello@bigbluedoor.net

Phone

0203 773 6040

Help and resources

  • Who Big Blue Door is
  • Staff handbook
  • Learning resources
  • Drupal 8/9/10
  • Drupal user guides

Quick links

  • Accessibility
  • Contact
  • Contact us
  • Environmental responsibility
  • Modern slavery
  • Privacy policy
  • Social responsibility & sustainability

© Big Blue Door 2025