I can't find any documentation on what 'views data' operation do in hook_field_settings(). Is it the same as 'views' operation in Drupal 5?

Thanks.

Comments

ztyx’s picture

Oh, crap. I meant filters not views.

yched’s picture

Status: Active » Fixed

It's rather an equivalent of the D5 hook_field_settings($op = 'tables'). The other views-related ops ('filters', 'arguments') are gone.
It lets your field type specify how the field's data should be exposed to Views.

If your field doesn't implement the hook, the result of content_views_field_views_data() (defined in include/views/content.views.inc) will be used.
I'd suggest not implementing the 'views data' op, see how your fields get exposed to views using those 'sensible defaults', and then, only if needed, implement the op to adjust to your field type's specific needs.
In such case, it can be useful to have your implementation of hook_field_settings('views data') call content_views_field_views_data() and start from there to fine tune what you get, rather than starting from scratch. See how nodereference does this, for instance.

Obviously, this will require some acquaintance with Views, Views API and handlers, and hook_views_data()

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.