Viewers: in countries Watching now:
In this course, author Tom Geller demonstrates how to use the Views module and other add-ons in Drupal to present dynamic, data-rich content. This course examines several real-world examples of effective data visualization and describes the Drupal data-storage model. The course also shows how to create, format, and style views; control access to data; improve data administration with Views Bulk Operations; and display content as custom maps and slide shows.
Now that we started poking around the Views interface a little bit you've probably noticed the overwhelming amount of fields available for display, sorting and filtering. I'd like to take a few minutes to look through them so you can get a sense of the patterns that tie them all together. Although there are dozens of fields with lots of different settings you'll find that there are some similarities that make them easier to understand. To start as usual we go up to Structure and Views. I'm going to open up the Employee list page in an extra tab here so we can switch back and forth if we like.
This is the way that I generally like to work. Then I'm going to go down and edit that View. As we scroll down to the Preview area we get a sense of what it's going to look like. Notice however that the appearance actually changes when you go back to that front page, that has to do with the theme although the basic information is the same. We'll go back to our View. We now have three fields in our View; we added them in the video diving into the Views interface. We can edit any of them by going up to this Fields area here and clicking them.
In general, when you edit a field the settings are in five groupings. The one up here at the top is the most general grouping. Create a label and Exclude from display tends to be the same pretty much no matter what fields you add, Link to the original piece of content is more or less special to the title part although you will see it in some other fields. These other ones Style Settings, No Results, Rewrite, and More you can open by clicking on their links and see all of the different things in there. Some of them expand when you check their checkboxes, like so.
We'll go into all of these in a little bit more detail in the video Adjusting the Settings of Individual Fields in a View. But for now I'm just going to cancel out. Now let's go back and add a field. Here we see that huge list of all of the field types that you can add and as I've mentioned before there's the Filter here and you can Search for the individual field type here. I want to talk a little bit more about this Filter. Most of the criteria that are relevant to specific fields are in the Content group here. When I select it you see that it includes such things as the Family name, the First name, Employee photo.
These are fields that we added earlier on in the course. In general they fall into five groups. The first criterion is actual fields. This is what I just showed you, the photo, the family name, the first name and so forth, and if we look at our list back here we see that it has Appears in: that means it's an actual field, whereas this Edit link does not actually appear in anything, it's what's called metadata that's attached to the field. The second kind is Static metadata. These are the things that don't change and it's easier to understand what that is if we look at the Dynamic metadata.
For example, when something was last updated if there are any new comments and so forth. If we go back to our list you can see what we're talking about. For example, Last comment author and Last comment time are examples of dynamic metadata, whereas Link is an example of something that's static. It's specific to that field but it doesn't change over time. The fourth kind is Control links. You might've noticed that there are some things here that lets you edit the content. So you can actually create a view for administrator's that lets them quickly click on an Edit link and go back and change the content itself.
There is also a Delete link and a few other things like that available. Finally, we may have some other kinds of links that are defined by modules. If we go back to our list here and go back up to the top and change this Filter to Feeds item you'll see some of the criteria that appeared only because we installed the Feeds module earlier on in the course. Now the Field settings that you see depend very much on the fields that you add. To demonstrate I'm going to add an employee photo to this View as I've done a few times in this course already. I'll go to Content then I'll search for photo, and there it is, we add it and Add in configure fields.
You might remember before we only had three options up here. It was Exclude from display, Link to node and Create label, but here since it's an image we can also change the way that it's formatted and the style, and in fact, I'm going to change this to a thumbnail because you might remember some of those graphics were really big, and if we leave it in original image it'll just fill the entire screen. Finally, we can decide whether we want to make that image clickable. I'll say yes and I'll link it to the file itself. I'll Apply and scroll down to our preview to see what that looks like.
Yeah, I like that a lot. And you might remember, by the way, that we earlier added a filter so we're only showing those that have photos. I'm actually going to remove that now. Now we see all of the employees, including those that don't have photos. Finally, I'm going to move things around a little bit. I've never really liked that we had the ID here and that's how you get to the full information about the person. So I'm going to move the photo over to that location, remove the ID and make it so that instead of seeing the file when you click on this you see the actual record.
First, I'll go up and Save and see what it looks like on our page. Yup, it looks pretty much as we expected and if you click on any of these now you just see the file itself. Let's go back and change that. Go down to Fields and rearrange. On this page you can not only move things around, you can also remove them. So I'll remove the Title, and remember, this only removes it from the View, it doesn't affect any of the underlying data. Then I'll move the photo up to the top and save it by clicking Apply.
Finally, I'll change what that photo links to by clicking on photo and then saying Link image to the Content and Apply. Then to be sure we'll look at our Preview. Yup! It looks pretty good. Save it and check it out on the page itself by reloading. Yup! That's exactly what I want to happen. Once again, I recommend at this point that you take some time to explore all of those field types that look interesting to you, that's what I did when I first discovered Views and I found that learning the quirks among them gave me a sense of what could be displayed and the limits of what I'd have to work with.
It was like adding colors to my palette and from time-to-time I still go back and re-explore all of the colors that are available to me in Views.
There are currently no FAQs about Drupal 7: Reporting and Visualizing Data.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
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.