Skip to content

Drupal hooks & Plugins

Marie-Louise edited this page Jan 16, 2019 · 4 revisions

this is the tutorial I'm following:

https://www.morpht.com/blog/how-create-ctools-content-types-drupal-7

Drupal hooks are functions which are used to extend Drupal or it's core modules. the module needs to implemented for a hook for drupal to be extended.

Drupal comes with a list of hooks pre-prepared hooks to be used.

Create a custom plugin

Ctools is a

“Tools to make it easy for modules to let other modules implement plugins from .inc files.”

the plugins are usually kept in here >

`Sites/corporate/www/sites/all/modules/custom/<plugin_name>

Plugin example with guidance

you can find samples of a plugin within the ctools directory:

/Sites/corporate/www/sites/all/modules/contrib/ctools

and then

/Sites/corporate/www/sites/all/modules/contrib/ctools/ctools_plugin_example

and

/Sites/corporate/www/sites/all/modules/contrib/ctools/ctools_plugin_example/plugins

next steps:

create plugin folder with content type folder nested in - the plugin lives here

then enable your module, the plugin will be customised.

then create a content type

Clone this wiki locally