Skip to content

Block Library: Add a Post Navigation block.#19956

Closed
epiqueras wants to merge 1 commit into
masterfrom
add/post-navigation-block
Closed

Block Library: Add a Post Navigation block.#19956
epiqueras wants to merge 1 commit into
masterfrom
add/post-navigation-block

Conversation

@epiqueras

Copy link
Copy Markdown
Contributor

Description

This PR adds a new Post Navigation block akin to the Post Title and Post Content blocks.

How has this been tested?

  • Inserted Post Navigation block in a post.
  • Confirmed post navigation rendered in the editor and front end on a page with a multi-post query.

Types of Changes

New Feature: There is a new Post Navigation block for template building.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR.

export { metadata, name };

export const settings = {
title: __( 'Post Navigation' ),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd need a decent description for this block :)

@mtias mtias added the New Block Suggestion for a new block label Feb 10, 2020
@shaunandrews

Copy link
Copy Markdown
Contributor

Is this, like, "Next Post" and "Previous Post"? Or something else?

@epiqueras

Copy link
Copy Markdown
Contributor Author

Yes

@epiqueras

Copy link
Copy Markdown
Contributor Author

I think this needs to be handled by the Query block. You don't add navigation to a single post, you add it to a query result.

@epiqueras epiqueras closed this Feb 17, 2020
@youknowriad

Copy link
Copy Markdown
Contributor

Take this blog post for instance https://riad.blog/2020/01/28/embrace-the-modularity/
it's not a query since we're showing a single post in a single.html/php and at the end, we have a "next/preview post" links.

We might consider that this is not a Core block (though that's a Core theme so we probably need it), but there's still a need for such block.

@epiqueras

Copy link
Copy Markdown
Contributor Author

The context should still be provided by a Query block even if the Query block is implicitly included in the UI for a "single" template.

A post context has no notion of the list of posts it's in, so it cannot provide data for pagination UIs.

@mtias

mtias commented Feb 17, 2020

Copy link
Copy Markdown
Member

Mmm, I'm not sure that the context would come from a Query block or the implicit $wp_query of the single template. Specially considering you might want to display the prev / next post anywhere in the design (sidebar, footer, root with absolute position, etc).

@epiqueras

Copy link
Copy Markdown
Contributor Author

Specially considering you might want to display the prev / next post anywhere in the design (sidebar, footer, root with absolute position, etc).

In those cases, where would it come from if not the implicit $wp_query?

@mtias

mtias commented Feb 18, 2020

Copy link
Copy Markdown
Member

Sorry, I meant to say but from the implicit $wp_query of the single template.

@aristath aristath deleted the add/post-navigation-block branch November 10, 2020 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

New Block Suggestion for a new block

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants