Hi,
I'm upgrading a drupal 5 site to drupal 6.
There is a dummy table in hook_views_tables.
function mymodule_views_tables() {
$tables = array(
// this is a placeholder...not really a table at all
'mymodule_dummy_table' => array(
'fields' => array(
'mymodule_myfield' => array(
'name' => t('My module: myfield'),
'notafield' => true, // this is a virtual field
'handler' => 'mymodule_field_myfield',
),
),
),
);
return $tables;
}
And mymodule_field_myfield function is:
function mymodule_field_myfield($fieldinfo = null, $fielddata = null, $value = null, $data = null) {
if ($data->nid) {
return theme('view', 'test_view1', null, null, 'embed', array($data->nid));
}
}
And below is drupal 6 coding:
<?php
function mymodule_views_data() {
// this is a placeholder...not really a table at all
$data['mymodule_dummy']['table']['group'] = t('My module');
$data['mymodule_dummy']['mymodule_myfield'] = array(
'title' => t('My module: myfield'),
'field' => array(
'handler' => 'mymodules_field_myfield',
'click sortable' => false,
),
);
}
function mymodule_views_handlers() {
array(
'handlers' => array(
'mymodules_field_myfield' => array(
'parent' => ????, // what goes here??
),