How may I add a tab item in an OG that shows a Content Type related to that group? We have Drupal Commons 3 (on Drupal 7). In our groups, I'd like at add a tag near the group's title that links to a certain content types. I have a View ready to go. How might I add that view to an OG tab?

Update and screen shots:

So I have this view: 


I had hopped to create a new tab here:



By playing with this setting:
Hope this will help you,

In Drupal 7, you can achieve this using creating a new MENU item via programmatically OR by VIEWS.

Programmatically:


Create a menu item

function test_menu() {
  ....
  //menu for shows a Content Type related to that group
  $items['node/%/og-content-type'] = array(
  'title' => 'OG content type',
  'page callback' => 'get_og_content_type',
  'page arguments' => array(1),
  'access callback' => 'og_content_type_access',
  'access arguments' => array(1),
  'type' => MENU_LOCAL_TASK,
  'weight' => 5,
  );
  ...
  return $items;
}

Now give access to the tab

function og_content_type_access($etid) {
  if (access) {//check your condition. Based on this condition the TAB will show.
    return TRUE;
  }
  else {
    return FALSE;
  }
}

Now its time to embed your view

function get_og_content_type($etid) {//Im passing ID in case you want in views.
  $html = '';
  $html = views_embed_view('VIEWNAME', 'display_id', $etid);//embed view
  return $html;
}



Reference : views_embed_view

Using Views:


Just create a new VIEW, with path as node/%/YOUR_PATH, Contextual filters and Permission. Refer the images below


Create a NEW menu TAB now


Add Contextual filters, based on this filter the VIEWS content changes.


Final result




To create a custom permission in VIEWS, you can use PHP filter.


Go to admin > modules and enable PHP filter
Go to your VIEW >> Page settings >> Access and select PHP filter and add this code without PHP TAGS.

  if (arg(0) == 'node' &amp;&amp; is_numeric(arg(1))) {
    $entity_type = 'node';
    $etid = arg(1);
    if ($group = og_get_group($entity_type, $etid)) {
      return TRUE;
    }
    else {
      return FALSE;
    }
  }









NOTE :


You can create you own permission using hook_permission and you can use that permission in VIEWS >> Page settings >> Access