Hi all!
Is there a tutorial/documentation on the Views implementation of handlers?
I am trying to convert https://www.drupal.org/project/views_cumulative_field
but running into Views telling me that the handler cannot be found once applied.
Hi all!
Is there a tutorial/documentation on the Views implementation of handlers?
I am trying to convert https://www.drupal.org/project/views_cumulative_field
but running into Views telling me that the handler cannot be found once applied.
To be honest, I don't know if this works in Backdrop - I had copied the info file from D7. In D7, here's the explanation:
https://www.drupal.org/docs/7/creating-custom-modules/writing-module-inf...
@argiepiano - please could you explain what:
dependencies[] = views:views
does as opposed to:
dependencies[] = views
I did the latter in a custom views module and it works. Also, I've not come across that syntax when looking at module development.
And of course you also have to modify the info file as in:
name = Views Cumulative Field description = Views field that calculates the per-row cumulative value of another field in your view backdrop = 1.x type = module dependencies[] = views:views
Notice that the "files[]" is not needed, as the handler is loaded by autoload.
Hi onyx. The handler looks very straighforward and should work with some minimal modifications:
function views_cumulative_field_autoload_info() { return array( 'views_handler_cumulative_field' => 'includes/views_handler_cumulative_field.inc', ); }
That should be it...
And of course you also have to modify the info file as in:
name = Views Cumulative Field description = Views field that calculates the per-row cumulative value of another field in your view backdrop = 1.x type = module dependencies[] = views:views
Notice that the "files[]" is not needed, as the handler is loaded by autoload.
@argiepiano - please could you explain what:
dependencies[] = views:views
does as opposed to:
dependencies[] = views
I did the latter in a custom views module and it works. Also, I've not come across that syntax when looking at module development.
To be honest, I don't know if this works in Backdrop - I had copied the info file from D7. In D7, here's the explanation:
https://www.drupal.org/docs/7/creating-custom-modules/writing-module-inf...
Thanks, man! The autoload_info was the missing magic :-)
Hi onyx. The handler looks very straighforward and should work with some minimal modifications:
replace `drupal_set_message()` with backdrop_set_message()
That should be it...