Skip to content
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

A real-world use case: custom meta + block bindings + variations + usage in templates #238

Closed
justintadlock opened this issue Mar 9, 2024 Discussed in #231 · 8 comments
Assignees

Comments

@justintadlock
Copy link

Discussed in #231

Originally posted by justintadlock March 1, 2024
In #222 and #225, I introduced the Block Bindings API. But I should stress that these were merely very basic introductory posts on a vast subject that will empower developers to do some really powerful things with WordPress 6.5+.

With the introduction out of the way, it's time to showcase what folks can really do with this API in more of a real-world use case. I still need to map out the full plan for this, but my general idea is this:

  • Developer is building a site that is slightly more complex than a regular blog. Book review website?
  • Requires custom post meta for data (e.g., rating, ISBN number, etc.).
  • Uses a custom Editor Plugin to add fields for entering metadata in the post sidebar.
  • Needs a custom post template for different structure.
  • Needs a custom archive template with custom Query Loop variation.
  • Uses the Block Bindings API to render post metadata.
  • Needs the Block Variations API for inserting blocks that are bound to post meta.
  • Could use some patterns for use in the theme and by the user with the Block Bindings already in place.
  • It could also showcase Block Locking to control what the user can change.

Essentially, this post (maybe even series) could touch on a lot of features in WordPress and show how developers could bring them together from Point A to Point B.

@justintadlock
Copy link
Author

I'm working on the code examples in this repo for the moment: https://github.com/justintadlock/tt4-book-reviews

@justintadlock
Copy link
Author

I'm working on the draft for this here: https://docs.google.com/document/d/19ySkgbDNzHoHg0Ly1z1VKOFv21UByW06mu7M5TchAPA/edit?usp=sharing

@justintadlock justintadlock moved this from In Progress to Needs 1st review in Developer Blog Content Board May 3, 2024
@justintadlock
Copy link
Author

I needed to split this into two separate posts to keep the word count at a reasonable length. The first part is now ready for review: https://docs.google.com/document/d/19ySkgbDNzHoHg0Ly1z1VKOFv21UByW06mu7M5TchAPA/edit?usp=sharing

@ndiego
Copy link
Member

ndiego commented May 3, 2024

Just completed the 1st review and added some suggestions. Great article! 🙌

@ndiego ndiego moved this from Needs 1st review to Done w/ 1st Review in Developer Blog Content Board May 3, 2024
@justintadlock justintadlock moved this from Done w/ 1st Review to Needs 2nd review in Developer Blog Content Board May 3, 2024
@bph
Copy link
Collaborator

bph commented May 5, 2024

I'll take the 2nd review :-)

@bph bph moved this from Needs 2nd review to Done w/ 2nd review in Developer Blog Content Board May 6, 2024
@bph
Copy link
Collaborator

bph commented May 6, 2024

I made a few comments, but it's practically done. As always, great tutorial, @justintadlock

@justintadlock justintadlock moved this from Done w/ 2nd review to Ready to publish in Developer Blog Content Board May 6, 2024
@justintadlock
Copy link
Author

Social Copy:

Learn how to combine block bindings, custom fields, block variations, and custom editor controls in this tutorial on the Developer Blog:

https://developer.wordpress.org/news/2024/05/06/building-a-book-review-site-with-block-bindings-part-1-custom-fields-and-block-variations/

@justintadlock
Copy link
Author

Post scheduled for May 13 on socials.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Published (Done)
Development

No branches or pull requests

3 participants