-
Author
Tagged: menu, buddypress
-
October 25, 2014 at 00:53 #32962chazzzzyParticipant
All the users I have testing the site out tell me the site is broken when they click a menu item in the Buddypress Menu area as they don’t see anything change on the screen. BUT they don’t realize that they NEED TO SCROLL down to see the changes.
Is there anything you can do to make the screen scroll DOWN when you click a menu item like:
Change Profile Picture or any other item that is within the Profile Area?
For Change Profile Picture, adding a /#upload to the end of the link would scroll the screen down, but I have no idea how to add that to the URL.
I am beta testing my site and EVERYONE on a laptop is experiencing this problem. (Where they don’t know that they need to scroll down) and that’s in no way obvious for them.
My site is underground.net you can log in and test it if you want.
Thanks!
Charles
October 25, 2014 at 03:03 #32981sharmstrModeratorDid you ask the Buddypress forum how to add and an anchor tag to the buddypress nav links like I suggested? What did they say? I’m not trying to get rid of you, I promise. All of those nav links are handled by Buddypress functions. Kleo only stylizes them. Normally you’d customize the url by putting something like this in your functions.php file
COPY CODEdefine ( 'BP_FRIENDS_SLUG', 'peeps' );
Another user here asked about adding anchors so I tried it like this
COPY CODEdefine ( 'BP_FRIENDS_SLUG', 'peeps/#main' );
I ended up getting a 404 error because its gets parsed like /peeps/main.
Hmmm. I wonder if you can add something in your .htaccess or use the rewrite_rules_array filter to write your own permalink that would append the anchor to the url.
Still another option would be to make the profile header smaller or hide it all together.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
October 25, 2014 at 03:35 #32986sharmstrModeratorThere’s a wrapper div under the buddypress nav called item-body, so you can use that as your anchor. The bp_get_displayed_user_nav function in /buddypress/bp-members/bp-members-template.php draws the menu. Within that function is a apply_filters_ref_array filter. You can tap into that (search how to do it because I’m not exactly sure). right after $link you can add ‘#item-body’.
COPY CODEecho apply_filters_ref_array( 'bp_get_displayed_user_nav_' . $user_nav_item['css_id'], array( '<li id="' . $user_nav_item['css_id'] . '-personal-li" ' . $selected . '><a href="' . $link . '#item-body">' . $user_nav_item['name'] . '</a></li>', &$user_nav_item ) );
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
October 25, 2014 at 04:19 #32989sharmstrModeratorOkay, again I think you can tap into the filter, but since I dont know how to do that. You can do this.
Add this to your functions.php file
COPY CODE/** * Render the navigation markup for the displayed user. */ function my_bp_get_displayed_user_nav() { global $bp; foreach ( (array) $bp->bp_nav as $user_nav_item ) { if ( empty( $user_nav_item['show_for_displayed_user'] ) && !bp_is_my_profile() ) continue; $selected = ''; if ( bp_is_current_component( $user_nav_item['slug'] ) ) { $selected = ' class="current selected"'; } if ( bp_loggedin_user_domain() ) { $link = str_replace( bp_loggedin_user_domain(), bp_displayed_user_domain(), $user_nav_item['link'] ); } else { $link = trailingslashit( bp_displayed_user_domain() . $user_nav_item['link'] ); } echo apply_filters_ref_array( 'bp_get_displayed_user_nav_' . $user_nav_item['css_id'], array( '<li id="' . $user_nav_item['css_id'] . '-personal-li" ' . $selected . '><a href="' . $link . '#item-body">' . $user_nav_item['name'] . '</a></li>', &$user_nav_item ) ); } }
Then copy the following files to your child theme
/kleo/buddypress/members/single/home.php
/kleo/rtmedia/main.phpIn both of those files, change
COPY CODEbp_get_displayed_user_nav () ;
to
COPY CODEmy_bp_get_displayed_user_nav () ;
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
October 25, 2014 at 21:29 #33049chazzzzyParticipantAwesome that works for the main navigation items, not the sub-nav items. Let me play around with it for a second and figure out how to add it to the sub-nav items.
Will post update!
Thanks!
Charles
October 25, 2014 at 23:40 #33073chazzzzyParticipantOK.. I found the following to address the Sub Nav items… I took your code and added the subnav items.. resulting in the following longer code. You replaced bp_get_displayed_user_nav() with my_bp_get_displayed_user_nav()
I also replaced bp_get_options_nav() with my_bp_get_options_nav()
And I then had to copy over all the php files in buddypress/members/single over to my child theme.
And I replaced all instances of bp_get_options_nav() with my_bp_get_options_nav()
It required me to change around 12 pages.. which is a pain!
Here is the code I also added to my functions.php after your code:
COPY CODEfunction my_bp_get_options_nav() { global $bp; // If we are looking at a member profile, then the we can use the current component as an // index. Otherwise we need to use the component's root_slug $component_index = !empty( $bp->displayed_user ) ? bp_current_component() : bp_get_root_slug( bp_current_component() ); if ( !bp_is_single_item() ) { if ( !isset( $bp->bp_options_nav[$component_index] ) || count( $bp->bp_options_nav[$component_index] ) < 1 ) { return false; } else { $the_index = $component_index; } } else { if ( !isset( $bp->bp_options_nav[bp_current_item()] ) || count( $bp->bp_options_nav[bp_current_item()] ) < 1 ) { return false; } else { $the_index = bp_current_item(); } } // Loop through each navigation item foreach ( (array) $bp->bp_options_nav[$the_index] as $subnav_item ) { if ( !$subnav_item['user_has_access'] ) continue; // If the current action or an action variable matches the nav item id, then add a highlight CSS class. if ( $subnav_item['slug'] == bp_current_action() ) { $selected = ' class="current selected"'; } else { $selected = ''; } // List type depends on our current component $list_type = bp_is_group() ? 'groups' : 'personal'; // echo out the final list item echo apply_filters( 'bp_get_options_nav_' . $subnav_item['css_id'], '<li id="' . $subnav_item['css_id'] . '-' . $list_type . '-li" ' . $selected . '><a id="' . $subnav_item['css_id'] . '" href="' . $subnav_item['link'] . '#item-body" rel="nofollow">' . $subnav_item['name'] . '</a></li>', $subnav_item ); } }
I’m sure there is an easier way to change this stuff.. as it doesn’t work on the Group navigation items within the Group pages.. buy hey.. at lease I won’t have people yelling at me that the site doesn’t work when they are on a laptop!
Thanks again sharmstr!
Attachments:
You must be logged in to view attached files.October 26, 2014 at 15:20 #33107sharmstrModeratorI’m pretty sure that bp_get_options_nav also controls the group nav menu. Did you try changing bp_get_options_nav to my_bp_get_options_nav in /groups/single/*.php? The pages have similar names to the ones in members/single/
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
October 29, 2014 at 01:08 #33378AbeKeymasterPlease don’t create duplicated topics https://archived.seventhqueen.com/forums/topic/change-buddypress-change-profile-photo-url
Also i see you also added a comment on the item page which makes our job to take 3 times longer and not so cool 🙂
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.October 29, 2014 at 01:08 #33379AbeKeymasterthanks @sharmstr
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.October 29, 2014 at 01:13 #33384chazzzzyParticipantI don’t remember how that happened! I think I was so buried in trying to set the site up that I forgot that I had posted that!
Sorry about that!
For those coming her, the topic was resolved over here: https://archived.seventhqueen.com/forums/topic/change-buddypress-change-profile-photo-url
Charles
October 29, 2014 at 01:22 #33391AbeKeymasterthanks @chazzzzy
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer. -
AuthorPosts
The forum ‘KLEO’ is closed to new topics and replies.