Responsive Design with Drupal
Illustration by John Hersey

Integrating responsive tables into Drupal


From:

Responsive Design with Drupal

with Chaz Chumley

Video: Integrating responsive tables into Drupal

When you think about in Drupal, you may not always think about tabular data. But in general, there are only two places you may have tabular data to work with. The first is the end user, creating tabular data using the WYSIWYG inside a node or a block, the other is the output of the view of data from various content types. In this section we will cover tabular data in views and how to modify the HTML for our needs so that we can apply the responsive table's techniques we learned in the previous movie. To begin with, I am already logged in, but if you need to log in, do so at this time and then go ahead and navigate over to Structure and Views.
Expand all | Collapse all
  1. 3m 19s
    1. Welcome
      51s
    2. Using the exercise files
      1m 25s
    3. Exploring the finished project
      1m 3s
  2. 16m 30s
    1. Installing Acquia Dev Desktop
      3m 37s
    2. Importing a Drupal website
      4m 7s
    3. Restoring database snapshots with the Backup and Migrate module
      3m 13s
    4. Understanding the Devel module
      5m 33s
  3. 5m 48s
    1. What is responsive design?
      3m 32s
    2. Understanding adaptive design
      2m 16s
  4. 15m 33s
    1. Discovering fixed-width layouts
      3m 47s
    2. Understanding breakpoints
      3m 33s
    3. Using Adapt.js with Drupal
      8m 13s
  5. 27m 21s
    1. Discovering fluid layouts
      3m 43s
    2. Exploring fluid widths
      8m 34s
    3. Working with fluid margins and padding
      7m 41s
    4. Making text fluid
      7m 23s
  6. 16m 37s
    1. Discovering fluid images
      3m 5s
    2. Exploring fluid image techniques
      5m 6s
    3. Working with fluid media techniques
      8m 26s
  7. 21m 36s
    1. Introduction to media queries
      3m 2s
    2. Writing our first media query
      6m 10s
    3. Creating a style sheet for each breakpoint
      3m 53s
    4. Understanding media query best practices
      8m 31s
  8. 8m 14s
    1. Introduction to responsive menus
      2m 32s
    2. Creating a responsive menu
      3m 5s
    3. Integrating responsive menus into Drupal
      2m 37s
  9. 14m 52s
    1. Introduction to responsive tables
      1m 25s
    2. Creating responsive tables
      7m 30s
    3. Integrating responsive tables into Drupal
      5m 57s
  10. 21m 6s
    1. Introduction to responsive forms
      3m 9s
    2. Creating responsive forms
      8m 30s
    3. Integrating responsive forms into Drupal
      9m 27s
  11. 6m 38s
    1. Adding min-width and max-width support with Respond.js
      2m 35s
    2. Exploring context-aware image sizing
      4m 3s
  12. 1m 11s
    1. Next steps
      1m 11s

Start your free trial now, and begin learning software, business and creative skills—anytime, anywhere—with video instruction from recognized industry experts.

Start Your Free Trial Now
please wait ...
Watch the Online Video Course Responsive Design with Drupal
2h 38m Intermediate Jan 11, 2013

Viewers: in countries Watching now:

In this course, Chaz Chumley takes you through the process of transitioning a Drupal website to a responsive model that automatically tailors and sizes content for a wide range of displays, from desktops to mobile devices.

The course starts with setting up the Drupal environment in Acquia and defines some basic principles of responsive design before moving on to creating a new Drupal theme with fluid layouts, fluid media, and responsive tables and forms. Chaz also covers writing media queries, which allow you to create different style sheets for each device type.

The course wraps up with a look at Respond.js and content-aware image sizing in Drupal—responsive design tools that can optimize your project for maximum performance.

Topics include:
  • What is responsive design?
  • Understanding fixed-width vs. fluid layouts
  • Working with fluid margins and padding
  • Writing a media query
  • Creating responsive menus and forms
  • Adding min- and max-width support with Respond.js
Subjects:
Developer Web
Software:
Drupal
Author:
Chaz Chumley

Integrating responsive tables into Drupal

When you think about in Drupal, you may not always think about tabular data. But in general, there are only two places you may have tabular data to work with. The first is the end user, creating tabular data using the WYSIWYG inside a node or a block, the other is the output of the view of data from various content types. In this section we will cover tabular data in views and how to modify the HTML for our needs so that we can apply the responsive table's techniques we learned in the previous movie. To begin with, I am already logged in, but if you need to log in, do so at this time and then go ahead and navigate over to Structure and Views.

