Creating a View filter for a CCK field 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' =&gt; t('Sentiment'),
      'help' =&gt; t('Filter by mention sentiment.'),
      'real field' =&gt; 'field_mention_sentiment_value',
      'group' =&gt; t('Content'),
      'filter' =&gt; array(
        'handler' =&gt; 'views_handler_filter_sentiment',
      ),
    );
    return $data;
}
function smd_views_handlers() {
  return array(
    'info' =&gt; array(
      'path' =&gt; drupal_get_path('module', 'smd') . '/includes/views',
    ),
    'handlers' =&gt; array(
      'views_handler_filter_sentiment' =&gt; array(
        'parent' =&gt; 'views_handler_filter',
      ),
    ),
  );
}
To find out what is missing, implement hook_views_data_alter() and dsm($data) in the function to find the right path for your field.