-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[New block] Post Navigation Link #28602
Conversation
Size Change: +576 B (0%) Total Size: 1.37 MB
ℹ️ View Unchanged
|
Hi The post navigation is what we now call the navigation between single posts The posts navigation is navigation between a set of posts, and in Gutenberg, this is the query pagination blocks? |
ec32525
to
d4d8efc
Compare
You're right. I renamed it. |
Shouldn't the codename of the block align with the title – |
This makes even more sense. I believe this will be the last rename :) |
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.
Nice work. I really like how the block variations API simplifies so many things 👍🏻
Hello! The "Needs Copy Review" label was attached to this PR. Is there something specific you'd like us to look at? |
Hey @kristastevens - labels and descriptions from the block and its variations like |
@ntsekouras where are the labels and descriptions? I'm not seeing any copy that needs review. (Sorry! I don't mean to be difficult.) |
@kristastevens Here are the links: Did I need to add the |
Thanks so much, @ntsekouras! Please always feel welcome to request copy review on anything you like.
I think we can trim this a tiny bit without compromising the meaning / intent. Suggestions:
Same idea here with a small trim:
Suggestions:
|
623b33e
to
cdf6838
Compare
One issue, I could not added the block when using a normal theme, when I switched to a the TT1 block-based theme it worked. I couldn't figure out why this was the case though. A couple of usability bumps:
Functionality all seemed to work fine. |
Hey @mkaz - thanks for testing!
This block is registered under the FSE umbrella.
Good point! I made the placeholder persist on empty value so it will provide more guidance.
The key here is that we should give more thought about a control for setting
This is a tricky one and that's why in the toggle there is this hint:
I pushed support for this. |
@@ -76,6 +76,7 @@ function gutenberg_reregister_core_block_types() { | |||
'post-excerpt.php' => 'core/post-excerpt', | |||
'post-featured-image.php' => 'core/post-featured-image', | |||
'post-hierarchical-terms.php' => 'core/post-hierarchical-terms', | |||
'post-navigation-link.php' => 'core/post-navigation-link', |
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.
Would post-previous-next
be more clear?
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'm not really sure about that.. I've no strong opinion on this though.
4706456
to
92f507e
Compare
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.
The placeholder update looks good. 👍
I missed the part about the icon, I agree that can be addressed later.
I didn't see the update for the alignment in columns, but I think that also can be addressed in other tickets and not unique to the nav links.
Looking good, worth landing and iterating based on further feedback. 🚀
Thanks for testing and reviewing @mkaz!
I added |
Description
This PR creates a new block
Post Navigation Link
that is used to display the previous or next post link, that is adjacent to the current post. It works withpages
,posts
andcustom post types
.This base block can only be used through its block variations:
Next post link
andPrevious post link
. If not insingular
page it returns nothing.This block has an option to show the next/previous post's title and in general can produce three different results:
false
and no custom label -> Link with the default text that isNext
orPrevious
accordinglytrue
and no custom label -> A link with the post's titletrue
and a custom label -> A link with the post's title with the custom label prepended to it.How has this been tested?
I have tested with
pages
,posts
andcustom post types
but wasn't able to properly test in a block-theme because of the recent problems that not load properly.Screenshots
I will add gifs when the themes problem is resolved.
Follow ups
Notes
There is no icon (example arrow icon) at the produced link, but it can be added with css by theme authors for now. Later we could consider a control for setting such an icon.
Checklist: