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

Using the exercise files

Using the exercise files provides you with in-depth training on Developer. Taught by Jon Peck as par… Show More

Drupal 7 Custom Module Development

with Jon Peck

Video: Using the exercise files

Using the exercise files provides you with in-depth training on Developer. Taught by Jon Peck as part of the Drupal 7 Custom Module Development
please wait ...
Using the exercise files
Video Duration: 3m 30s 2h 57m Advanced


Using the exercise files provides you with in-depth training on Developer. Taught by Jon Peck as part of the Drupal 7 Custom Module Development

View Course Description

Extend your Drupal 7 sites with custom modules, which allow you to create everything from admin interfaces to forms. Author Jon Peck describes how modules extend your base Drupal installation, then walks through how to write your own module with a practical example featuring geo-positioned alternative energy centers. The course also describes how to control access to site features, create new content types, build forms, understand data persistence, embrace coding standards, and much more.

Topics include:
  • Creating your first module
  • Interacting with hooks
  • Working with permissions and roles
  • Controlling access
  • Adding a menu item to an admin interface
  • Using the Form API (FAPI) to quickly create a form
  • Creating custom form validation
  • Manually creating a custom content type
  • Validating user input
  • Importing content using feeds
  • Creating a block
  • Understanding best practices and coding standards
Developer Web

Using the exercise files

In this course, I'll be developing a module that will extend the functionality of an existing Drupal 7 site installation. The recommended configuration is PHP 5.3 or above, Apache 2 or above, MySQL 5 or above, and Drupal 7.15. Other web servers such as Nginx or IIS should function, but will not be supported. Future versions of Drupal 7 should be compatible with the code written in this course, but we'll not be explicitly supported.

Setting up an AMPP stack is beyond the scope of this course. If you do not already have a development server I recommend using a local development server running on your workstation. The Up and Running with Linux for PHP Developers course here in the online training library will allow you to have an optimized virtual server running like any other program in your existing operating system. I will be demonstrated using a server created using this technique. Alternatively, you can use a web server solution stack packaged in your native operating system.

XAMPP from has distributions for Linux, Windows, Mac OS X, and Solaris. WampServer from is explicitly for Windows and MAMP from is for Mac OS X only. Each of these packages will allow you to execute the exercises found in this course. Installing additional software within your native operating system is covered in the course installing Apache, MySQL, and PHP with David Gassner here in the online training library.

If local development is not an option, third-party hosted servers that have the appropriate versions of PHP, MySQL, and Apache also support Drupal 7. The exercise files for this course are contained in folders by chapter and movie. On my workstation, I have them in a folder named sandbox that my virtualized Linux server can access. Depending on your web server configuration you may need to store these files in a different place such as on a remote web server or in a folder accessible by local Apache, MySQL, and PHP stack.

All custom development will take place in one folder; sites/all/modules/custom/windfarm. The first folder contains the entire web root. And each following exercise folder will contain the start state of the windfarm directory for each movie. Premium subscribers have access to a customized Drupal installation profile which was used for the site install in the recording of this course. There is no functional difference between this installation profile and the standard installation profile.

The only changes relate to the design and the inclusion of the exact versions of the contributed modules used in this course. A Drush Make file used to download the contributed modules into the installation profile is freely available to all subscribers. But no support will be provided for its use. Finally, you will need some sort of editor or integrated design environment to edit your PHP scripts. I will be demonstrating with a free PHP editor NetBeans 7.2 for I strongly recommend setting up NetBeans using the community maintained guide at

This will configure support for Drupal's naming conventions and standards. A final note. As different web hosting configurations serve content from different URLs, the address you see in my browser may not exactly match what you see on your workstation.

Find answers to the most frequently asked questions about Drupal 7 Custom Module Development .

Expand all | Collapse all
please wait ...
Q: gmap3_tools is not working the way I expected it to. What version of gmap3_tools should I be using?
A: Use the free exercise file containing the version of gmap3_tools used for recording; the published version of the module on has changed since recording and is not backwards compatible.
Q: I attempted to run the Drupal site root from the project files, but the site isn't loading. Why not?
A: The Drupal configuration file in sites/default/settings.php contains database configuration specific to the environment used to record the movie. This may be different than your environment. Edit the file and search for "windfarms" - you may need to change the database host, username, password, db name and port to match your specific environment.





Don't show this message again
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


You have completed Drupal 7 Custom Module Development.

Return to your organization's learning portal to continue training, or close this page.


Upgrade to View Courses Offline


With our new Desktop App, Annual Premium Members can download courses for Internet-free viewing.

Upgrade Now

After upgrading, download Desktop App Here.

Become a Member and Create Custom Playlists

Join today and get unlimited access to the entire library of online learning video courses—and create as many playlists as you like.

Get started

Already a member?

Log in

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:

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.

You started this assessment previously and didn’t complete it.

You can pick up where you left off, or start over.

Resume Start over

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 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 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

Sign up and receive emails about 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.