Hi,
I am trying to find my way in the CTools plugin system, trying to create my own "content_types" plugin.
I found some documentation here,
http://drupal.stackexchange.com/questions/33336/how-does-one-create-a-ne...
and looked at examples in ctools/view_content/plugins/content_types/.
Most of the plugins use the $plugin = array(..) type of definition, as described in the stackexchange tutorial.
However, the views_panes.inc does not use this mechanic, and instead uses a hook_ctools_content_types().
This hook is not documented anywhere.. maybe it's a synthesized hook aka hook_ctools_PLUGIN_TYPE ?
I don't actually know if I will need this hook.. but still would be a good idea to document, wouldn't it? :)
Comments
Comment #1
merlinofchaos CreditAttribution: merlinofchaos commentedHuh. This *used* to be documented. That doc actually got removed somewhere along the way. That's sad.
It's a special way to declare a plugin that is safe if your plugin file might get included at a time when it is *not* being included as the plugin. (Because the file can only be included once, the $plugin array disappears on subsequent attempts to include).
Comment #2
donquixote CreditAttribution: donquixote commentedEither way, I finally got it to work!
(flavor text)
This is a going to be a pretty cool module:
Similar role like a field formatter, but uses values from different fields of an entity, instead of one. But you don't have to hardcode those field names.
So you can make a reusable "image with link and subtitle" template that uses an image field, a link field, and a text field, without hardcoding the field names in the template. Instead you get a dropdown to choose fields that match.
All of this is built on top of ctools content_types.
(/flavor text)
Comment #3
MustangGB CreditAttribution: MustangGB commented