Skip to content

Responsive Grid for Views

Angela McMahon edited this page Apr 18, 2017 · 2 revisions

Suitcase_Interim grid example

Overview

Do you have a view with content you would like to display in a responsive grid? This tutorial will show you how you can leverage suitcase_interim's built-in functionality to create your own grid view.

General Tutorial

First, set up your view. Be sure to use the fields view styling setting when setting everything up:

Views settings

After you have a view with all of your desired fields ready, it's time to add classes to our views fields. Click on the settings link under your view's format settings option set. In this dialog box, enter "luggage-gridrow" in the row class text box. Also, be sure to have the striping and views row classes boxes checked You should see something like this: luggage-gridrow settings

Save your settings. Next, we want to add a class to the whole view. Under your view's advanced settings, click on the CSS class setting. Add "luggage-grid" as a class here, like this:

luggage-grid class setting

Save this setting, and then save your view. Go to your view page and double-check that your view is, in fact, styled like a grid now.

Next, we'll explore other styling options available for your suitcase_interim grid.

Additional Functionalities

Green field text -- Unsupported in suitcase_interim 1.0.6

If you'd like a field with some contrast to the rest of the theme, suitcase_interim has styling for green text in views. To make your view field green, you need to add a class to the field.

In the views UI for your view, go to the settings for the field you'd like to color green. Click on the collapsed style settings option set. You should see a series of options about field styling. Check the box for customizing the field HTML. More options should appear. Within these options, check the box labeled with "Create a CSS Class." Here, enter "luggage-gridgreen" for the field class. You should see something like this: luggage-gridgreen settings

You can see this in action on the luggage_people view's position field and the luggage_resources view's URLs.

Up to 4 columns

The responsive grid supports 2, 3, and 4 columns. 2 columns is the default. To use 3 or 4 columns, simply change your views row class name from luggage_gridrow to luggage_gridrow3 or luggage_gridrow4. luggage-gridrow3 settings example

Here's how luggage_gridrow3 will look: three column grid example

And here's how luggage_gridrow4 will look: four column grid example