Create Your Own Block Patterns for Gutenberg / the Block Editor



Block Patterns in Gutenberg are a powerful way to make reusable content templates without having to grab all of the blocks and build them from scratch in the WordPress Block Editor. But currently there isn’t a native no-code way to create patterns. Luckily, creating your own is as simple as copying and pasting some code. Here’s how to do it from start to finish.

Join the Build Something Club! https://buildsomething.club

## Links
Get the Code: https://github.com/jcasabona/jc-block-patterns
JSON Encoder: https://jsonformatter.org/json-escape
register_block_pattern: https://developer.wordpress.org/reference/functions/register_block_pattern/

## Chapters
00:00 – Intro
01:16 – Why Not Reusable Blocks?
03:11 – Designing the Block Pattern
04:42 – Copying the Block Code
05:05 – Escaping Block Code
05:53 – Plugin Setup
07:16 – Registering the Block Pattern
08:08 – The Block Pattern Definition
09:03 – Pattern Categories
09:47 – Adding our Block Code
10:02 – Testing
11:20 – Reviewing all the Steps
11:53 – Multiple Block Patterns
12:23 – That’s It!

~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~
To learn more, start here: https://casabona.org/start

Join my mailing list: https://buildsomething.email

Check out my Live Stream Gear: https://kit.co/jcasabona/youtube-live-stream-setup

Check out my Podcasting Gear: https://kit.co/jcasabona/my-podcasting-setup
~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~

Source

Similar Posts

  • BSL Clip: Processing a File (live code PHP Tutorial)

    Welcome to another Clip from the Build Something Live Stream! In this one, I’m writing some live code for a PHP tutorial, in preparation for a new feature in my memberships called “Tiny Web Projects.” Catch the streams live by subscribing. OR get access to the archive by becoming a member: https://buildsomething.club ~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~ To…

  • What’s New with WordPress 5.7? (First Look WordPress Review)

    WordPress 5.7 Esperanza is out and it introduces lots of changes, from a new admin color scheme to easy HTTPS migration, and of-course, improvements to the block editor / Gutenberg. In this WordPress review, we’ll take a look at all of it in this first look video! Join my mailing list! https://buildsomething.email ## Links *…

  • Trying Out Automation Tools with ChatGPT

    Build live with me! I’ll be trying automaiton tools like Zapier and Make to see what I can do with ChatGPT.

    ~~~~~~~~~~~~~~~~~~~~~~~~
    ~~~~~~~~~~~~~~~~~~~~~~~~
    Join How I Built It PRO: https://howibuilt.it/pro

    Get free tips on growing and monetizing your podcast: https://profitablepodcaster.fm/tips

    Check out the Make Money Podcasting show: https://profitablepodcaster.fm/

    Check out my Live Stream Gear: https://kit.co/jcasabona/youtube-live-stream-setup

    Check out my Podcasting Gear: https://kit.co/jcasabona/my-podcasting-setup
    ~~~~~~~~~~~~~~~~~~~~~~~~
    ~~~~~~~~~~~~~~~~~~~~~~~~

  • Is $4 Hosting from AppSumo Worth It!? (Best Web Hosting for WordPress)

    With the recent WooCommerce vulnerability, forced updates, and security issues, the idea of cheap hosting has been called into question. Is self-managed, shared hosting really the way to go? AND how cheap does hosting need to be worth trying? Are there use cases for cheap hosting? Well, I just picked up $4 hosting. Let’s see…

  • State of the Word 2020 Reaction & Analysis

    Matt Mullenweg is giving his annual State of the Word, an update on all things WordPress, on December 17th at 11:00am EST. Following that, I’ll be giving my reaction and thoughts. Join me for a chat and to throw your two cents in!  Watch the SotW here: https://www.youtube.com/watch?v=QI3qCoiuG3w&feature=youtu.be Check out WordPress: Year in Review: https://wpyearinreview.com ~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~ To…