Hello community members,
I have the current setup:
. a vocabulary with several terms
. nodes using that vocabulary
I would like to create a block containing a max of 10 entries with views that shows other nodes by relevance.
This means:
. First, and internally ordered by date, the nodes sharing the most vocabulary terms with current node
. then, maximum shared terms minus 1 and so on.
. last but not least, the latest nodes of the site not previously listed (the point with this is to ensure .
Is there a way to do this with views?
I am missing two things:
. the way to sort by "relevance"
. the way to add the last part (depending on the amount of result of the relevance part...
Or do I need to create a new relevance module that fits my need?
thanks in advance,
--
magoo
Comments
Comment #1
merlinofchaos commentedThere is no data in Drupal core to determine 'relevance' so you'll need to write code to determine that. There may well be a module that does it, there are lots of Views modules, but I am not familiar with all of them.
The last datapoint is particularly difficult to accomplish, I'm not sure offhand how you would go about it.
Comment #2
magoo commentedI've been looking into "Relevant content" and "similar by terms" for sort by relevance.
They do the following requests:
and this
with
$term_sql = 'tn.tid IN('. db_placeholders($terms, 'int') .')';Therefore I thought that even without the relevance information in the DB, Views could do the same.
My problem is to understand if it would be possible to integrate this in views as a complementary module and how I could achieve this.
I believe that the second part of my question is out of scope of views as it requires a second db request. This requirement is a customer request in order to make sure there will always be X entries in the side blocks. My point of view is that it should only be interesting at the beginning of the site as when the amount of content grows, the need of filling empty spaces will disappear.
Comment #3
matslats commentedDon't forget the Similar by terms module, which provides a block showing the nodes most similar to the current node
http://drupal.org/project/similarterms
Of course this is not a views solution
Comment #4
magoo commentedI already saw that module as mentioned in my previous message but it does not fit my needs.
I have chosen to create a module providing a universal function to get what I need.
It takes the following arguments:
. content types
. terms
. amount of results
. excluded nodes
. optional other criterion
I have abandoned to provide nodes that are not related (but recent) but it would be easy to implement.
Here it is:
Comment #5
domesticat commentedClosed while closing all Views support requests with no activity for 6 months. If you still need help, you may re-open this issue at any time.
Comment #6
dagomar commentedChanged the title to better represent the question