[development] Views custom style plugin

ad4m adam at ludwinski.net
Thu Aug 6 16:30:10 UTC 2009

Thanks Earl, you were right. I just added the 'path' item to the plugin
definition array and it works.
Though I think it's not clear where the files should be placed. According
the specification the path is optional and should be provided only if the
handler files are placed in different directory the the
module_name.views.inc file.

Kindest regards,
Adam Ludwinski
mobile: +48 606 107 297
adam.ludwinski at meant4.com

2009/8/6 Earl Miles <merlin at logrus.com>

> ad4m wrote:
>> Hello!
>> I'm trying to write my custom plugin for Views 2.0. I've found some
>> documentation on that, I followed the instructions and I'm facing a strange
>> problem.
>> Here is what I've done:
>>   1. I've implemented the views_api hook in my module file
>>   2. I've created the module_name.views.inc file in the module's main
>>      directory
>>   3. In the .inc files I've implemented the views_plugins hook
>>   4. The hook views_plugins returns an array with 'style' index
>>      containing an aray with all required parameters.
>>   5. Than I've created a file handler_name.inc and implemented a class
>>      handler_name extending the base views_plugin_style class
>>   6. At the end I created a template file for my custom style plugin
>> Everything looks fine, I can my custom style plugin from the views'
>> interface. *But everytime I'm selecting my own style plugin and clicking
>> update, nothing happens! Style plugin remains unchanged.*
> This usually means it wasn't able to load the plugin object. Be sure
> everything in your hook_views_plugins is correct and that the 'parent' line,
> in particular, was correct.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.drupal.org/pipermail/development/attachments/20090806/a0e7c8db/attachment-0001.htm>

More information about the development mailing list