Hi,
i am using Buddypress with template bp-nouveau.
If i click on the “report” button inside a profile, the window gets out of range of the browser (at the top).I already found a fix, but it needs to be done in the source-code for later updates:
file: plugins/buddypress-moderation-tools/assets/js/report-abuse.js change: $popover = $el.ggpopover({ title: PTReportAbuse.formTitle, content: $template.html(), container:'body', html: true, placement: 'top'}); to: $popover = $el.ggpopover({ title: PTReportAbuse.formTitle, content: $template.html(), container:'body', html: true, placement: 'auto top'});
Another problem is, that the theme uses '<li>' Elements for the menue button, but the plugin uses div inside the '<ul>' element. Please fix this, so that the button looks better and source-code is correct.
pictures:
https://i.postimg.cc/W1KsdFxP/div_vs_li.png
https://i.postimg.cc/Y23k1yTR/popover-problem.png
Thanks
Regards
- This topic was modified 5 years, 11 months ago by
Brajesh Singh. Reason: moved to correct forums
- This topic was modified 5 years, 11 months ago by
Hi Carsten,
Thank you for posting.I am looking at this and the two issues may be related.
1. Thank you. Will add in the update.
2. I am sorry but it is very complex than what you might have thought.
The theme is using bp_member_header_actions inside the<ul>
element and that is problematic.Any plugin adding button is not aware of the wrapper type used. We follow the default BuddyPress convention of using div as a wrapper.
My suggestion, like you have added “li” for the other buttons, you should do the same for the the moderation button too. I will push an update in next 4-6 hours to make it easier to capture the markup for button.
Thank you
BrajeshHey Brajesh,
>> My suggestion, like you have added “li” for the other buttons, you should do the same for the the moderation button too.
I didn’t do anything to that. It’s the behavior of the new buddypress theme bp-nouveau. Since this is the new recommended theme (and the other is outdated), in the future, “li” should be used everywhere.Regards
CarstenHi Carsten,
I am sorry but it is not coming from BP Nouveau.I just checked the header from BP Nouveau to make sure.
It would have been much better if that came from Nouveau as we could include the fallback.
Please do check again for the same.
Also, Please allow me 1 more day as I am planning to include the post moderation with this release too.
Thank you
BrajeshHi Carsten,
1.0.6 is available now.1. It fixes the position. Thank you for contributing.
2. The buttons can be generated with any markup now.I am sharing two snippets(Please only use only of them)
Example 1:- Change the button markup to use “li” instead of div everywhere.
/** * Modify the button args for BuddyPress Moderation Tools. * * @param array $args args. * * @return array */ function buddydev_modify_bpmts_button_args( $args ) { $args['wrapper_tag'] = 'li'; /* make the button like <li ...><a href=...>Report</a></li>*/ return $args; } add_filter( 'bpmts_report_button_args', 'buddydev_modify_bpmts_button_args' );
Example 2:- Change only the markup for the User profile header Report button to use li. In this case, we check for context.
/** * Modify the User profile button args for BuddyPress Moderation Tools. * * @param array $args args. * * @return array */ function buddydev_modify_bpmts_button_args_for_user_profile( $args ) { // On User profile header button, use li tags. if ( 'bp_user_header' === $args['context'] ) { $args['wrapper_tag'] = 'li'; /* make the button like <li ...><a href=...>Report</a></li>*/ } return $args; } add_filter( 'bpmts_report_button_args', 'buddydev_modify_bpmts_button_args_for_user_profile' );
Please let me know if that works for you or not?
Regards
BrajeshPS:- The support for post type will be available next week’s release.
Thank you Carsten.
Sincerely appreciate the kind words and the patience.Regards
Brajesh
You must be logged in to reply to this topic.