Creating a randomly selected list of images

Space is always of a premium on the homepage of a site. One solution is to display a limited selection of random items of content. In this recipe, we will see how to create a display in a view where the outputted items are randomly selected from the pool of News article nodes.

Getting ready

To complete this recipe you will need to have first completed the first recipe of this chapter, Creating a news listing view. We will be making use of the News article content type and also adding a new display to the News view.

How to do it...

In the first part of this recipe we will be editing the News view to add a new display. We will then configure the new display to output three randomly chosen News article images. ...

Get Drupal 7 Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.