Book Image

Drupal 7 Views Cookbook

By : J. Ayen Green
Book Image

Drupal 7 Views Cookbook

By: J. Ayen Green

Overview of this book

<p>Fully revised and updated for 2016, Drupal 7 Views Cookbook allows you to bypass most of the Views' learning curve and quickly take advantage of the capabilities of the Views module to select and present your Drupal content through step-by-step instructions for quickly developing dozens of useful views.</p> <p>Starting with a brief introduction to Views, Drupal 7 Views Cookbook takes you through recipes for elementary views, such as displaying randomly selected content, to intermediate views, such as customizing links, to advanced views providing multiple interacting displaysof content on the same page<a name="_GoBack"></a>. Along the way, there are recipes for theming views, creating a view in your code, creating a custom view handler, administering views, and finally, using some other modules related to the Views module. Most recipes are standalone, so pick them in any order!</p> <p>Don't limit your site with dull presentation of content in last-in-first-out order. Empower your site visitors with the recipes that Drupal 7 Views Cookbook delivers!</p>
Table of Contents (17 chapters)
Drupal 7 Views Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Teaming two content lists


Sometimes, you want to split one collection of content between two different displays. There is a trick to doing it without the same content appearing in both. In this recipe, we will create a top ten list, but have the top three appear in one display and the remainder appear in the other.

Getting ready

We'll be using the Country content type (details are in Appendix B, Bundles, as is sample data you can use).

How to do it...

Navigate to the views list (admin/structure/views) and click the +Add new view link.

We will first enter the settings to create a page:

  1. Enter Top 10 as the View name, check the box for Description, and enter Top 10 Country list into the textbox.

  2. Change the of type select box to Country.

  3. In the Create a page section, change the Display format setting from teasers to fields (the other two select boxes will disappear).

  4. Click the link for Content: Title in the Fields section, uncheck the Link this field to the original piece of content checkbox, select...