0

I would like to implement a discussion overview page which displays the hot topics and latest topics, excluding the hot topics from the latest ones.

  • I have two displays in the same view, each of those operates on the same dataset (listing the same content type).
  • The difference between the two displays is the sort criteria only.

Is it possible to set up the display which generates the latest topics list to exclude hot topics? More generally: is it possible to exclude the results of one view from another without making a custom module?

I would like to get a general answer not involving offsets, because we'll probably face a situation where the sort criterias have to change. Most likely offsetting won't solve my issue there.

[Drupal 7 with Views 3.]

2
  • Maybe you can take a look at the offset, so you can exclude the top x hot content
    – michaelmol
    Aug 31, 2011 at 16:51
  • @michaelmol - no, that's not a viable alternative. The sort criteria is quite a complex one made from three component.
    – Scorchio
    Aug 31, 2011 at 21:21

3 Answers 3

1

One thing that pops to mind, albeit dirty, is to use php in the argument and do:

  • views_get_view_result($name, $display_id = NULL)
  • Loop over resulting nids of your hot topics then explode them out separated by +
  • set the argument to exclude these nids.

Not the cleanest solution as it leaves you with php in the DB but it would work.

1

Have you tried the Views exclude previous module ?

The Views exclude previous module provides a views filter that excludes nodes that have already been loaded/displayed on the current page.

This is very useful when you have pages with several embedded views, and you want to make sure that a given node only appears once in the page.

1

I just created a views filter that does just that: Other View Filter.

The filter provided by this module can be used to exclude a node or multiple nodes from a view, by excluding the results of one view from another one.

  1. In the view from which you wish to exclude selected items, add filter "Content: Other view result"
  2. Select the view/display combo whose output you want to exclude from the current view.
  3. Save the view.
1
  • In my situation, only this module works properly. I needed to exclude 'Featured posts' (display as Attachment) from the main Page view's results. And also for base view's results, I used 'Load more module' (drupal.org/project/views_load_more). May 9, 2018 at 19:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.