Poplar ProductivityWare Articles:
Custom Content Types in Drupal
A Video Tutorial
by Jennifer Hodgdon

On April 26, 2008, I gave a presentation at LinuxFest Northwest on how to create custom content types in the Drupal web-site content management system. The talk was recorded on video, and is available for viewing on-line:

I also gave the same (or very similar) talk at Drupal Camp Vancouver, on May 9, 2008. If you'd like me to come give this talk to you, please contact Poplar ProductivityWare.

Unfortunately, it is very difficult to read the overhead screen in the video. So, below you can find the information from the Background Information, Outline, and Planning sections of the talk, as well as screen shots from the rest of the talk. You may want to refer to these as you watch and listen to the talk.

There is also an "extra credit" section below, which didn't make it into the video.

If you are unfamiliar with Drupal, you may also want to check out the Background Information before viewing the video.


Background Information


Outline

  1. Planning data/content types
  2. Creating data/content types - Content Construction Kit
  3. Creating vocabularies/categories - Taxonomy
  4. Data entry
  5. Displaying data/content types - Views and Blocks
  6. Menus [note: there wasn't time to cover this in the talk]

Planning

Example: Web site for an organization that offers art classes, taught by several instructors.

Types of information/content:

Information Displays (Views):


Screen Shots for Creating Content Types

(Click on a link or small image to see the screen shot.)


Screen Shots for Taxonomy

(Click on a link or small image to see the screen shot.)


Screen Shots for Data Entry

(Click on a link or small image to see the screen shot.)


Screen Shots for Views

(Click on a link or small image to see the screen shot.)


Adding Block Views to a Page

This didn't make it into the video - it's the "extra credit" section on how to make views show up on page.

Here are the steps for making the "Upcoming Classes" section appear on the Individual Instructor page (see screen shot of Individual Instructor page above):

  1. Whenever you enter content for an Instructor, be sure to give it a path (URL) of instructor/something. Screen shot:
  2. Define the view. This will be a "block" view, rather than the "page" view demonstrated previously in the talk, but the fields section and filters work the same as the previous view. It will need an "Arguments" section, though, which is new -- what this will do is make it so that only the classes being taught by the particular instructor we are looking at are shown. We use some special "Argument Handling Code," which finds the instructor's internal Drupal ID number, and tells the view that this is the instructor we are interested in. See the Contextual View Blocks Snippet on drupal.org for more information. Screen shot:
  3. Once that view is saved, it will appear in the Blocks management screen. So go to Administer / Site Building / Blocks. Find the "Upcoming Classes for Instructor" block in the list of blocks, assign it to the "Content" region of the page (which will display it below the body and fields of that piece of content in most themes), and click "Save Blocks". Screen shot:
  4. Finally, we need to make it so this block only appears on Instructor pages, not every page of the site. To do that, click Configure next to the "Upcoming Classes for Instructor" block, and tell Drupal to display this block only on pages with URLs like "instructor/whatever". Screen shot:

Poplar ProductivityWare: your Seattle-area source for web databases, web programming, Palm OS applications, and analytical/modeling software

Home | Web Programming | Custom Software | Articles | Downloads | Testimonials | Values | Contact Us

Poplar ProductivityWare® is a trademark registered in the U.S. Patent and Trademark Office

Copyright (C) 2003-2008 Poplar ProductivityWare LLC

On This Site:

Home: See an overview of the company

Web Programming: Find out how we can improve your web site

Custom Software: Learn about our custom Palm OS and analytical software services

Articles: Get free information on a variety of topics

Downloads: Download free software

Testimonials: See what other clients have said

Values: Learn about the values that govern our business, and read our privacy policy

Contact Us: Locate our phone, email, and mailing addresses


RSSRSS Feed: Keep track of our new articles and downloads by subscribing (learn about RSS here)


Search the Poplar ProductivityWare site using Google: