tags:

views:

257

answers:

1

I have a drupal view I've created for events, each event has a date field I'd like to create a way either in the view itself or via the API to have an option for users to select all events, past events or future events. I've created a basic filter event_date > now which works, however I can't seem to change this to event_date < now via the views API.

A: 

I think you should create a module for that. Acces the api and use it. You should see this pages also:

http://api.drupal.org/api/function/hook_form_alter/6

http://api.drupal.org/api/function/hook_filter/6

http://api.drupal.org/api/function/hook_elements/6

http://api.drupal.org/api/function/hook_block/6

http://api.drupal.org/api/function/hook_action_info/6

function theme_test_form($form) {
  $output = '';
  $output .= drupal_render($form['name']);
  $output .= '<div class="foo">';
  $output .= drupal_render($form['access']);
  $output .= '<div class="bar">';
  $output .= drupal_render($form['details']);
  $output .= '</div></div>';
  $output .= drupal_render($form);
  return $output;
streetparade