Closed rgilman closed 5 years ago
Here are two functions that we will likely want to either use or learn from:
bp_get_options_nav() This is the function that returns the secondary nav menu for each component type. It is in wp-content/plugins/buddypress/bp-core/bp-core-template.php starting at line 34. We will likely want to modify this to provide the context appropriate submenus for each section. See https://buddypress.wp-a2z.org/oik_api/bp_get_options_nav/ and http://hookr.io/functions/bp_get_options_nav/
bp_current_component()
This function gives the text name of the current section. E.g
bp_current_component() == 'groups'
important for setting context appropriate stuff. It’s at wp-content/plugins/buddypress/bp-core/bp-core-template.php at line 1278.
See http://buddypress.wp-a2z.org/oik_api/bp_current_component/ and http://hookr.io/functions/bp_current_component/
BuddyPress components are discussed at https://codex.buddypress.org/buddypress-components-and-features/
A good general introduction to BuddyPress is at https://premium.wpmudev.org/blog/buddypress-guide/
I'm bumping this since I see this as the next major task for the header after what's already on David's stack.
The secondary menu (submenu, menu line below the top/main menu) is context-sensitive, being different on, for example, the members directory, an individual member page, the group directory and an individual group page.
We need to learn how to customize it in terms of both what items are included and in what order. The mobile version and the wide version will be different.
I expect we can start our detective work with the functions in the nav-bfc_submenu.php file. Researching these functions via https://buddypress.wp-a2z.org/oik-plugins/buddypress/ will likely provide useful clues.
Speaking of getting clues, I've included temporary read-out for components, items and actions at the end of nav-bfc_submenu.php. Feel free to remove these or modify them. BTW, I've learned that a better place for a big var_dump() is just before <?php wp_footer(); ?>
at the end of footer.php.
I'll have more to say soon about specific items and orders for the menus but at the moment that's less important than knowing how to customize these menus.
Cool. Still, even one example of a menu item you want changed would help focus the work/research. :-)
Then let's aim toward changing the group submenu to Forum Members Activity. That's a reduction and rearrangement.
@DavidScottBernstein Can you take a look at this task? It's going to be more PHP than CSS. Partially it's about learning how to do this stuff. The first task is to slim down the submenu on this page:
https://bfn.context.org/groups/bfnet-web-team/
... to just: Forum Members Activity
Okay, looks like @rgilman has taken care of this with #66.
There is still more work to be done on the menu hierarchy but I was thinking of opening a new issue for my next steps so I'm happy to have this issue closed. Should we also close #64?
Good point. I've now closed #64.
Starting a new issue for the additional menu work sounds good (or even breaking it down into multiple bits).
CBox is set up so that the left sidebar is populated with section-specific menu items. We will be removing that sidebar as part of our UI re-design. I would like to move many of those menu items into the secondary menu in the header. This will likely require new functions that either make use of parts of the existing sidebar menu system or create something similar.