I created a page titled 'Overview' and then I set it to be the 'home' page, but then I noticed that it actually changed the name of my group to 'overview'. It also changed my pathauto alias to match the 'overview name.

I tried again with the name 'home', but I had the same result.

CommentFileSizeAuthor
#1 fix_homepage_group_name.patch880 bytesjimthunderbird

Comments

jimthunderbird’s picture

StatusFileSize
new880 bytes

Hi Clifford,
Thanks for pointing out this issue.
Attached is a patch to fix it. Could you apply it and see if it solved the problem?

Best Regards,
Jim

meecect’s picture

ok, I think it's better, but not perfect. Now, my group name stays the same, as it should, and my group alias stays the same, as it should.

However, when going to my group home, the bread crumb is incorrect. My group is called 'Test Group' and the test page I made is called 'Test Page' and is set to be the home tab. So now, my breadcrumb reads "Home >" where it used to read "Home > Group > Test Group"

Further, the text in the home tab (the tab title) still says 'Home' which might be by design, but the page title (directly above the tabs) says 'Test Page', and shows that for each of the tabs, although the breadcrumb behavior seems to be slightly different on each tab. Some just say "Home>", Some say "Home > Test Title", and my other groups that don't have a new home tab set usually consistently say 'Home > Group > Group Name'

liquidcms’s picture

maybe my issue isn't quite the same but seemed close enough i'd mentioned here.

I would like my group home page to have the title of my group. Is there anyway to have og_panels not mess that up.

My only options seem to be set panel home page title - which doesn't support tokens so i get that static text as my home page title OR leave the field blank in which case i get no title.

I applied patch above - no help.

I have the latest -dev version.

liquidcms’s picture

also, maybe partially related - why doesn't the panel title take the View title? i seem to need to Override every pane or else it picks up the Page title. - bu maybe i should raise this as sep issue?

jakchapman@groups.drupal.org’s picture

I don't understand changing the node title at all. To me, the fact that the tab is active is enough indication and I'd rather the title continue to be the group name. I just commented out both lines that change the node title (808 and 816) and now it seems to behave as I would intuitively expect. Is there something functional I'm missing as to why the node title is being changed?

chrisschaub’s picture

I could see how being able to set the homepage title might be a good thing for some situations. What about having an option to let folks set the homepage to "None" and then check for that:

else{
          $result = db_query("SELECT page_title FROM {og_panels} WHERE nid = %d AND published = 1 AND default_page = 1", $node->nid);
          $row = db_fetch_object($result);
          if(is_object($row)){
            if ($row->page_title != 'None') {
              $node->title = $row->page_title;
            }
          }
        }
goose2000’s picture

Yeah, don't throw out the Group's Name. Without that, do really even have a group at all? Without the context of the Group's Name, you just have a bunch of nodes tossed about.

goose2000’s picture

So I have circumvented this problem by removing most of the function. I do not want this module destroying the Group's Name. Now my Group Name is displayed persistently across all the tabs:

I guess I still need the switch for handling the 'delete' case.

/**
 * Implementations of hook_nodeapi
 *
 * On node load, make sure non-Home page panel pages have their title set correctly
 */
function og_panels_nodeapi($node, $op) {
  switch ($op) {
    case 'load':
      
      break;
    case 'delete':
      if ($og_panels = og_panels_get_all($node->nid)) {
        foreach ($og_panels as $og_panel) {
          og_panels_delete($og_panel->did, $node->nid); //make sure when deleting a group, the url alias are deleted as well
        }
        $sql = "DELETE FROM {og_panels} WHERE nid = %d";
        db_query($sql, $node->nid);
        drupal_set_message(t('Organic groups panel pages deleted.'));
      }
      break;
  }
}
goose2000’s picture

There is another competing function in all of this as well. I commented out the line near the bottom,
// drupal_set_title($node->title);

And now, I can get a persistent Group Name (done in a block) and also have the tabs change the page title too. I then made some logic so that on the group home page, my group_name_block is not displayed there, as I would being showing the Group's name twice.

There is a lot of messin with $node->title in this module.

/**
 * Title callback for tab menu items
 *
 * This takes input from both the menu tabs, and a home page override.
 *
 * It also sets the page title back to being the node name, and sets the tab to "home" in the event of no homepage override.
 */
function og_panels_tab_title($node, $tab_num = 1, $view = FALSE) {
  if (!is_object($node)) {
    $node = node_load($node);
  }
  if (!og_is_group_type($node->type)) {
    return t('View');
  }
  $tab = og_panels_node_data($node->nid, $tab_num);
  if ($view && empty($tab['default_page'])) {
    return t('Home');
  }
  else {
    // does this really do what is intented? code seems strange.
    // drupal_set_title($node->title);
    return $tab['page_title'];
  }
}
danielm’s picture

Subscribing