I use Drupal6 and Views2.
My problem is that I want to operate with fields from diferent tables (and modules). Can this be achieved just with hook_views_data()?
On Tue, Aug 25, 2009 at 3:44 PM, Seth Freachsfreach@gmail.com wrote:
Lluís,
First, what version of Views are you using?
If Views 1 (Drupal 5): what you need then is for your custom module to implement hook_views_tables(). That is how you tell the views module about your data and define fields and filters that are available to it. start here: http://drupal.org/node/99564 and read through to part 5: Filters.
If Views 2 (Drupal 6): you need to use hook_views_data() which you can read more about here: http://views-help.doc.logrus.com/help/views/api-tables. from that documentation page, in the Describing Fields On Tables section: "... each table can also have an unlimited number of field designations; these correspond roughly to fields on the table, though it is very common to use non-fields to display data that isn't directly in a field, such as data arrived from formulae..." be sure to have a look at http://views-help.doc.logrus.com/help/views/api as well for info on using hook_views_api() and where the other views hooks should be placed.
Seth