I have created a custom filter which displays some select options to the user in order to filter a view. However, I am uncertain how to add this using the hook_views_data() hook, being that the table which the filter is being applied to is a CCK table called content_type_sm_mention.
Currently I have the following, which I am not sure is right. What is missing?
function smd_views_data()
{
$data = array();
$data['content_type_sm_mention']['sentiment'] = array(
'title' => t('Sentiment'),
'help' => t('Filter by mention sentiment.'),
'real field' => 'field_mention_sentiment_value',
'group' => t('Content'),
'filter' => array(
'handler' => 'views_handler_filter_sentiment',
),
);
return $data;
}
function smd_views_handlers() {
return array(
'info' => array(
'path' => drupal_get_path('module', 'smd') . '/includes/views',
),
'handlers' => array(
'views_handler_filter_sentiment' => array(
'parent' => 'views_handler_filter',
),
),
);
}