WordPress / developer-blog-content

In this GitHub space, WordPress team coordinate content to be published on the Developer Blog. Discussion and montly meetings (first Thu) in WP Slack #core-dev-blog
36 stars 2 forks source link

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

Closed justintadlock closed 3 weeks ago

justintadlock commented 1 month ago

This is part 2 of a series. The ticket for part 1 is here: https://github.com/WordPress/developer-blog-content/issues/238

Discussed in https://github.com/WordPress/developer-blog-content/discussions/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 commented 1 month ago

This post is currently in progress. The Google Doc is here: https://docs.google.com/document/d/1F4NX0Ort3NFv8k80-4y80gIg33kbyyK8icVEuIi9mwA/edit?usp=sharing

justintadlock commented 4 weeks ago

The first draft of this post is now complete and ready for review: https://docs.google.com/document/d/1F4NX0Ort3NFv8k80-4y80gIg33kbyyK8icVEuIi9mwA/edit?usp=sharing

ndiego commented 3 weeks ago

I just completed a review @justintadlock and added a few comments. Looks great!

justintadlock commented 3 weeks ago

Went through both reviews from @ndiego and @bph. I'll do a final pass and cleanup tomorrow, June 6, before publishing.

justintadlock commented 3 weeks ago

Social copy:

Learn how to combine custom fields with the Query Loop block, patterns, and templates in this tutorial on the Developer Blog:

https://developer.wordpress.org/news/2024/06/06/building-a-book-review-site-with-block-bindings-part-2-queries-patterns-and-templates/