How to display group discussions in the front page

Hi guys, i am new to Elgg. I read a lot of documentation on Elgg customization and mostly it was suggested that i need to install a custom index plugin. I basically wanted to display latest group discussions in the front page. I got confuesd with all the documentation and other discussions i went through. Could some one tell me where do i start? I am not an expert at html and css, but i can definately give it shot. Kindly help me out. Thanks.

  • Hi Thefornax,

    I would recommend to see Vazco's mainpage plugin, that will allow you to add discussions and many other things in any order that you choose.

    Regards,
    Uddhava dasa

  • Hi Uddhava, Thanks for the suggestion. But Vazco's mainpage plugin is for widgets. I donot want to add the latest discussions as widgets instead display them in the frontpage.

    If i have to modify the front page which are the files i need to look at in 1.6.1? Thanks.

  • No coders like me get always stuck with such problems, nevertheless, the solution is not that complicated. Custom index plugin allows you to write the code of your frontpage (and comes with some stuff to begin with). All you have to do is to add the fragments of code you need. In order to display the discussions of a particular groups I copied from forum_latest.php this code (and changed the variable asking for the id of the group, putting manually the id, both in the query and in the variable building the string of each item url: 

    <div class="index_box"> <h2><?php echo elgg_echo('groups:latestdiscussion'); ?></h2> <?php     $forum = elgg_get_entities_from_annotations(array('types' => 'object', 'subtypes' => 'groupforumtopic', 'annotation_names' => 'group_topic_post', 'container_guid' => 227, 'limit' => 4, 'order_by' => 'maxtime desc'));     if($forum){         foreach($forum as $f){                              $count_annotations = $f->countAnnotations("group_topic_post");                               echo "<div class=\"forum_latest\"style=\"background-color:#FFFFFF\" >";             echo "<div class=\"topic_owner_icon\">" . elgg_view('profile/icon',array('entity' => $f->getOwnerEntity(), 'size' => 'tiny', 'override' => true)) . "</div>";             echo "<div class=\"topic_title\"><p><a href=\"{$vars['url']}mod/groups/topicposts.php?topic={$f->guid}&group_guid=227\">" . $f->title . "</a></p> <p class=\"topic_replies\"><small>".elgg_echo('groups:posts').": " . $count_annotations . "</small></p></div>";                          echo "</div>";                      }     } else { echo "<div class=\"forum_latest\">"; echo elgg_echo("grouptopic:notcreated"); echo "</div>";     } ?> </div>
    It doesn't get all discussions, I know.. 

  • Would it be possible to display all groups activity for specific user, for example :

    $owner = page_owner_entity(); or $_SESSION['user']->guid;

       $groups = elgg_get_entities_from_relationship(array('relationship'=> 'member', 'relationship_guid'=> $owner->getGUID(), 'inverse_relationship'=> FALSE, 'type'=> 'group', 'limit'=> 5));

    that will display list of 5 user's groups.

    How can I get latest activity from these groups as a river?

    Thanks a lot.

  • Can i dispaly the groups which the user not member of the group