Skip to content

Add support for synced theme patterns (with overrides) #59272

Open

Description

Synced Patterns with the new Pattern Overides are a really powerful feature. This ability to have a shared design with content that is unique to the instances is really powerful.

Synced patterns only exist in the database though. They need to be created by a user and can be edited visually in the site editor.

However on top of this it would be great for themes to be able to also ship pattern files with a metadata header to indicate that they should be synced. These patterns should work kind of like templates and template parts where they use the file on disc as the source of truth untill someone goes in to edit the main instance at which point it would get moved to the database.

The reason this would be so powerful is that in custom development work we mainly develop custom themes for sites. These custom themes ship with a bunch of patterns and are used across multiple environments (development, staging, production etc.). With Git workflows it is really easy to move these pattern files across the environments and manage which version should be available where. This breaks down when something only exists in the Database though. Because either you would need to somehow sync parts of the database up which is usually not a good idea, or you need to manually create a synced pattern in every environment from scratch. This would be solved if a pattern could be marked as synced even in code.

This would also make pattern overrides something that we could start to use for synced patterns via code. Because currently today you can only really use that feature through the UI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    [Block] PatternAffects the Patterns Block[Feature] ExtensibilityThe ability to extend blocks or the editing experience[Feature] PatternsA collection of blocks that can be synced (previously reusable blocks) or unsynced[Feature] Synced PatternsRelated to synced patterns (formerly reusable blocks)[Focus] Blocks AdoptionFor issues that directly impact the ability to adopt features of Gutenberg.[Type] EnhancementA suggestion for improvement.

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions