Discussion on creating a group based calendar. Has anyone gotten this working, if so how do you do it...
My View $view = new stdClass();
$view->name = 'og_calendar';
$view->description = 'Calendar view for a group';
$view->access = array (
);
$view->view_args_php = '';
$view->page = TRUE;
$view->page_title = 'Calendar';
$view->page_header = '';
$view->page_header_format = '1';
$view->page_footer = '';
$view->page_footer_format = '1';
$view->page_empty = '';
$view->page_empty_format = '1';
$view->page_type = 'calendar';
$view->url = 'node/$group/calendar';
$view->use_pager = FALSE;
$view->nodes_per_page = '0';
$view->menu = TRUE;
$view->menu_title = 'Calendar';
$view->menu_tab = TRUE;
$view->menu_tab_weight = '0';
$view->menu_tab_default = FALSE;
$view->menu_tab_default_parent = NULL;
$view->menu_tab_default_parent_type = 'tab';
$view->menu_parent_tab_weight = '0';
$view->menu_parent_title = '';
$view->block = TRUE;
$view->block_title = 'Calendar';
$view->block_header = '';
$view->block_header_format = '1';
$view->block_footer = '';
$view->block_footer_format = '1';
$view->block_empty = '';
$view->block_empty_format = '1';
$view->block_type = 'calendar';
$view->nodes_per_block = '999';
$view->block_more = TRUE;
$view->block_use_page_header = FALSE;
$view->block_use_page_footer = FALSE;
$view->block_use_page_empty = FALSE;
$view->sort = array (
);
$view->argument = array (
array (
'type' => 'calendar_year',
'argdefault' => '2',
'title' => '%1',
'options' => '',
'wildcard' => '',
'wildcard_substitution' => '',
),
array (
'type' => 'calendar_month',
'argdefault' => '2',
'title' => '%2',
'options' => '',
'wildcard' => '',
'wildcard_substitution' => '',
),
array (
'type' => 'calendar_day',
'argdefault' => '2',
'title' => '%3',
'options' => '',
'wildcard' => '',
'wildcard_substitution' => '',
),
array (
'type' => 'gid',
'argdefault' => '2',
'title' => '',
'options' => '',
'wildcard' => '',
'wildcard_substitution' => '',
),
);
$view->field = array (
array (
'tablename' => 'node',
'field' => 'title',
'label' => 'Title:',
'handler' => 'views_handler_field_nodelink',
'options' => 'link',
),
array (
'tablename' => 'node_data_field_start_date',
'field' => 'field_start_date_value',
'label' => '',
'handler' => 'date_views_field_handler_ungroup',
'options' => 'default',
),
);
$view->filter = array (
array (
'tablename' => 'node',
'field' => 'status',
'operator' => '=',
'options' => '',
'value' => '1',
),
array (
'tablename' => 'node',
'field' => 'type',
'operator' => 'OR',
'options' => '',
'value' => array (
0 => 'calendar_item',
),
),
array (
'tablename' => 'og_ancestry',
'field' => 'picg',
'operator' => '=',
'options' => '',
'value' => '***CURRENT_GID***',
),
);
$view->exposed_filter = array (
);
$view->requires = array(node, node_data_field_start_date, og_ancestry);
$views[$view->name] = $view;
I get a page not found when I click the tab in the group. Any Ideas?
Comments
I upgraded to 6.x but still
I upgraded to 6.x but still cant quite figure it out. Anyone Have any ideas?
I got it....
Forgot to add the CCK date fields as fields
could you explain
Could you explain what you did to get it work? I've been trying forever to figure this out, and am not having any luck. The views info you posted above, is that for D5 or D6?
The view above was for 5.x. I
The view above was for 5.x. I decided to start fresh and go with 6.x. I had a hard time figuring out the date argument, but you need to add the cck date fields to the fields.
Here is my view for 6.x
Thanks
Thanks for the reply. I'm unable to import your view though, I keep getting an error about node_data_field_start_date.field_start_date_value not being available. I have, however, managed to at least get a group calendar functioning to the point where it shows content only to a member of a specific group.I just can't seem to get the path to work properly. I used node/%/calendar like you have in yours, but whenever I try to go to that path for a group, ie node/100/calendar, I just get the group's front page, not the calendar. If I hardcode the path to be node/100/calendar, it works fine....any ideas?