URL syntax for custom tabs on forum pages
-
I followed the instructions at this thread (http://buddypress.org/community/groups/creating-extending/forum/topic/can-someone-explain-how-to-add-tabs-to-the-profile-page#post-71708) to add 4 new custom tabs to the subnav on my Forums pages.
The tabs work, but I had to add backslashes to each because the system would not accept a blank slug. See my code below, added to bp-groups.php. Note how each tab has a different number of slashes as the slug. This is the sloppy workaround that gets the tabs to work, but I’d like to resolve the issue so that the URLs can be passed cleanly:
`* Add the “General” subnav item, to navigate to the forum */
bp_core_new_subnav_item( array( ‘name’ => __( ‘General’, ‘buddypress’ ), ‘slug’ => ‘//’, ‘parent_url’ => ‘http://mysite.com/groups/general/forum’, ‘parent_slug’ => $bp->groups->slug, ‘screen_function’ => ‘groups_screen_group_home’, ‘position’ => 01, ‘item_css_id’ => ‘general’ ) );/* Add the “Individual” subnav item, to navigate to the forum */
bp_core_new_subnav_item( array( ‘name’ => __( ‘Individual’, ‘buddypress’ ), ‘slug’ => ‘/’, ‘parent_url’ => ‘http://mysite.com/groups/individual/forum’, ‘parent_slug’ => $bp->groups->slug, ‘screen_function’ => ‘groups_screen_group_home’, ‘position’ => 02, ‘item_css_id’ => ‘individual’ ) );/* Add the “Corporate” subnav item, to navigate to the forum */
bp_core_new_subnav_item( array( ‘name’ => __( ‘Corporate’, ‘buddypress’ ), ‘slug’ => ‘///’, ‘parent_url’ => ‘http://mysite.com/groups/corporate/forum’, ‘parent_slug’ => $bp->groups->slug, ‘screen_function’ => ‘groups_screen_group_home’, ‘position’ => 03, ‘item_css_id’ => ‘corporate’ ) );/* Add the “University” subnav item, to navigate to the forum */
bp_core_new_subnav_item( array( ‘name’ => __( ‘University’, ‘buddypress’ ), ‘slug’ => ‘////’, ‘parent_url’ => ‘http://mysite.com/groups/university/forum’, ‘parent_slug’ => $bp->groups->slug, ‘screen_function’ => ‘groups_screen_group_home’, ‘position’ => 02, ‘item_css_id’ => ‘university’ ) );`
- The topic ‘URL syntax for custom tabs on forum pages’ is closed to new replies.