EDITS.WS

Tag: patterns

  • Reusable Blocks Renamed to Patterns with Synced and Non-Synced Options

    There has always been some confusion and overlap between reusable blocks and patterns. The difference was that reusable blocks can be created and edited in the block editor and then reused in other places – inserted into posts or pages. Block patterns, once inserted, can be edited and are not synced. They give users the ability to apply the same layout to different posts and pages.

    Reusable blocks have now been renamed to patterns, with the option to be synced, which offers the same functionality as the former reusable blocks where all instances can be updated at once. Non-synced patterns are just regular patterns – those that can be edited independently of other other instances that have been inserted. These updates are coming in Gutenberg 16.1 and will be included in the upcoming WordPress 6.3 release.

    WordPress contributor Aki Hamano posted a diagram to Twitter regarding the renaming, which was confirmed as an accurate representation of the changes.

    “Clients already find the pattern and reusable block concept very difficult to grasp,” WordPress developer Mark Howells-Mead commented on the pull request for the renaming. “This change will make things much harder for regular users to comprehend.”

    Gutenberg contributor Paal Joachim Romdahl commented that it would be helpful to have more time to test this in a few versions of the Gutenberg plugin, as WordPress 6.3 beta 1 is expected this week. Learning materials and documentation will need to be updated with very little notice.

    Gutenberg contributor Daniel Richards encouraged contributors to see the change as part of “the great unification,” an effort towards consolidating the many different block types into a single concept and streamlining the content and site editors.

    “In the future it might also be possible for template parts to be considered ‘synced patterns’, and at that point things become much more streamlined and there are far fewer concepts for users to grasp,” Gutenberg contributor Daniel Richards said.

    “So the hope is that this is a first step on the path to making things easier for users, rather than more difficult. But I do realize that for existing users it’s quite a shift.”

    As part of this effort, WordPress 6.3 will also introduce pattern creation in the block editor using the same interface that it previously used for reusable blocks. Pattern creation necessitates having a place for users to view and manage their patterns. WordPress 6.3 will also include a first pass at a Pattern Library inside the Site Editor, which will include both patterns and template parts. Gutenberg designers shared a preview of what this would look like a couple weeks ago:

    image credit: WordPress Design Share June 5-16

    The Potential of Partially Synced Patterns

    In May, contributors began a discussion about the concept of partially synced patterns, which Daniel Richards summarized:

    Today, when you insert a pattern, the blocks from that pattern are completely decoupled and standalone. There’s no way to tell that those blocks originated from a pattern, especially since they can be edited to no longer resemble the source pattern.

    Partially synced mode is different. When a pattern that’s partially synced is inserted, it retains a reference to the source pattern. The blocks within the pattern are locked so that they cannot be removed or reordered and new blocks cannot be inserted (this is called contentOnly locking). Only specific parts of the pattern considered ‘content’ can be edited (denoted by adding __experimentalRole: 'content' to a block’s definition).

    When the source pattern is updated, all instances of blocks that reference the source pattern are updated too (much like a reusable block), but the content values the user entered are retained. The best way to think of this is that the user can update the design of a pattern, but doesn’t lose content that exists in templates and posts.

    This concept will not make it into the upcoming version of WordPress, as contributors are still discussing one of many complex implementations, but it offers a glimpse of what might be more granular control coming to patterns in the future. Partially synced patterns would bring distinct benefits to many CMS and content design use cases where clients may be editing content.

    “I am a site developer for an agency, and am actively making sites for clients using Gutenberg every day,” Eric Michel said. “Probably our biggest pain point right now is that the editor does not handle types of content that are mostly standardized with small content customizations per post – things like contact directories, majors at a university, products in a catalog.

    “For us, the absolute dream scenario is what you are proposing, except with the inclusion of the ability to alter the primary template and have all of the pages that use that template automatically change as well.”

    The discussion on making partially synced patterns possible continues in search of an implementation that will ensure users don’t modify the patterns in ways that destroy the ability to display the retained content. WordPress 6.3 will ship with synced and non-synced pattern options, and partially synced patterns may land further down the road in a future release.

  • WP Engine Pattern Manager Plugin Now in Beta

    WP Engine is beta testing its new Pattern Manager plugin for creating and maintaining patterns. The plugin is intended for WordPress professionals – developers, agencies, and freelancers, who could benefit from having an interface and system for pattern management.

    “There are some plugins out there that provide an interface for creating patterns on a production site, but this is not built for that,” WP Engine Principal Engineer Mike McAlister said. “This is meant to slide into a dev workflow where you’re creating, editing, managing patterns for a client, for release in a theme, etc.”

    Plugins like Build & Control Block Patterns (2k active installs) and MyWP Block Pattern (200 active installs) allow users to build block patterns from the admin instead of writing code for them. They offer features like saving page content made with blocks into a pattern, unregistering block patterns, creating custom pattern categories, and more.

    After taking WP Engine’s Pattern Manager for a test run, it’s clear that the emphasis in this plugin is going to be more on pattern organization than on the builder aspect. After activating the plugin, clicking on the Patterns screen takes you to a catalogue of all the existing patterns, based on the site’s active theme. They are organized by category and are also searchable.

    I installed the plugin alongside a theme with more than 30 block patterns included to get a better feel for how it works. From the main pattern management screen users can edit, duplicate, and delete existing patterns. Clicking through to edit a pattern lets users add their own pattern categories, keywords, extended description, designate which post types the pattern shows up in, and optionally hide the pattern from the inserter.

    Pattern creation happens on its own dedicated screen, which works just like the block editor but with the pattern-specific settings in the sidebar. Once a pattern is saved, it will appear with the others on the pattern management screen. The pattern is attached to the theme, so users should understand that they will not have access to their custom patterns if they activate a different theme.

    Users might be curious about creating patterns directly in the block editor. After putting some blocks together in an artful arrangement, it might be convenient to be able to save them as a new pattern for the theme. McAlister said this is not currently possible but it is under consideration.

    “Right now, pattern creation is limited to the Pattern Manager UI, where we can do some interesting and powerful things under the hood,” he said. “That doesn’t mean we won’t one day be able to do it inline, but in terms of exploring this concept as a workflow enhancement, we’ve limited it to a specific screen.”

    After launching the beta, web designer Wolfgang Stefani asked on Twitter if it is possible to update patterns globally using the plugin.

    “No, not yet,” McAlister responded. “It’s not a shortcoming of the plugin, rather how WP treats patterns right now. However, this will be possible with patterns soon, probably sometime this year.”

    Although there are many additional feature requests that might benefit developers and designers’ workflows, the plugin’s creators are launching the beta to test the waters and see how users fare with this initial set of features.

    “Certainly parts of this workflow are opinionated, based on how we’re building patterns, but we’re doing this beta to understand how other folks are building,” McAlister said. “We’re open to any and all feedback to improve the overall workflow.”

    In a recent post titled “Patterns are gonna be a game changer for WordPress,” McAlister outlined his vision for how pattern functionality could be expanded in WordPress.

    What if, for starters, patterns were a treated more like intelligent components? What if instead of being treated as just a collection of blocks, patterns were an entity that WordPress could use as a conduit to do more advanced site building?

    McAlister explored a few ideas, such as making patterns more like template parts, globally synced and editable, adding pattern locking, and adding the ability to build style variations for patterns. The future is wide open for patterns to become far more useful than they currently are today, and third-party developers are exploring how they can extend this feature that has become so indispensable to building pages with WordPress.

    WP Engine’s Pattern Manager fits in nicely into the admin interface, almost like a natural part of core, but the top-level menu for Patterns seems too prominent and should be relocated under Appearance. After testing the plugin, I can see how it could become a valuable tool for managing pattern visibility for clients and speeding up page building by offering a more organized system for patterns. The CMS use case is strong here. Agencies that build the same kinds of sites over and over again could benefit from using this tool to quickly add and duplicate custom block patterns and restrict those that don’t make sense in certain parts of a client-managed site.

    During the live product demo for WordPress 6.2, a viewer asked if core will be adding more robust pattern management capabilities in the future à la WP Engine’s Pattern Manager plugin. The response was that this is a possibility for the future but is not currently a strong priority.

    In the meantime, WP Engine plans to release the plugin for free on WordPress.org after testing with users and updating it based on feedback.

    “We have no plans of monetizing,” McAlister said. “Right now, we’re more interested in digging into the developer workflow and finding unique solutions we can offer to folks who are digging into these modern WordPress tools.”

    If you want to get in on the beta program, you can sign up to get access to a zip file of the plugin. Your feedback may be incorporated into future versions of the plugin that will eventually land on WordPress.org.