Skip to content

The wp:pattern block #48458

@mtias

Description

@mtias

Note

This is an integral part of the block API #41236

Pattern block tracking issue - #50159

We've so far treated patterns as a block instantiation feature but not a permanent object. This was a useful lens with which to introduce patterns and enabled many workflows (like copy and paste from the directory) without adding further edges to the block API. With time, we also introduced a utility block called wp:pattern to allow block theme authors to reference individually registered patterns dynamically, which has also helped with translations.

There are a series of upcoming features around #39281 we want to unlock that now require us to look more seriously into making this block fully powered:

  • Being able to designate a container that can cycle patterns within — just like template parts but without the extra overhead they entail. Shuffle content blocks when templateLock is contentOnly #44581
  • Introducing patterns where the content is configurable on a per-instance case but the design and layout is shared and can be globally updated across instances. This requires developing the contentOnly property further to establish a set of attributes (role == content) that the pattern is then injected with dynamically.
  • Helping the zoomed.out view properly focus on patterns rather than top level blocks.
  • Possibly unifying concepts with reusable blocks where everything is a "pattern" just with different sync properties.
  • Attach theme.json child objects to define a new set of style properties that only apply to the pattern contained within.

All of these features can be better conceptualized with the help of such a block.

Task list:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs Design FeedbackNeeds general design feedback.[Block] PatternAffects the Patterns Block[Feature] PatternsA collection of blocks that can be synced (previously reusable blocks) or unsynced[Type] OverviewComprehensive, high level view of an area of focus often with multiple tracking issues

    Type

    No type

    Projects

    Status

    🎨 Needs design

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions