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.

Building the Styles Settings Form

Video loading...

Join Drupalize.Me to watch this video

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

Log in Sign up
  • 0:00
    Building the Styles Settings Form
  • 0:01
    with Amber Matz
  • 0:07
    The selling point of a CTools Style Plugin is the settings form.
  • 0:12
    By providing a settings form to the site editor who can then change
  • 0:15
    the style of the pane using a preapproved set of styles,
  • 0:19
    you can both empower and provide appropriate constraints.
  • 0:23
    In this lesson, we'll use the form API
  • 0:25
    to build a settings form containing options
  • 0:27
    for both pane background styles and heading styles.
  • 0:31
    Since it's a settings form and using the CTools API,

Building the Styles Settings Form

Loading...

The selling point of a CTools Style Plugin is the settings form. By providing a settings form to the site editor who can then change the style of the page using a pre-approved set of styles, you can both empower and provide appropriate constraints.

In this lesson, we will:

  • Use the Form API
  • Build a Styles Settings Form

By the end of this lesson, you should be able to build a settings form for your CTools Style Plugin.

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

The code for this plugin and module is located in sites/all/modules/demo_panestyles. See Companion Files to download the Files export, which also contains a demo site for Lessons 8-19 of Building Websites in Drupal 7 with Panels. Log in at /user with username "admin" and password "admin."