I want to display a list of two content types on my home page, sorted by post date. Both content types will be updated frequently and not in any pattern.

Content type A is 50px in height and content type B is 25px high. The trouble is, I need to display exactly enough nodes to fill 400px.

I currently have it set to only display 10 items. BUT, if there happen to be 7 As and 3 Bs, the list will run past it's boundary. Conversely if there were 7 Bs and 3 As, there would be white space left over.

I know I can make two separate views and attach one to the other so I could, for instance, limit A to only display 6 and limit B to 4. But in that case they are basically sorted by content type and not date.

Is there a way to "merge" 2 different views into one list?

hope this makes sense!

Comments

nevets’s picture

Why not make one view that lists both content type sorted by date?

supersteph’s picture

because i need to control how many of each content type are displayed. is there a way to do that?

WorldFallz’s picture

In the views display type drop down, there's an option for "attachment" -- you can use that to display 2 views at one url.

cerup’s picture

Subscribing. I have an issue on views regarding the same thing (I think) here #748844: How to: Combine or merge multiple views/queries into a single view (using hook_views_pre_execute)

cerup’s picture

Here's a tutorial I created on doing something like this in views. It looks a little harder (more advanced) than it may appear - http://sethsandler.com/software/drupal-6-creating-activity-stream-views-...

I have to clean it up a bit, but hopefully it's a start for some people that are intermediate - advanced.

zahra hosseini’s picture

Thanks... is there any same tutorial for drupal 7? i want to merge two lists sort by date

zahra hosseini’s picture

i did not find any solution so i created a view from two content types i added all fields but if no result hide them... with use relation and contextual filter i can show all results of two views in one and sort by date

zahra hosseini’s picture

Edit 3 month later: if you follow this quick solution your view may be complicated!

After 3 month in our project, this view is too big and complex (it contains 4 content types and 3 relationships and use it as block and service to mobile app!), also it satisfies our requirements but from a software engineering point of view, maintenance will be hard. so it's better to search for another solution!