0

Sorry for the long title. Essentially what I'm looking for is the best way to create the standard News style list page, in which I might display something like the 3 most recent News Articles, Company Events and Press Releases.

The content would be grouped by content type so would essentially look like this:

News Header
News Item 10
News Item 9
News Item 8

Events Header
Event 10
Event 9
Event 8

Press Releases Header
Press Release 10
Press Release 9
Press Release 8

Seems like a common use case so I'm thinking (hoping) someone has done it before.

I've got it working up to the point of showing only x number of each content type, but can't seem to figure how to limit content without limiting just the overall number of items, not per Content Type.

Thanks a lot.

2 Answers 2

3

Here's a solution using only the Views UI.

  • Create a view with the following master settings: display 3 items, sort post date descending with the node tile included in your fields. Probably as you have it already.
  • Add a page or block display with type == News articles. This will be your parent view display. Again, you might have this already, but your type filter may need to be adjusted. We just want 3 news articles here.
  • Add an attachment display with title as Events and update type == events. Attach this to your parent view display above.
  • Add another attachment display with title as Press Releases and update type == press releases. Attach this to the parent view in the second bullet point above.

You can find the attachment to setting in the second center column on the views ui, assuming this Drupal 7.

Jason.

2
  • Great. This is just what I was looking for. Thanks a lot.
    – evanmcd
    Commented Dec 26, 2013 at 20:24
  • Great, glad it worked for you.
    – Jason
    Commented Dec 26, 2013 at 22:13
1

why do you try to do that in just one query?

Simply create a block view for each content type: News, Events, Press Releases. Add a header within each view block.

Then go to the blocks admin page, and define the correct settings to display your blocks wherever you need to.

Your Answer

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

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