-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add author block pattern #40076
Add author block pattern #40076
Conversation
'author-biograhy-border' => array( | ||
'title' => _x( 'Post author biography with avatar and border', 'Block pattern title', 'gutenberg' ), | ||
'categories' => array( 'text' ), | ||
'blockTypes' => array( 'core/post-author-name', 'core/post-author-biography', 'core/avatar' ), |
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.
It means that we would need all 3 blocks to be promoted to stable to include this new pattern in WordPress 6.0.
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.
yes
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.
Or did you mean, that they should be moved to stable with this PR?
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.
I was thinking we should do it separately as a pre-requisite for this PR.
Hei Carolina I have an older tutorial I am looking into updating: About - author - Perhaps some social media icons could be added into your example? |
Thanks for the PR! I agree that we should have a handful of author patterns like this by default. In terms of implementation though, my understanding is that any new "default" patterns should be added to the pattern directory, not implemented directly into Gutenberg. Those existing Query patterns should be moved over there at some point too — just waiting on a resolution to this issue. |
Then should I close this? Because these blocks are not supported in the pattern directory. A new issue would be created once they are available. @paaljoachim I only added the designs that were suggested in the issue. |
Testing. Local site Desktop Server running WordPress 5.9.3. Installed the PR Gutenberg build using this approach: https://make.wordpress.org/design/2021/03/03/testing-a-gutenberg-pull-request-pr/ Went to a page. Clicked the pattern to insert it. It works well adding the author pattern. But it feels a bit missing at the moment. It would be helpful to be able to add on to it with for instance social media icons. A sidetrack coming up. |
Sure! I will be happy to help close them. |
I added this issue: |
@carolinan I added another issue in relation to where we should be able to add unique WordPress links by example writing in the author name to get the link to the author archive. #40155 |
Added another issue. |
@carolinan given that is appears to be a new feature, and we are in Beta, I am going to remove this from the 6.0 project board. If you feel otherwise, please let me know. |
I am closing since it is unclear if new patterns are through Gutenberg or the pattern directory, and because the blocks are still experimental. |
What?
Adds a new author block pattern.
Why?
The new author blocks (post author name, avatar, post author biography) can help users customize their post templates; template files as well as query loops.
They can also be used to add more context directly in a post.
How?
This PR adds one example post author pattern. Number 3 in the screenshot.
I only added one because I am not sure there is consensus or interest in adding them.
Visual description: The section has a thin grey border. The content is displayed in two columns: The author name is displayed at the top of the left column, with a paragraph with the author biography below it. In the right hand column, there is a circular author avatar image. Both the author name and the avatar links to the author archive. The author name is underlined.
Below is a screenshot of several example patterns reproduced from suggestions in #24952
and also the code for testing all of them in the editor.
Most of these patterns can be improved if the vertical alignment for the flex layout is merged.
Testing Instructions
First, register a user that has an avatar and a biography.
Please test with biographies of different lengths.
Screenshots or screencast
Example code
You can copy paste this example code to test the other patterns that are in the screenshot.