In order to do this technique, I actually need to create a view first. so I am going to go ahead and click on Add new view, I am going to give this View a name of tables, and then this is going to be a Content Of Type All. I am going to create a page called tables with the Path of tables and the Display Format is going to be Table of fields. From here I am going to click on Continue & edit, and right now if I scroll down all I have is a table of the Titles of the content that is currently inside my Drupal instance, I want to add a couple of more columns.

Let's go to FIELDS, click on add, Filter the Content, and let's look for the Author uid. We'll go ahead and select that click Apply, leave the defaults and click Apply (all displays). Now if I scroll down I have two columns of data. Let's go ahead and add one more column. Scroll back up to FIELDS, click on add, Filter the Content, and this time let's look for let's say the Last comment author. Go ahead and select that, click on Apply (all displays), Apply (all displays) again, and now I should have three columns of data. That works for me.

Go ahead and scroll back up and click on Save. Now that I have a view that has tabular data in it, let's go ahead and browse to that page real quick and see what we have. Remember, this is called tables, so if I go to the tables page--here you go--I see a table of tabular data on this particular page, and if I go to resize it, I am back to the squishy squeezed-in problem that we have with most tables. Let's go ahead and open up the Chrome developer tools, let's go ahead and inspect the table, and if we notice here we have this class of views-table cols-3 which may help us while doing some theming; however, I need to be able to put the class of responsive on here, and currently the only way to do this is by actually creating a views template. Let's take a look at how to do that.

Go ahead and close the Chrome developer tools, let's go back to Structure > Views, click on and edit for our tables view, and then over on the Advanced tab if I expand that and scroll down I see a section called Theme, and if I click on Information, this shows me the output of the theme for this particular view, and I can modify these by creating copies of these either with the default view names that are specified in bold or by creating any of the view names here that I have.

This particular time, I am going to want to create a template for views-view-table.tpl.php. Let's see how we would go about doing that. Go ahead and close this, and let's go ahead and tab over to our editor real quick, and I want to show you something. Inside our theme we actually have a templates folder, and these are some of the templates that were set up just for demonstration purposes for this series. If I expand views, I can see that I already have some templates in there, but I do not have one for views-view-table, so how do I know exactly what goes inside that? Well, if I scroll up to sites/all/modules and expand the modules folder and then the views folder and then look under theme, I can see some default templates that I can use, and one of them is actually views-view-table.

I am going to open that, I am going to copy the contents, I am then going to close the folder, close the views folder, close the modules folder, go back to my templates, right-click on views, and say New Text Document. I need to call this views-view-table.tpl.php. With that created, I am going to copy the contents from that other view and then paste it inside of it. I'll go ahead and hit Save and then scroll up and take a look at what we have.

This says this is a template to display a view as a table, and I can actually see the table and some classes that are being used. For demonstration purposes, I really don't care about these other classes that are being applied, so I am actually going to remove this, and then I'm actually going to hand code class="responsive" similar to what we did inside the WYSIWYG. However, this time I am going to save it, and if I tab back over to my browser, flush the cache, and then browse back over to that page, open up the Chrome developer tools real quick, and let's inspect this table.

Now I have a table with a class of responsive, and the nice thing about using the template in method is any view that I create, that I choose to use as tables, will now have this class, and with that previous technique that we learned, all the tables will now be responsive. Let's close the Chrome developer tools, resize this, and see what we get. There is our scrollbar for our content, there's a scrollbar for our column if our column has information in here that's too wide. Responsive tables do not take a lot of work to accomplish, but we need to make sure we don't overlook them when designing in Drupal.

Knowing how to modify the HTML output and then apply the appropriate CSS or jQuery is just a small task to ensure that our Drupal 7 design is responsive. One more thing we want to take a look at before we can be proud that our Drupal design is completely responsive is forms. Let's take a look at responsive forms now.

There are currently no FAQs about Responsive Design with Drupal.

 
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.

* Estimated file size

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 Responsive Design with Drupal.

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 ?

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 preferences from 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.

Learn more, save more. Upgrade today!

Get our Annual Premium Membership at our best savings yet.

Upgrade to our Annual Premium Membership today and get even more value from your lynda.com subscription:

“In a way, I feel like you are rooting for me. Like you are really invested in my experience, and want me to get as much out of these courses as possible this is the best place to start on your journey to learning new material.”— Nadine H.

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.