Skip to content Skip to navigation

Improved "My Groups" View

Posted by: 
Topics: 

I had a hard time getting the default OG My Groups block view to work, so I made the following mods. if you want to use this in your site, open /admin/build/views then the Import tab, into which you can paste the following:

$view = new stdClass();
$view->name = 'og_my_block';
$view->description = 'List user\'s subscribed groups and provide link to manage subscription';
$view->access = array (
0 => '2',
);
$view->view_args_php = '';
$view->block = TRUE;
$view->block_title = 'My Projects';
$view->block_header = '';
$view->block_header_format = '3';
$view->block_footer = '';
$view->block_footer_format = '3';
$view->block_empty = '';
$view->block_empty_format = '3';
$view->block_type = 'list';
$view->nodes_per_block = '16';
$view->block_more = FALSE;
$view->block_use_page_header = FALSE;
$view->block_use_page_footer = FALSE;
$view->block_use_page_empty = FALSE;
$view->sort = array (
array (
'tablename' => 'node',
'field' => 'title',
'sortorder' => 'ASC',
'options' => '',
),
);
$view->argument = array (
array (
'type' => 'rss_feed',
'argdefault' => '2',
'title' => '',
'options' => '',
'wildcard' => '',
'wildcard_substitution' => '',
),
);
$view->field = array (
array (
'tablename' => 'node',
'field' => 'title',
'label' => '',
'handler' => 'views_handler_field_nodelink',
'options' => 'link',
),
);
$view->filter = array (
array (
'tablename' => 'node',
'field' => 'status',
'operator' => '=',
'options' => '',
'value' => '1',
),
array (
'tablename' => 'og_uid',
'field' => 'currentuidsimple',
'operator' => '=',
'options' => '',
'value' => '***CURRENT_USER***',
),
array (
'tablename' => 'og_views',
'field' => 'og_type',
'operator' => '=',
'options' => '',
'value' => '0',
),
);
$view->exposed_filter = array (
);
$view->requires = array(node, og_uid, og_views);
$views[$view->name] = $view;