Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Diving into the Views interface

From: Drupal 6: Online Presentation of Data

Video: Diving into the Views interface

Now we are going to walk through the creation of a view but with our eyes just on the interface. It should be noted that throughout this course, when we talk about views we are talking about Views Version 2, usually just referred to as Views 2. They were profound interface changes between Version 1 and Version 2 and I expect Views 3 will have further interface differences whenever it comes out. Unless you're using an old Drupal installation, you really don't have to worry. If you downloaded Views after, say, September 2008, it's almost certainly Views 2.

Diving into the Views interface

Now we are going to walk through the creation of a view but with our eyes just on the interface. It should be noted that throughout this course, when we talk about views we are talking about Views Version 2, usually just referred to as Views 2. They were profound interface changes between Version 1 and Version 2 and I expect Views 3 will have further interface differences whenever it comes out. Unless you're using an old Drupal installation, you really don't have to worry. If you downloaded Views after, say, September 2008, it's almost certainly Views 2.

Before we jump in, let's get an overview of the steps to create a view. In short, there are two preliminary screens and then one main screen where all the action happens. The first screen shows a list of all the views that exist already. That includes both of those that you created and those that were included in Views and any modules that you installed. On the second screen, you specify what sort of view you'd like to create and you give it a name. The third screen is the main screen where you decide which records would I like to show in my view, which fields in each record do I want to show, and how exactly do I want them to displayed as a grid, as a table, unformatted, and so forth.

Each of the selections that you make on the main screen have many, many options. Once again, we won't have time to go through all of the options in this course, but we are going to go through a lot of them, and in fact, we are going to be spending several lessons just talking about Views Interface. So there is the theory of it. Now let's actually start stepping through the process. We are going to create a view called Temp that won't actually do much but display a list of Node titles, much like you saw on the video about simple views. Then we'll delete it before leaving this video, ready? To get to the Views Interface, go to Administer, Site Building, and Views. And here we see a list of views that we already created. This first one up here people is one that we created in earlier video just to show you how views are made. I'm going to delete that view and we'll recreate it over the rest of the course, and in fact, we'll improve on it quite a bit.

To delete a view, you click on Delete here, confirm your deletion, and it's gone. The rest of the views that you see on this page, archive, comments_recent, date_browser and so forth, were all created by the module views itself. They are built-in to views. If you enable them, you can then edit them and change the way they look. These built-in views cannot actually be deleted instead you just disable them. They stay there but not available to you. If you've installed the Advanced Help Module, you'll see links throughout Views Interface, which will help you further. One of them is this one here, not sure what to do, try to Getting started page. This is actually quite a useful page when you click on it, it pops-up a Window and explains the Views Interface.

We'll be going through all of these in the course but this is also a useful resource. Now let's get started creating a view. The first thing to do is to click on Add, and here is that second screen I told you about. We are going to call this view temp, and the description will just say Temp. Now this first one is the machine-readable version of the name. It can only contain lowercase letters, underscores and numbers as it has underneath the field. If you'd like you can tag your views so that if you create many, many views, they can be separated into their different areas. We are not going to do that, we are only going to be creating a few views, so we are generally going to skip that View Tag throughout this course.

Growling down further, you have a choice of what type of view you'd like to create. Over 95% of the time, you are going to be creating a Node View. That is something that pulls information from various nodes as opposed to user profiles or filenames or so forth, so we'll leave it there and click Next. Now just as a warning, the view is not saved at this point. In fact, it won't be saved until you explicitly click the Save button which you see down here at the bottom of the main screen. We'll do that once we've configured this view a bit. The main screen is divided up into several areas, which are fairly obvious from their headings: Basic Settings, Relationships, Fields, Filters and so forth.

The first place that I go when I create a view is to Filters because I want to separate out only those nodes that I want to take a look at in the view. To add a Filter, I click on the plus sign here. Remember how I said that Views is contextual. This is an example of that. You click on plus and it opens up an area underneath. This area will change depending on what you clicked above. We now have a choice of what sort of filters to add. Once again we'll go into great details about exactly what these filters mean, later on in the course. For right now, I'm going to Filters, so we only see nodes of the type person.

