Skip to:
Content
Pages
Categories
Search
Top
Bottom

Group Component Activity


  • Jason Nathan
    Participant

    @jasonnathan

    Hi, I was wondering if any one could point out how to update a Group Component’s Activity in the Group.
    It seems simple enough except that my Group Component IS a group (I have implemented parent / child) groups.

    Just to elaborate:

    Parent groups URLS are like this:

    http://domain.com/groups/Parent_Group_Name

    In there, there are links to {child_groups}, however when user clicks on the child group link, it still navigates to

    http://domain.com/groups/Child_Group_Name.

    So, in a nutshell, my “group component” is essentially a group itself. Meaning it has all BP Group functionality including activities.

    So my question is, how would I link / update “Child Group” Activity streams in the the “Parent Group” stream.

    I have succesfully modified the groups loop to exclude child groups from showing up in the results. (Only Parent Groups are returned if a Child Group is found).

    I tried modifying the activities loop to include child group activities in a parent group loop but my method will mean I would have to rewrite the template tags! A

    Any one have any experience with this?

Viewing 1 replies (of 1 total)

  • Jason Nathan
    Participant

    @jasonnathan

    The groups loop works brilliantly:
    `

    <?php if ( bp_has_groups( bp_ajax_querystring( 'groups' ) ) ) :?>

      <?php
      // get all the ids of all the groups
      global $groups_template, $bp; $group_ids = custom_group_type::get_current_group_ids();

      foreach( $groups_template->groups as $group ):

      //check if child group – )
      // function is_child_group() returns parent group id if true or false if not.

      if( $parent_group_id = custom_group_type::is_child_group( $group->id ) )
      {
      //remove the child group so it doesn’t appear in the main groups loop
      unset( $group );

      // Check if parent group is already in the loop
      if( in_array( $parent_group_id, $group_ids ) )
      {
      continue;
      }
      else
      {
      // if the parent group is not in the loop, initiate it and display it.
      $parent_group = groups_get_group( array( ‘group_id’ => $parent_group_id ) );

      ?>

    • <a href="”>

      <a href="”>

      id ) ?>

      /

      id ) ?>

    • <?php
      }
      }
      // continue with the normal loop
      else
      {
      ?>

    • <a href="”>

      <a href="”>

      id ) ?>

      /

      id ) ?>

    • <?php

      }
      endforeach; ?>

    `

Viewing 1 replies (of 1 total)
  • The topic ‘Group Component Activity’ is closed to new replies.
Skip to toolbar