Can we build a views filter by quote author?

Comments

Anonymous’s picture

I figured it out, go into quotes.views.inc and

ADD:

    'filter' => array(
      'handler' => 'views_handler_filter_string',
    ),

INTO:

  // Author.
  $data['quotes_authors']['name'] = array(
    'title' => t('Author'),
    'help' => t('The name of the quote\'s author.'),
    'field' => array(
      'handler' => 'views_handler_field_quotes',
      'click sortable' => TRUE,
      ),
    'sort' => array('handler' => 'views_handler_sort'),
   // ADDED BY MORNINGTIME 
   'filter' => array(
      'handler' => 'views_handler_filter_string',
    ),
    // END
    'skip base' => 'quotes',
  );

The same trick can be used for citation and bio.

nancydru’s picture

You can also filter in the module http://www.example.com/quotes/author.

nancydru’s picture

Status: Active » Fixed

Committed to 6.x-1.x-dev.

Just out of curiosity, why are you using Views?

Anonymous’s picture

I needed two exposed search fields, to filter by quote and author. I built it with views. Something like:

Search in quote [ ] Search in author [ ] APPLY | RESET

Status: Fixed » Closed (fixed)

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