Start learning with our library of video tutorials taught by experts. Get started
Viewers: in countries Watching now:
Drupal's built-in data presentation tools offer several ways for web designers to clearly and attractively package their data. In Drupal 6: Online Presentation of Data, Tom Geller explains how Drupal handles data so users can set up intelligent structures and implement them with Drupal's Content Construction Kit. Tom also shows how a data-driven web site can improve its interactivity by using geographic data to connect real-world addresses to maps. Exercise files accompany the course.
Up until now you have been creating and changing your view in a vacuum or you can see it in the preview area at the bottom of the Views Administration page, the information doesn't actually appear anywhere on your site where it can seen by people who aren't administrators. You have in fact only been changing the default display, which is sort of a philosophical ideal. This is how it works. In your Views Administration window you see this display area up here and there is only thing listed, Defaults. And in fact you see the word Defaults throughout the screen, up here, you scroll down, in the preview it shows you the display of the defaults and so forth.
The Default Display is sort of like the model on which other displays are created, sort of like a rubber stamp, but instead of just stamping something that's exactly the same it can stamp out a page, or a block, or an RSS feed. You can leave that page looking exactly the same as your default or you can make it look just a little bit different by overriding certain aspects of that Default Display. We'll show you how to do that in the video on overriding default settings on View displays. For now we'll just show you how to make that page, block and feed.
So let's go back to our View and add a display, you saw me do this in another video. Now we'll go into it a little bit more in detail. You have a selection here of what sort of thing you would like to add, Block, Page, Feed. We'll talk more about attachments and date browsers in other videos but right now we'll just talk about those three. We are going to add a page. So you select Page and click Add Display. There are several differences on this display as opposed to the default display, and if we switch back and forth among them you can see. First the Default display has everything in ordinary Roman text, whereas Page has it in the Italics. That actually becomes important later on when we start overriding these things.
A display item that's in Italics means that it's exactly the same as the default. That is, nothing has been changed. It's part of that philosophical ideal so to speak. But once it becomes Roman that means it's its own thing, and again we'll show you that when we start overriding these things. Another difference between the Page and Default display is this area down here Page settings. Obviously a page needs a little bit more information, for example where it lives, its path, and if you'd like to add a menu item somewhere on the screen you can do that too with this menu. Let's actually go ahead and add that path, we click here where it says Path: None and we are going to make this path, people, seems appropriate since it is after all the name of the view, and it's what we are going to be showing people when they click on it.
Click on Update and we've created our page, and incidentally that error that we had down here went away, it warns us that we needed to have a path to go to the page we created. Another difference you will notice between the Page display and the Defaults display is this little Remove display button up here. Let's say you start creating your page in the site you've done it all wrong. If you click on Remove display you'll get rid of it. So be careful in using it, but it is useful to keep from having many displays build up that you don't really need. Before we do anything else I want to save this view, and go back to our list.
This is another difference once you start adding displays. Here in the list you'll see that it has a path and in fact you can go to that page very easily from here by just clicking on that link, and there it is. The view that we created is now showing up on a page. We can edit that view just by going up here to Edit or, of course, we could go back in our Browser. I'm just going to go Edit and then List so we can see that again. The other thing that you'll notice is the list of all the different displays here. In our case we only have one, the Page, but if you look at some other ones that are built into Views is a block and a page, and sometimes there can be multiple pages with multiple paths and so forth.
Now let's go back to edit our view and add a block. We click on Edit, choose the kind of display we want, a Block, and Add display. Once again we have something specific to the Block display down here in Block settings. The admin setting here is how that block will appear in our Block pages, and I'll show you how that works in just a moment. I'm going to call this People block and scroll down to Update, and then once again we save, and go back to our list.
Now we see that we have a block and a page, but how do we access that block? You may remember from the Drupal Essential Training Course that it's very easy. In the Site building section there is a Block's page, and if we scroll down to the bottom we see all of the blocks that were created but that are disabled, and one of them is the people block. Let's put that in the right-hand column, just to see what it looks like. We do that and click Save blocks, and there it is. So now we have it both as a page and as a block. For now I'm going to go back to our Views and edit that again.
There is one other kind of display I want to tell you about, which is feeds. A feed is something that allows you to put out your website's information in a format that others can subscribe to in many different ways. For example some people subscribe to it using live journal or another online site. So they go to their homepage and they see all of the items that you added to your site because they were piped to that other site through our access. Others use readers such as Apple Mail so that they see your items in their mailbox just like an ordinary piece of mail. All you need to do to add the display is go to this pop-up to Feed and add the display.
Scroll down a little bit. We have this little section here with things that are specific to the feed. Let's click on path and add a path to it because they usually appear as their own page. There is a bit of explanatory text down here saying just how you should probably name that feed, and also that you can take arguments into that feed. We'll discuss arguments in a separate video. So right now we are just going to call this people/feed, and then click on Update, and we get an error down here. This is actually peculiarity with the Feed display in Views. We get this error here saying that it requires a row style but the row plug-in is invalid. What does that mean? Well, if you look up here you'll see this Row style selection, Missing style plug-in. If we click on that it really should have automatically said yes, there is only one option, and that's the one we want, but as I say Views has its quirks.
So we'll select Node, click Update and then we get additional options for how we want the RSS feed to appear. I'm going to leave it in the default, but I'm going to come back to this and change it in just a minute. Click on Update, good, and I'm going to save it one more time. Now when we go back to our list we see we have a block, a page, and a feed, and if we click on Edit we can actually go to those pages very easily by clicking on these links here. Let's go to the feed and see exactly what that looks like. It looks sort of strange. That's because it's showing the complete node including our original headshot in its ridiculous size. The feed display I have to say in Views is write now fairly limited in what it can do. We can change this to make it look better, but we don't have as many options as we do in pages or blocks. You can get some more options with some modules that you download from drupal.org, but for now let's just go back and make this a little bit better. So we hit the Back button, and before we go on I want to point out one place that people often get thrown in Views.
We went back to look at our view and edit it and we think, oh, we are still editing the feed. But notice up here it's actually showing us the defaults. If we start editing now we are going to change the defaults, which in turn will change the page, the block, and the feed. This is the biggest area of trouble for people when they first start using Views. So be sure to always look up into that little area and make sure you are editing exactly what you mean to be editing. I am going to go to Feed again, click on Row style options, that's this little gear, and change that so it just shows the title. You could also have it show the title plus teaser and so forth, but I'll just have it to show the title.
Click on Update and Save. Now let's take a look at our feed. That looks a lot better. So now have our feed looking pretty good, let's go back to our view. I'm going to add one more display to point out a somewhat confusing area of how this interface works. I'm just going to say Date browser. That's something that was added by the Date module, which we installed in another video. Click on Add display, scroll down a bit, and I don't think I actually want to add that. So I click on Remove display. Now you might expect that to disappear immediately, but actually it doesn't. Once again Views doesn't commit itself until you click Save. Instead what you have is this changed view up here and if you look the button has changed to restore display.
So it gives you a chance to go back and correct your errors. But in our case we actually do want to get rid of it. So I'll click Save and now we see that that display we just added has actually disappeared. There are two last things I'm going to do. The first is I want to rename these displays. Instead of just calling it Page I'm going to change it to say Page for family and you do that by clicking on this Name link here, scrolling down, and say Page for family. In another video we'll show you how to restrict access so we'll have two separate pages both going to the same path, only those authenticated users who have a log-in on the system will see one page, well, everyone else will see another page with less information. But the first step is to change the name, so you can tell one page from another. I click on Update. If I scroll back up to the top I see we have that Page for family right there, go down and save it.
The very last thing that I wanted to do before we leave here is to get that
block out of the right-hand column. That's easy enough to do Administer, Site
building, Blocks. Scroll down a little bit and move it to
In any case the lessons you learned in this video sets you free to make your Views get away from that philosophical ideal of the default display and actually make your Views live on your site.
Find answers to the most frequently asked questions about Drupal 6: Online Presentation of Data.
Here are the FAQs that matched your search "":
Q: The exercise files for the course appear to be missing.
A: Full exercise files for this course were not provided because of the unusually large amount of images, modules, and other files that would have to be installed in specific places, in addition to the database. We hope to have a solution for future Drupal courses that installs all items in their correct places.
Sorry, there are no matches for your search ""—to search again, type in another word or phrase and click search.
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.