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

Improving view appearances with grid, list, and table formatting

From: Drupal 6: Online Presentation of Data

Video: Improving view appearances with grid, list, and table formatting

Way back about a dozen videos ago, I said that things there were going to get ugly for a while before they started looking good and if you've been following along, I'm sure you would agree. Our views have been pretty darn ugly up until now. But this is the moment you've been waiting for. With just a few clicks, the views are suddenly going to look a lot better. It all comes down to the Style option under Basic settings. Up to this point, we've left it on Unformatted, which just basically takes the data and spits it back out. But Views comes with three other options built-in: Grid, HTML List, and Table and some modules, such as the GMap module that we'll look at later, and other styles as well.

Improving view appearances with grid, list, and table formatting

Way back about a dozen videos ago, I said that things there were going to get ugly for a while before they started looking good and if you've been following along, I'm sure you would agree. Our views have been pretty darn ugly up until now. But this is the moment you've been waiting for. With just a few clicks, the views are suddenly going to look a lot better. It all comes down to the Style option under Basic settings. Up to this point, we've left it on Unformatted, which just basically takes the data and spits it back out. But Views comes with three other options built-in: Grid, HTML List, and Table and some modules, such as the GMap module that we'll look at later, and other styles as well.

We'll start by changing the Block display a little. So, the first thing we have to do is go to the Block display, of course, and then we click on Style: Unformatted. Now, again, because it is italics, it has to be overridden or will override the default as well. Scroll down after we click it and click on Override. In our case, we want to change this into an HTML List. Don't worry, we'll look at the Grid and Table formats as well. We click on HTML List and Update and then we get some additional choices. Do we want it as an unordered list or an ordered list? We'll talk about the Grouping field in just a minute. For now I'll leave it as an unordered list. The ordered list version will have 1, 2, 3, 4, instead of just little bullet points. Click on Update and Save and since we have our block already showing in that left-hand column, you can see what it looks like.

It's a typical HTML list. The format of this list incidentally is determined by the theme in Drupal. You could have some themes, which show this is bullet points; others would show it as an icon and so forth. Let's also take a look at that Grid format. We are going to do that on our page view. Let's scroll up and see what it looks like right now. First, we save to be sure, good, and then take a look at the Page for family. I am going to open a new tab by right clicking. On the Mac, you may want to hold down the Ctrl key instead of right clicking and then Open Link in New Tab and let's see what that looks like. Okay, it's unformatted and straightforward.

We'll go back and change that to the Grid view and see what that looks like. First, we want to only effect the Page for family. Again, make sure that we override unformatted and then switch to Grid and click Update. Again, we have some choices, Grouping field, Number of columns and whether it is arranged first by listing them horizontally in order or vertically in order. I'm going to leave it on its defaults. Click on Update and Save and then let's go back to our page and reload. There is our Grid view. The data in the Grid view is now in a four-column table like structure that we wanted, but it really doesn't look great. We could do several things to make it better. For example, we could put space between the cells and make the text aligned to the top. You might notice that it is a little jagged here because it is aligned in the middle.

We won't deal with all that now, but we'll tackle those tasks in a later video about altering a view's appearance through CSS. Instead, we are going to spend our time looking at what is in my opinion by far the most useful of the built-in display styles, Tables. It is by far the most options as you will see, in fact, we are going to make the Table setting the default setting for this view since we'll want to be able to return to it easily after doing formatting experiments later on in the course. So, we'll go up to Edit, go back to our view. Make sure that we are affecting the Default display, of course, and we are going to change that to Table. Just as a reminder, nothing here is in italics because remember, italics means that it is in concordance with the default display. The Default display is always in concordance with the Defaults display. There is no override, so it just shows things as Roman type.

We are going to scroll down and change that to a table and Update. Here we have several options. What I usually do is I make all of my fields Sortable and you will see exactly what this means. You can also put several fields into one column of the table and separate them out. You can play with that as you like and we'll show a little bit more of that later in the course. But for now, we'll leave it mostly as it is in its default. The one thing we'll change, however, is to add the sticky table headers and you will see what that means in just a moment.

