New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
BP Members block #26
Merged
Merged
BP Members block #26
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The idea of this block is to let the post/page author to select the members he wants to add to the members list. The BP Autocompleter make it easy to select members one by one. If we are using a dynamic block, we can't use the ServerSideRender component to output the block. We need to deal with it using JavaScript so that it's possible to remove a member from the list.
- Remove the Cover Image, we will not use it for this block as we do not get it fromt the Members REST API endpoint - Add styles - Add a comment to think about using the data that we should get using the `populate_extras` argument of the Members REST API endpoint
Only display the autocompleter and the remove button if the block is selected Handle member removal.
If buddypress/BP-REST#355 is merged, it then will be possible to include the last time members were active and the latest updated they posted into the Members block
renatonascalves
approved these changes
Oct 2, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice!
Thanks for your review @renatonascalves 馃憤 Let's have this in! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here's a new BP Block to select community members and feature them into a post or a page. It's a different approach than building blocks out of one or more of our Members widgets. These are sorting members rather than allow the site admin to pick the ones he'd like to display.
Block's initial state
It looks very similar to the BP Member block at first sight 馃槈. From the block settings, you'll find some options you know from it: whether to display the user name, mention name, the full/thumb version of the avatar or no avatar at all.
Selecting members
Just like the instruction says: Start typing the name of the member you want to add to the members list. Once a member is added, the Autocompleter control is shrinked to the minimum.
List or Grid display?
From the block's toolbar you can choose whether to display the featured members in list or into a grid layout. If you activated the Grid layout, you'll then be able to choose the number of columns (from 2 to 4) for this grid from the Block's settings.
Extra BuddyPress information
When the list display is active, you can include 2 kinds of extra information about the members :
When the grid display is active, you can only include the last time the members were active.
Removing a member from the members list
Simply click on the x button at the right of the member's line / cell.
We plan to include this block into BuddyPress 7.0.0 馃崟