Remember we created the content type person to store the personal information for the family members we are recording on the site. To find it, I scroll down, I happened to know that it's in the Node group. So I scroll past the Comment group, the Content group that is all of the custom fields that we created, past date and there we are in Node. What I'm looking for is Node Type. I click that checkbox and click Add. Then I have a choice of which types that I want to include in my view. As I said I only want the person content type, so I click that, and then click Update. Once we have done that, we are given a little warning that we started to create a view but it's not complete yet, don't worry about this warning, we'll get past it in just a moment.

But before we add fields to this view, I want to add one more kind of filter. This is something that people often forget to do when they create views. But I find it's almost always something that I want in my views and that's to only show those nodes that have been published. Sometimes when you are working on a site, you'll save some nodes back because you have an Editor who wants to look at them, or something like that. And if you are not careful in views, you could publish all of those unpublished pieces of information. So I'm going to go up to Filters and Add again. Scroll down to Node and Published.

Incidentally, this process of clicking Add and then going through this list of things underneath is something we'll do dozens if not hundreds of times throughout this course, so get used to this interface. I'll scroll down further and click Add, and yes, I want only those that are published. Update again and save, good! Now I'm going to add my fields. As I said, this is going to be an extremely simple view. It's only going to show a list of titles of nodes in that content type person, so we'll just go Add Field, and we are only going to add one and it is Node Title, scroll down and there it is.

I want to mention something here. This little groups pop-up actually makes that scrolling process faster once you get used to where a certain field is. That is, in which group. I know that the one that I want is in the Node group. So I hit this pop-up, go down to Node. It filters, so only those fields in the Node group are available. Some other groups, for example are Comment or User, and as you can see, these are fields that have to do with the user profile, the user login and so forth, but we just want Node. Scroll down to Title because that's what I want to show and I'll say Add.

I am going to leave this field pretty much as it is, except for one thing. I want to link it to its Node. I almost always find that to be most helpful and I'll do that many times through this course. Click on Update and there we have it. We have a live preview down here that shows us what our view will look like, and just as I said, it's pulling all of the titles from the nodes of content type person and putting them in this format. We could then go back and change this format, for example, to remove the word Title from the beginning or to turn-off the link, or to add other information, but that is the essence of Views.

The last thing we want to do here, and in fact, you want to do this frequently while you are building Views is to click Save, because remember, this hasn't been saved and if we left the screen, we would lose it. So click Save, good, and now if we go back to List, we can see that view, temp. If we want to edit it again, we'll just go over to Edit and we are back where we were. When you come back to Edit a View, you might be scrolling down and say wait, where is my preview? Well, it doesn't actually show up until you explicitly say that you want it. So if you come back here and don't see your preview, no big deal, just click Preview, and there it is. I want to point out some other information at the bottom of your preview. It's this Query and all of these statistics here. This is very useful for developers.

The Query is showing what actual SQL commands are being sent to your SQL server. I have often found this query section to actually be useful in learning SQL, so that's another use for Views. Further, if you are running a high traffic site, this information at the bottom of the query build time and execute time and so forth is especially important if you are running a very high traffic site because as you know, saving a few milliseconds here multiplied by a million times ends up being a lot of time saved on your server. There is one other small trick I'm going to show you in Views, and that's how to actually take that view and display it on your site. Let's go back up to the top where we have this Add Display section. This view actually doesn't appear in any useful way on your site, it's just the defaults that will then be applied to other sorts of displays. That display could be a page or it could be a block or it even could be an RSS feed. We are just going to quickly add a page and we get a warning down here, saying, it needs a path, we'll just called this path temp. You set that here under Page Settings, click on Update and once again Save.

Now we can actually see that on our site. If we go up here and change our URL so it's just localhost/temp, there is the page we just created. And as I showed you in the simple views video, when you are an Administrator, you can edit this view very easily by hovering your cursor over the view itself, going up to this ghost menu at the top and clicking on Edit. If you have the exercise files for this course, you will find this graphic in your folder. It shows the Views screen broken up into its sections, I find it a lot less intimidating when I think of it in terms of those sections, and in fact, it operates in that way. When you click on something near the top of the screen, that's when the other stuff below actually starts appearing, so it's sort of a segmented screen.

