Score:1

Show 2 results for each of 3 different content types

bs flag

I am using Drupal 8. I have 3 content types: videos, images, and podcasts.

I want to have a single view that shows two of the most recent posts of each content type. For example, out of 4 videos and 2 podcasts, it should show 2 videos, 2 images, and 2 podcasts.

Is this possible? I have been trying to use hook_views_query_alter(), but I haven't been able to find a good documentation.

I am currently thinking to use three different views and put them all together.

Alfred Armstrong avatar
cn flag
It's not really practical to do this in a single view. It would require a fairly complex custom query (the union of three subqueries for example) and honestly it is far simpler to have three views and merge their output in whatever fashion you require.
bs flag
Thank you. Yes I ended up using three views instead
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.