diff --git a/help/plugins-implementing.html b/help/plugins-implementing.html index ea62aa2..b748b79 100644 --- a/help/plugins-implementing.html +++ b/help/plugins-implementing.html @@ -1,6 +1,7 @@ -

To implement plugins, you need to implement a single hook in your module to tell the system where your plugins live, and then you need to implement one or more .inc files that contain the plugin data.

+

There are two parts to implementing a plugin: telling the system where it is, and implementing one or more .inc files that contain the plugin data.

-

Telling it where your plugins live

+

Telling the system where your plugins live

+

How a module implements plugins

To implement any plugins at all, you must implement a single function for all plugins: hook_ctools_plugin_directory. Every time a module loads plugins, this hook will be called to see which modules implement those plugins and in what directory those plugins will live.

@@ -30,13 +31,13 @@ plugins/
         my_content_type.inc
     layouts/
         my_layout.inc
-        my_laout.css
+        my_layout.css
         my_layout.tpl.php
         my_layout_image.png
 
-

How a theme can implement plugins

-

Themes can implement plugins if the plugin owner specified that it's possible in its hook_ctools_api_TYPE() call. If so, it is generally exactly the same as modules, except for one important difference: themes don't get hook_ctools_plugin_directory(). Instead, themes add a line to their info file:

+

How a theme implements plugins

+

Themes can implement plugins if the plugin owner specified that it's possible in its hook_ctools_plugin_type() call. If so, it is generally exactly the same as modules, except for one important difference: themes don't get hook_ctools_plugin_directory(). Instead, themes add a line to their .info file:

 plugins[module][type] = directory
@@ -54,6 +55,6 @@ $plugin = array(
 );
 
-

Several values will be filled in for you automatically, but you can override them if necessary. They include 'name', 'path', 'file' and 'module'. Additionally, the plugin can owner can provide other defaults as well.

+

Several values will be filled in for you automatically, but you can override them if necessary. They include 'name', 'path', 'file' and 'module'. Additionally, the plugin owner can provide other defaults as well.

After this array, if your plugin needs functions, they can be declared. Different plugin types have different needs here, so exactly what else will be needed will change from type to type.