Click on Update, great. And since we did this to the default, we immediately see it in the preview down here. Remember how I made certain columns sortable? They automatically are, you just click on wherever the column name is and it resorts according to that column. As always, I like to save it. Now, after I saved it, it returned us to our Page view since that's where we were before. But you see we don't see it as a Table view even though we change the default. That's because we overrode it for the page. I want to make the page reflect the default. So, I'll go back over the ghost menu and edit it. It's already on Page for family and that's good and you see the style is overridden. I'll click on that, scroll down and then click on Table and then Use default. I should mention this is a little peculiarity in the Views administrative interface. If I were to click Use default now, it would actually change the default to Grid. It's a little bit backwards from what you expect. So, I'll just click Table and then Use default and then Update default display and now both the Page and the Defaults are on table. That's the way I wanted.

So, now that we have put our page in concordance with default, let's go back and edit that default. We go up to the ghost menu here, click Edit and then make sure we are on Defaults again. Once we are there, we'll edit the options for the Table setting and scroll down. We already talked about the sortable column here. You will notice that some of these things are not sortable. The headshot obviously isn't sortable because it is a field. It doesn't have anything to sort on; it's not textual information. However, Married to and Relationship are also not sortable. That's because remember those were both node reference fields when we created them in CCK and when you do a node reference, it only pulls over a small piece of information.

Well show you how to make those columns sortable in the videos about Relationships later on. We discussed how some of these things can be put in the same column. Let's do that right now, let's make our headshot in the same column as Name. We just change it here to Name, scroll down and click Update and Save. Just to go back to the page, now we see that both the headshot and the name are together in the same column. It doesn't actually look that good. So, I'm going to return it. We could, however, have put some sort of delimiter between the two such a slash as we did earlier between Date of birth and Married to.

I'll go back and put them back in their own columns. Another setting as you can see is the Default sort. I'm actually going to change this so that it's going to sort automatically by name. Now, you might wonder what happens if you have it sorting by name here, but also have a sort criterion up here. Well, they have to fight with each other and sometimes that does become a problem. Let's see what happens now because as you see up here, we have a Post date sort, but we also have a Name sort here. Scroll down, click Update default display, save it and if you follow it, you can see that the name is the one that went out. So, when you set it on the Table setting, it overrides the sort order you had made elsewhere. Another way to tell that it's sorting a name besides looking through all of the names is by this little arrow up here. If you click on Date of birth, for example, it will sort that way. Click it again.

It sorts in the other direction. So instead of the oldest people being at the top, the youngest are at the top. In our case that's our puppies and kiddies. Now I mentioned earlier that stickiness at the top of the table. That's a nice little JavaScript trick and you can see it when you scroll down. As you can see, we have too many records on this page and if we scroll down without that stickiness, we'll lose exactly what those columns are. With the stickiness, however, as we scroll down, this Name, Date of birth, Married to, all stays there. So, we always know what our columns mean.

The last thing to talk about is that Group by field. Right now we have two people in the database who are twins, Francisco and Francesca. I know, don't you hate when parents do that? We are going to go back to our Table style and group by that Date of birth since they obviously both had the same date of birth. Scroll to the bottom and let's see how that affected us. Well, it groups everybody that was born on the same date. In our case, it's only one person for each date until we get down to Francisco and Francesca since they were born on the same date, they appeared together grouped, and each one of these groups can be sorted individually.

I don't actually like grouping that way so I'm going to go back up and change that option, so we are not grouping by anything. And finally, as always we want to save our view. Now, we are starting to see how to make views attractive as well as functional. The next step in adjusting the views appearance is found in the video I mentioned earlier about altering a view's appearance through CSS. We'll also talk about all of those other miscellaneous doodads under the Basic setting rubric in other videos in this course.

Show transcript

This video is part of

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

50 video lessons · 11224 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.