Check your version

This video covers a topic in Drupal 7 which may or may not be the version you're using. We're keeping this tutorial online as a courtesy to users of Drupal 7, but we consider it archived.

Alternate resources: 

Creating a configuration settings form for your module

Video loading...

Transcript language code: 

Join Drupalize.Me to watch this video

Join today and gain instant access to our entire video library.

Log in Sign up
  • 0:08
    In the previous chapter, we discussed hook_form_alters.
  • 0:11
    And in the example, we altered a form to make sure users did not use the password,
  • 0:16
    password, 12345, or love, and it was a hard-coded array that we created.
  • 0:21
    And in this chapter, instead of using a hard-coded array,
  • 0:25
    we actually want to make a configuration form
  • 0:28
    so administrators can add to, augment, or change that list.
  • 0:33
    A system settings form, when you click admin, will show up there in the list,
  • 0:37
    of all possible things an administrator can do on your site.
  • 0:41
    So to get started, we actually need to first create a page for these.
  • 0:47
    So I'm going to go into my code,

Creating a Configuration Settings Form for Your Module


This video goes through the process of creating a configuration form in order to save settings to the variables table in the database, and how to integrate those variables into your module.


The $item array in the function demo_menu() should be named $items, to match the return $items; line. (Either that or return $items; should be fixed to return $item;.) Just make sure the array you are building matches the name of the variable you are returning.

Log in or sign up to download companion files.
Additional resources: