Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8194433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:49:33+00:00 2026-06-07T04:49:33+00:00

Copy from drupal.stackexchange.com hoping to get more answers here: I face a rather common

  • 0

Copy from drupal.stackexchange.com hoping to get more answers here:

I face a rather common problem of displaying a list of nodes similar to current one. Similar node is defined as one having at least one taxonomy term that current node has. There are few solutions available as modules, however the modules I’ve found (specifically Similar By Terms) are in beta stage (as in “not working properly”) for Drupal 7.

I’ve also found a couple of solutions based on Views and contextual filters (such as http://scito.ch/content/show-related-nodes-block-based-taxonomy-terms-views-3-and-drupal-7) or relations. I quite like this way as it saves me installing extra modules and with Views being actively developed and supported I’d prefer to use them rather than any custom solution. The problem I can’t get around is how to sort “similar nodes” by the number of terms they share. For example, if I have “IPhone 4S” Node with Terms “Gadget”, “Apple”, and “Phone”, I want similar nodes in the following order:

  1. IPhone 3 (Apple, Gadget, Phone)
  2. IPad (Apple, Gadget, Tablet)
  3. Mac (Apple, Computer)
  4. Bramley (Apple, Fruit, Tree)

How can I sort nodes in this view by the number of terms they share?

This question is about building a view, please do not suggest module or custom php-based solutions. Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T04:49:36+00:00Added an answer on June 7, 2026 at 4:49 am
    1. Create a block view
    2. Add Contextual filter -> Content: Nid -> Provide default value -> Content ID from URL
    3. Add Relationship -> Content: Taxonomy terms on node -> specify the appropriate vocabulary
    4. Add Relationship -> Taxonomy term: Content using vocabulary as specified above -> Check off Require this relationship
    5. Turn on Views aggregation (NOTE: the arrow in the screenshot below is pointing to the wrong spot and should be pointing to 2 rows below where it is)
    6. Assuming you are listing title only, edit the title field to use the Relationship you set up in #4 above.
    7. Add new sort criteria of Content: Nid. In aggregation settings, select Count. Use relationship from #4 and sort descending
    8. Add Contextual filter -> Content: Nid -> Use relationship from #4 -> Provide default value – Content ID from URL -> Scroll down and expand “More” then check “Exclude” to remove current node from the view

    ** See comment by @garret-albright below for testing this in the Views UI preview. **

    Related node view

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When trying to update a subversion working copy from Netbeans, I get the following
How to copy from one text file to another text file? Here my current
This code is copy from http://code.google.com/p/closure-library/source/browse/trunk/closure/bin/build/source.py The Source class's __str __method referred self._path Is
Im trying to get a completly data copy from a gridview, itryed clone(), tryed
I'm using CCNet and want to use build publisher to copy from more than
I am looking at implementation of IOUtils.copy() from Apache Commons at http://www.docjar.com/html/api/org/apache/commons/io/IOUtils.java.html and it
I'm trying to copy from a FBO to the window's framebuffer. As far as
I am attempting to use COPY FROM STDIN to import data into my table.
I have read the answer for difference between deep copy and shallow copy from
Greetings, I am trying to perform a copy from one vector (vec1) to another

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.