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.

Understanding the $plugin Array

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
    Understanding the $plugin Array
  • 0:01
    with Amber Matz
  • 0:07
    In order for our CTools Style Plugin to work,
  • 0:10
    we need to add some specific code to our module and plugin files.
  • 0:14
    In this lesson, we'll add a hook to our dot module
  • 0:17
    file telling the CTools API to look for our plugin.
  • 0:21
    Next, we'll walk through the extensive plugin
  • 0:24
    array in our plugins.ink file.
  • 0:26
    I'll explain how each key and value corresponds to the file names,
  • 0:30
    functions, and theme parameters in the plugin.ink file.

Understanding the $plugin Array

Loading...

The sole purpose of our custom module is to implement a hook that will tell the CTools API that we have a plugin. Next, in our plugin's ".inc" file, we'll walk through the extensive $plugin array, understanding how the keys and values of this array correspond to functions and parameters inside the plugin.

In this lesson, we will:

  • Hook into CTools inside custom module
  • Explore $plugin array

By the end of this lesson, you should be able to implement the correct hook for CTools and understand how to customize your own $plugin array.

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