How Do I Add Sub-Pages to Profile Tab?
-
We’ve got the basic code down to add core-navigation and sub-navigation, but it seems I’m missing something crucial here : -).
Below is what we’re using to generate the correct parent URL for the function.
`
$parentslug_url = ($bp->displayed_user->id ? $bp->displayed_user->domain : $bp->loggedin_user->domain) . ‘profile’ . ‘/’;
`This is what we’re trying to use to generate the menu, but it only works for the logged in user. The only way anyone else can see it is to manually type in the URL with the slug attached.
`
bp_core_new_subnav_item( array(
‘name’ => ‘ournavname’,
‘slug’ => ‘nav-slug’,
‘parent_slug’ => ‘profile’,
‘parent_url’ => $parentslug_url,
‘screen_function’ => ‘show_nav_function’,
‘position’ => 50,
) );
`When someone visits the “Profile” tab (which is what we have set to be the default), then “ournavname” should show below in a sub-menu regardless of whether the user is logged in or not.
Any help is much appreciated!
– Jon
- The topic ‘How Do I Add Sub-Pages to Profile Tab?’ is closed to new replies.