Question is here

@SomebodySysop,
Maybe you can use some PHP in the block settings with some code. Something like this:

<?PHP
  $top = array();
  $top = og_subgroups_get_all_family($gid, 'up'); // Here you can decide if it is up, down or side.
  if ($top) {
    return TRUE;
}

Let us know if it works for you.

Comments

somebodysysop’s picture

Status: Postponed (maintainer needs more info) » Fixed

Thanks. Modified slightly:

    // Only print this block if groups are found up or down family tree.
	// In other words, do NOT print if there aren't any subgroups in the tree.
    if ($node = og_get_group_context()) {
      $gid = $node->nid;
      $top = array();
      $bottom = array();
      $top = og_subgroups_get_all_family($gid, 'up'); 
      $bottom = og_subgroups_get_all_family($gid, 'down'); 
      if ($top || $bottom) {
        return TRUE;
      }
    }

Works exactly as desired. Block only appears if the group is part of a subgroup tree. Thank you for the quick response.

amitaibu’s picture

amitaibu’s picture

@SomebodySysop
Please note I changed the docs to use a better function og_subgroups_get_family instead of og_subgroups_get_all_family

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.