A totally beginner tutorial to Views for Drupal 7

As part 1 of our 3 part mini-course on Views, I've written up the notes for today's session.

Update: here is the recording

To get the most out of this mini-course, you need to know the following:

  • How to customize content types (add fields); and add content in Drupal 7
  • What modules are; how to install and configure modules in Drupal 7

Sign up for the next one Views Mini-Course, Part II: Creating Flexible Views with Drupal 7. May-08-2013 - 01:00 PM EDT

How did you miss Views?

After Drupal 7 itself, Views is the second most popular download for Drupal. In fact, it's so popular and ubiquitous that it is now included in Drupal 8. At least that will ensure that Drupal adopters don't miss this amazing tool.

What is surprising is that I'm still seeing client sites where Views would be a perfect fit, and yet they somehow didn't find Views yet or they don't know how it works. I've seen Drupal sites where information is copied from one page to the next to inter-link content. Oh the agony! (As I write this, I'm worried some clients might read this and think I'm talking about them. Trust me, you're not the only one!)

There are some excellent Views tutorials as well. Our most popular course, Site building with Drupal 7 is essentially focused on all the permutations and configurations and tricks you can do with Views. In two days we don't even exhaust the possibilities. Drupalize.me's Overview of Views is comprehensive too. And there's great documentation right within Views itself.

There's no shortage of ways you can learn how Views works. So... how do new Drupal users keep on missing it? The Views UI has been greatly improved, but it still offers a dizzying array of options. There are over 300 contributed modules for Drupal 7 which integrate with Views. *phew*. I think people are missing a really truly basic introduction to convince them that it's something they want to use - and that it's something they can master easily.

So that is what I've set out to do. Here's is the totally basic introduction to Views.

First things first: Views is a query builder

The first fundamental thing you need to know about Views is that it is a tool to build queries. You can even inspect the query as you build it.

views query output

The next thing you need to understand is the UI. We find the Views initial "wizard" does confuse new learners, though it is meant to be a quick-start simplified user interface. Just keep in mind, like any good wizard, once it's done it's magic, it vanishes. The wizard allows you to select some of the settings quickly.

Views Wizard UI

The Views main editor is where you'll spend most of your time. There are a dizzying amount of options available. Instead, think of these as two main functions:

  • What to select and filter from your database.
  • How to format the information and where to display it.

Views UI simple

To take you through a full explanation, I've prepared this screencast and slides for you to follow along with.

Views: A basic introduction

In today's webinar I'll explain to you why you need Views in the first place, and then give you a quick demo to explain how it works. By the end you'll understand some of the terminology, and get a sense of what you can do with Views. And you'll know enough to be dangerous and get started with views.

What do you want to select?

  • Select base table to start (you can combine tables with relationships).
  • Apply filters
  • Select fields or

Where and how should it appear?

  • Choose a format such as list, table, etc.
  • Choose a display such as pages, blocks, RSS feeds. More displays available!

Your assignment!

This week, make a View!

  • Create a view
  • List a specific type of content, terms of a specific vocabulary or all users
  • Create a page display and a block display
  • Place the block in the sidebar of your site

Need some help? Check out these tutorials

Sign up to our training newsletter

Sign up to our training newsletter to be notified about more tutorials for you. If you're already experienced with site building, you'll like my next tutorial: How to export your views to code in your first module!

Learn site building and more about Views

Comments

Posted on by jayremiah (not verified).

thank you so much for this tutorial :D

Posted on by Ling (not verified).

Hi I noticed the link of "Drupalize.me's Overview of Views" is wrong. It links to http:/ /www.acquia.com/drupalize.me/videos/overview-views

Posted on by Dave Myburgh.

Thanks for pointing that out, we've fixed the link.

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.

Filtered HTML

  • Use [acphone_sales], [acphone_sales_text], [acphone_support], [acphone_international], [acphone_devcloud], [acphone_extra1] and [acphone_extra2] as placeholders for Acquia phone numbers. Add class "acquia-phones-link" to wrapper element to make number a link.
  • To post pieces of code, surround them with <code>...</code> tags. For PHP code, you can use <?php ... ?>, which will also colour it based on syntax.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <h4> <h5> <h2> <img>
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.