Alright this is the last issue of the night I swear. Home pages out of the box are said to be on the to do list for the module but I figured until they are implemented I could save people some of the hassle I went through to override the group home pages.

To override the homepage I used the Panelizer module and largely referenced this issue and this issue to make everything work.

The first step is to download and enable panelizer and all the modules it requires. Once that is done you will want to visit structure>pages and enable the node_view option. This is required to make panelizer work.

Next you'll need to create your own module or add some files to the module of your choice. For this example lets say our module is called MyModule. So in MyModule.module you will want to have this function

function MyModule_ctools_plugin_directory($owner, $plugin) {
  return 'plugins/' . $plugin;
}

This tells ctools where where to find the plugin we are going to create for panelizer. After that in your modules folder you will want to create a 'plugins' subfolder and a subfolder in 'plugins' called 'entity'. In plugins/entity you will need to have 2 files group.inc and MyModuleEntityGroup.class.php

In group.inc you will need to define the plugin and some information about it. It is critical that the 'handler' value is the same as your MyModuleEntityGroup.class.php file name. I wasn't really able to uncover what any of these hooks actually do but I haven't run into any issues yet using these settings and they came from the issues I linked above.
In group.inc:

$plugin = array(
  'handler' => 'MyModuleEntityGroup',
  'entity path' => 'group/%gid',
  'uses page manager' => FALSE,
  'hooks' => array(
    'menu' => TRUE,
    'admin_paths' => TRUE,
    'permission' => TRUE,
    'panelizer_defaults' => TRUE,
    'form_alter' => TRUE,
    'views_data_alter' => TRUE,
  ),
);

In MyModuleEntityGroup.class.php a couple basic entity functions are defined and some information about the group entity is provided. All you need to do is replace MyModule with your module name and you should be good.
In MyModuleEntityGroup.class.php:

class MyModuleEntityGroup extends PanelizerEntityDefault {
  public $supports_revisions = FALSE;
  public $views_table = 'groups';

  public function entity_access($op, $entity) {
    return group_access($op, $entity);
  }

  public function entity_save($entity) {
    return group_save($entity);
  }

  public function entity_identifier($entity) {
    return t('This Group');
  }

  public function entity_bundle_label() {
    return t('Group');
  }

  function get_default_display($bundle, $view_mode) {
    return parent::get_default_display($bundle, $view_mode);
  }
}

Now for a disclaimer. I am no panelizer expert so my solution to not knowing what to do was to check all the boxes and it magically worked. All the boxes may not be need to be checked to make things work.

Once you enable your module you are all ready to override the group home page. The configuration page for panelizer is located at configuration > content authoring > panelizer. On that page you should see each of your group types listed with two check boxes. Check both boxes and and then check the next two boxes that appear to the right of the initial boxes and click save. You should see two links appear 'allowed content' and 'list'. On the page you get sent to when clicking 'allowed content' box I checked both boxes. The last important step is to click on the 'list' link and add a new panelizer panel. The default view has no settings in it and does not show anything so you will have to define a new panel. Once you have defined a new panel go back to configuration > content authoring > panelizer and select that panel as the default.Click save and your group homepages are now overridden! Any new groups you create will use the default panel you just assigned and existing groups can have their default changed by editing the group and changing the panel they are using.

Finally for a bit of housekeeping since you are overriding the group home page you probably want to unset all of the page elements that group puts there by default. To do this you need to define or add the following code to your themes hook_preprocess_page. This is what my function looks like.

function MyTheme_preprocess_page(&$variables){
  $t = menu_get_item();
  if(isset($t['page_arguments'][0]->type))
  {
    if($t['page_arguments'][0]->type == 'group_type_machine_name_here')
    {
      $variables['action_links'] = array();
      $variables['tabs'] = array();
      $variables['title_hidden'] = 1;
    }
  }

All of the elements hidden are available to be added as content in panels
Title is available at Content and then place the title in the title box.
The tabs and action links are available as content under the page elements section.

Comments

kristiaanvandeneynde’s picture

Well written and figured out.

I would like to point you in another direction, though: Page manager existing pages + Panels.

It allows you to hi-jack the group/%group path and then use regular old Panels instead. No code required, takes over the page equally nice and then some. (That and I've found Panelizer to be quite buggy at times...)

The only reason you'd want to use Panelizer, IMO, is when you need to lay out your entity when it doesn't have its own page: Teasers, lists created through Views, etc. For that use case, you could even use Display Suite which, unlike Panelizer, supports all custom entities out-of-the-box.

I'll dig some more into Panelizer and if I deem it stable enough, I'll add the functionality you described here to Group.

kristiaanvandeneynde’s picture

Status: Active » Postponed (maintainer needs more info)

Postponing this as of this commit, which adds in Page Manager support out of the box.

I'm still interested in adding Panelizer support, if someone with proper knowledge of its inner workings steps forward and explains the integration to me. It's bad enough already that CTools plugins are so poorly documented :(

Soul88’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

We thank everyone for their collaboration on this issue, but as the D7 version is no longer supported, we will now close all D7 issues to keep the issue queue a bit tidier. This information won't go anywhere, it just won't show up on the list of open issues anymore.

Please see: https://www.drupal.org/project/group/issues/3163655 and https://www.drupal.org/project/group/issues/3203863#comment-14100281 for more details.