Filter events by months
muthukris - July 3, 2009 - 06:59
Hi friends,
Myself Muthukrishnan,am new to drupal,hope you people could guide me to learn drupal.Now have some doubt. Can anybodies tell me that how to implement this features like "Display the list of months on the right hand side of the page to filter events by month selected. "
this is tht link "http://www.lmitechnologies.com/main/media"

Hi, You can use Archive
Hi,
With Views, it's easy to do a 'Monthly Archive'.
If you are using Drupal 5 then check this link,This view creates a block which will contain a list of months including the number of posts per month; if there are enough months it will contain a [more] link. Each link goes to a simple teaser view for that month.
http://drupal.org/node/52037
If you are using Drupal 6 you can import this view code:
$view = new view;
$view->name = 'archive';
$view->description = 'Display a list of months that link to content for that month.';
$view->tag = 'default';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('sorts', array(
'created' => array(
'id' => 'created',
'table' => 'node',
'field' => 'created',
'order' => 'DESC',
'granularity' => 'second',
'relationship' => 'none',
),
));
$handler->override_option('arguments', array(
'created_year_month' => array(
'id' => 'created_year_month',
'table' => 'node',
'field' => 'created_year_month',
'default_action' => 'summary asc',
'style_plugin' => 'default_summary',
'style_options' => array(
'count' => 1,
'override' => 1,
'items_per_page' => '30',
),
'wildcard' => 'all',
'wildcard_substitution' => 'All',
'title' => '%1',
'relationship' => 'none',
'validate_type' => 'none',
'validate_fail' => 'not found',
'default_argument_type' => 'fixed',
),
));
$handler->override_option('filters', array(
'status' => array(
'id' => 'status',
'table' => 'node',
'field' => 'status',
'operator' => '=',
'value' => 1,
'group' => 0,
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'relationship' => 'none',
),
'type' => array(
'operator' => 'in',
'value' => array(
'blog' => 'blog',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'type',
'table' => 'node',
'field' => 'type',
'relationship' => 'none',
),
));
$handler->override_option('access', array(
'type' => 'none',
'role' => array(),
'perm' => '',
));
$handler->override_option('title', 'blog archive');
$handler->override_option('use_pager', '1');
$handler->override_option('row_plugin', 'node');
$handler->override_option('row_options', array(
'teaser' => TRUE,
'links' => TRUE,
));
$handler = $view->new_display('page', 'Page', 'page');
$handler->override_option('path', 'archive');
$handler->override_option('menu', array(
'type' => 'none',
'title' => '',
'weight' => 0,
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'weight' => 0,
));
$handler = $view->new_display('block', 'Block', 'block');
$handler->override_option('arguments', array(
'created_year_month' => array(
'id' => 'created_year_month',
'table' => 'node',
'field' => 'created_year_month',
'default_action' => 'summary asc',
'style_plugin' => 'default_summary',
'style_options' => array(
'count' => 1,
'override' => 0,
'items_per_page' => '30',
),
'wildcard' => 'all',
'wildcard_substitution' => 'All',
'title' => '%1',
'relationship' => 'none',
'validate_type' => 'none',
'validate_fail' => 'not found',
'default_argument_type' => 'fixed',
),
));
$handler->override_option('use_ajax', '1');
$handler->override_option('block_description', 'Archive list');
$handler->override_option('block_caching', -1);
Thanks
Rashmi
Hi Rashmi
lots of thanks to your reply,but can you tell me that where i need to import this code
Regards,
Muthukrishnan
elapital Solution