Drupal 7.3.4 Views Made Simple

I have had to struggle to learn Views. Geller's Drupal 7 Essentials Training shows a different interface compared to what you see in Drupal 7.3.4. Other resources get so complicated, it's hard to know what to do. So here is an extremely simplified tutorial on setting up views.

If you want the full ride, see https://www.youtube.com/watch?v=3L9JLZOb_LQ. It's a ten-part show on Drupal 7 Views using our version!

Installing and configuring Views

You'll need to get, install, and enable the two modules required for views. I've spplied the URLs for your convenience:

  1. In your Drupal site as admin, go to Modules, and click contributed modules.
    This takes you to https://www.drupal.org/project/project_module.
  2. Enter views in the Search Modules field and click Search.
  3. In the Views area, scroll to Downloads, right-click on tar.gz (1.57 MB) in the green area, and select Copy URL Location (in Firefox). As of December 2014, 7.x-3.8 is the version for Drupal 7.3.4.
    http://ftp.drupal.org/files/projects/views-7.x-3.8.tar.gz
  4. Back at your Drupal site, click Install new module, paste that URL into the Install from a URL, and click Install.
  5. Use the same routine to get and install ctools. You can use this URL as the URL location to copy and paste.
    http://ftp.drupal.org/files/projects/ctools-7.x-1.5.tar.gz
  6. In your Drupal site as admin, go to Modules, and enable these new items under Chaos Tools Suite and under Views, except for Chaos Tools (CTools) AJAX Example and Chaos Tools (CTools) Plugin Example.

To see whether this all turned out right, click Structure and scroll down to Views.

Views with Drupal-supplied content types

I wanted everybody to see each other's basic pages and articles; Views was the answer. Here's how:

  1. Click Structure > Views.
  2. Click Add new view.
  3. Give your new view a name (spaces are okay), leave Content as is, and for type select Basic page.
  4. In the Create page area, enter the same name you entered previously. Although you may not need it, give a machine name to your new view, for example, my-new-view.
  5. Click the Create block checkbox. Your entries should automatically appear in the the Create block fields.
  6. That's it! No other settings necessary. Click Save & exit.
  7. You now have to enable your new view. Go to Structure > Blocks.
  8. Find your new view; it will be prefaced with View:, and select an area of your Drupal front page on which to display it, for example, Sidebar first.

On your front page, you should see your new view with all your basic pages listed there. Try creating a new basic page; it should automatically be listed in your new view once you've created it.

Note: Everything here assumes that we want to place the newly created view as a block on the front page. We need to know how to do this on nonfront pages.

Views with custom-created content types

I really had to learn Views in order to enable you to list the URLs to your own Drupal sites. That involved creating a new content type.

  1. To create a new content type, click Structure > Content types.
  2. Click Add content type.
  3. Give it a name; spaces are okay. Description not necessary.
  4. Click Publishing options and uncheck Promote front page.
  5. Click Menu settings, uncheck all. Main menu should be the only one checked; uncheck it!
  6. Create one or two instances of that new content type.
  7. Now the process is same as in the above section except for one detail. To repeat, click Structure > Views.
  8. Click Add new view.
  9. Give your new view a name (spaces are okay), leave Content as is, and for type select the content type you just created.
  10. In the Create page area, enter the same name you entered previously. Although you may not need it, give a machine name to your new view, for example, my-new-view.
  11. Click the Create block checkbox.
  12. That's it! No other settings necessary. Click Save & exit.
  13. You now have to enable your new view. Go to Structure > Blocks.
  14. Find your new view; it will be prefaced with View:, and select an area of your Drupal front page on which to display it, for example, Sidebar first.

On your front page, you should see your new view with all your custom-created content types listed there. Try creating a new one; it should automatically be listed in your new view once you've created it.

Programs and information provided by hcexres@prismnet.com.