This top area is where most of the action happens. That's where you decide how you want your view to appear, what field do you want in it, what had to be filtered on, and so forth. When you have clicked on something up here, selection options appear below. Those selection options are specific to whatever you clicked above, going down further you have the buttons that let you save or delete your view. If you start doing something and decide you just want to stop and get out of it, you can also click Cancel. Finally at the bottom, we have the Preview, so you can see your view before you save it, and all of the query and performance details that I mentioned earlier which are very useful for administrators.

There is one other piece up to the top and toward the side and that's to add additional displays. As I mentioned you can turn a View into a page, a block or a feed. The last thing we are going to do before we leave is we are going to go back to our view and clean up after ourselves, a list of views we have, and delete that temp view just like so. Easy, huh? Yeah, I know, not that easy but it will be easy I promise. If you are the sort of person who learns best by doing, you could just go ahead and start poking around Views' many, many options and read some of the documentation that's in Advanced help. But then when you are done with that, come back to the course and learn about a lot of the subtleties in Views that might escape your attention and that aren't really in all of that documentation.

Show transcript

This video is part of

Image for Drupal 6: Online Presentation of Data
Drupal 6: Online Presentation of Data

50 video lessons · 11242 viewers

Tom Geller
Author

 
Expand all | Collapse all
  1. 12m 56s
    1. Welcome
      1m 12s
    2. Reviewing requirements
      3m 35s
    3. Using the exercise files
      3m 11s
    4. Touring examples of data visualization
      4m 58s
  2. 27m 56s
    1. Planning data structure
      8m 26s
    2. Importing and manipulating data
      6m 40s
    3. Looking at Drupal's database
      6m 13s
    4. Deciding whether to store personal data as nodes or users
      6m 37s
  3. 1h 13m
    1. Understanding the Content Construction Kit (CCK)
      4m 57s
    2. Creating new content types with CCK
      7m 26s
    3. Hiding the Body field
      2m 46s
    4. Reflecting CCK field data in the Title field
      7m 28s
    5. Managing CCK field placement
      7m 34s
    6. Exploring CCK's other features
      8m 22s
    7. Using other CCK field types
      3m 25s
    8. Adding date information as a CCK field
      8m 43s
    9. Including images as CCK fields
      10m 23s
    10. Connecting content to existing nodes
      5m 58s
    11. Using taxonomies to categorize and group data
      5m 59s
  4. 53m 54s
    1. Understanding why views are useful
      6m 12s
    2. Using SimpleViews to create basic content views
      5m 49s
    3. Diving into the Views interface
      11m 16s
    4. Adding fields to a view
      7m 12s
    5. Understanding iconic controls in the Views interface
      7m 15s
    6. Surveying the Sort, Filter, and Field options in Views
      5m 40s
    7. Adding view displays as pages, blocks, and RSS feeds
      10m 30s
  5. 43m 34s
    1. Overriding default settings on view displays
      8m 56s
    2. Attaching more information to views
      10m 57s
    3. Improving view appearances with grid, list, and table formatting
      9m 20s
    4. Surveying other basic display settings in Views
      11m 3s
    5. Altering a view's appearance through CSS
      3m 18s
  6. 55m 8s
    1. Importing, exporting, and cloning views
      6m 9s
    2. Controlling access to views
      7m 19s
    3. Learning from built-in views
      5m 52s
    4. Creating views that aren't based on nodes
      10m 6s
    5. Extending views with arguments
      10m 17s
    6. Extending views with relationships
      7m 2s
    7. Going further with relationships
      8m 23s
  7. 46m 40s
    1. Understanding geographic data
      4m 26s
    2. Setting up the Location module
      16m 20s
    3. Entering geographic data with the Location module
      10m 10s
    4. Displaying basic maps with the GMap module
      6m 43s
    5. Integrating the GMap module with Views
      9m 1s
  8. 54m 21s
    1. Exporting data in tabular form
      11m 25s
    2. Planning with the calendar modules
      11m 31s
    3. Using the Charts module and Google Charts
      7m 11s
    4. Graphing data with Open Flash Chart
      4m 50s
    5. Making important data pop out with tag clouds
      7m 46s
    6. Putting it all together in an attractive package
      11m 38s
  9. 36s
    1. Conclusion
      36s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now "Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Drupal 6: Online Presentation of Data.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.