Featured Groups on Custom-Index Page?

I am looking to put the "Featured Groups" section on my Custom-Index Page.  How would I go about doing so.  I tried copying some code from the Groups mod but all I get is the title and block, but no content.   What would the code look like?

Cheers,

  • I was able to accomplish this pretty easily using the following two lines

    $featured_groups = get_entities_from_metadata("featured_group", "yes", "group", "", 0, 4, false, false, false);  

    $featured_group_view .= elgg_view("groups/home_featured", array("featured" => $featured_groups));

    groups/home_featured is a custom view I created to iterate thru my 4 featured groups and display them.

    It has a lot of customized HTML here, but you can get the picture of what is going on:

                if($vars['featured']){
                   
                    foreach($vars['featured'] as $group){
                       
                        $icon = "<a href=\"{$group->getURL()}\" class='icon'>";
                        $icon .= "<div class='groupicon' style=\"background-image:url('{$group->getIcon('large')}');\">";
                        $icon .= "<img src=\"{$vars['url']}mod/customtheme/graphics/featured_overlay_sm.gif\" border='0' title='{$group->name}' />";
                        $icon .= "</div></a>";

                        echo "<div class=\"home_group\">" . $icon . " <p><a href=\"{$group->getURL()}\">" . $group->name . "</a><br />";
                        echo $group->description . "</p></div>";
                       
                    }
                }

     

    Hope this helps

    Jordan

  • Great, Thanks Jordan.  I will play around with this a little.  I appriciate the response and will let you know how it goes.