Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm building a calendar view for displaying the events per group.
I'm using the first argument to specify which group I want the calendar. Opening the view with a valid group identifier works well, but the argument isn't preserved on all the links of the calendar. Instead of outputting links like "group/calendar///", it outputs "group/calendar//". It just ignores the existence of the first argument.
$view = new stdClass();
$view->name = 'group_calendar';
$view->description = 'Calendar view of any date field';
$view->access = array (
0 => '3',
1 => '4',
2 => '5',
3 => '6',
);
$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 = 'group/calendar';
$view->use_pager = TRUE;
$view->nodes_per_page = '900';
$view->sort = array (
array (
'tablename' => 'node',
'field' => 'changed',
'sortorder' => 'ASC',
'options' => 'normal',
),
);
$view->argument = array (
array (
'type' => 'gid',
'argdefault' => '1',
'title' => '%1',
'options' => '',
'wildcard' => '',
'wildcard_substitution' => '',
),
array (
'type' => 'calendar_year',
'argdefault' => '2',
'title' => '%2',
'options' => '',
'wildcard' => '',
'wildcard_substitution' => '',
),
array (
'type' => 'calendar_month',
'argdefault' => '2',
'title' => '%3',
'options' => '',
'wildcard' => '',
'wildcard_substitution' => '',
),
array (
'type' => 'calendar_day',
'argdefault' => '2',
'title' => '%4',
'options' => '',
'wildcard' => '',
'wildcard_substitution' => '',
),
);
$view->field = array (
array (
'tablename' => 'node',
'field' => 'title',
'label' => 'Title:',
'handler' => 'views_handler_field_nodelink',
'options' => 'link',
),
array (
'tablename' => 'node',
'field' => 'changed',
'label' => 'Updated:',
'handler' => 'views_handler_field_date_small',
),
);
$view->filter = array (
array (
'tablename' => 'node',
'field' => 'status',
'operator' => '=',
'options' => '',
'value' => '1',
),
array (
'tablename' => 'node',
'field' => 'type',
'operator' => 'OR',
'options' => '',
'value' => array (
0 => 'event',
),
),
);
$view->exposed_filter = array (
);
$view->requires = array(node);
$views[$view->name] = $view;
Comments
Comment #1
TSK2006 CreditAttribution: TSK2006 commentedI'm using the last version from the CVS.
Comment #2
KarenS CreditAttribution: KarenS commentedThis is hopefully working right in latest commit.
Comment #3
(not verified) CreditAttribution: commented