Book Image

Drupal 7 Cookbook

By : Dylan Spencer James
Book Image

Drupal 7 Cookbook

By: Dylan Spencer James

Overview of this book

<p>Drupal 7 is a modern Content Management System famed for its flexibility and power. Using Drupal you can easily create custom functionality that would otherwise have to be purchased in many of the other leading CMSs.<br /><br />"Drupal 7 Cookbook" is filled with recipes to help you to do more with Drupal and improve your skills. Chapters range from content creation, to theming, to managing your site. You will learn how to create your own content types and use them to create Views, Blocks, and Pages. This book will take you from novice to pro in just 12 chapters.<br /><br />In a wide variety of practical recipes, you will learn how to work with views and panels, how to provide translations for your content to create a multilingual site, and to integrate your site with social media. You can develop the Zen starter theme or learn how to create custom cross-browser compatible Drupal themes, including themes for mobile devices. The Drupal 7 Cookbook contains all of the means necessary to take your skills from those of a novice Drupal user to a proficient site builder.</p>
Table of Contents (18 chapters)
Drupal 7 Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface

Creating a block with Views


In this recipe, we will be creating a very simple block to display the five most recent items of content. To achieve this we will be using the Views module.

Getting ready

For this recipe you will need to install and enable the most recent recommended releases of the following modules:

You will also need at least five existing items of content (of any content type) for demonstrating the new block.

How to do it...

  1. 1. Select Structure from the admin menu and then select Views.

  2. 2. Select +Add new view.

  3. 3. In View name enter Recent content listings.

  4. 4. Ensure that the first fieldset reads as follows: Show Content of type All sorted by Newest first.

  5. 5. Uncheck Create a page.

  6. 6. Check Create a block.

  7. 7. In the Display format field, select HTML list and ensure that titles (linked) is selected for the of field.

  8. 8. Leave the Items per page set as the default value of 5.

  9. 9. Click on Continue & edit.

  10. 10. Select...