Skip to:

Re: extending groups slug with images

Burt Adsit


You have to create a component and get the group nav stuff working. The group stuff works in a similar fashion. Only the nav call is:

global $group_obj;

$group_link = $bp->root_domain . '/' . $bp->groups->slug . '/' .
$group_obj->slug . '/';

bp_core_add_subnav_item($bp->groups->slug, 'someaction' ,
__( 'Some Action', 'oci-contents' ), $group_link, 'oci_screen_group_someaction');

That listens for /groups/somegroup/someaction and triggers oci_screen_group_someaction() when it finds it. Which happens when the user navigates to Groups > Some Group > Some Action.

Either a link from somewhere in the universe is /groups/somegroup/someaction or the user picks that spot from the member theme menu. The nav system and the urls in bp are intertwined. Your component, when it sets up the nav stuff, determines the urls that your component responds to.

If the url has things like an image name of some sort after the /groups/somegroup/someaction part of the url like: /groups/somegroup/someaction/imagename.jpg then the imagename.jpg is available in bp through the $bp->action_variables. Everything *after* the component/action is available to your component’s code in $bp->action_variables which is an array of things that are stuff after that component/action part of the url.

Skip to toolbar