Skip to content

Some block patterns do not show in the inserter #32139

@carolinan

Description

@carolinan

Description

When testing the block patterns that are planned for Twenty Fourteen,
I learnt that the patterns show correctly in 10.6.2 but not in 10.7 RC1.
With 10.7 RC1, only two of the patterns show (summary and contact).

I was able to reproduce this in my own themes. It seems to be related to spacing inside the content.

The following does not work, the pattern is not selectable:

register_block_pattern(
		'twentyfourteen/list',
		array(
			'title'         => esc_html__( 'List', 'twentyfourteen' ),
			'categories'    => array( 'twentyfourteen' ),
			'viewportWidth' => 1000,
			'content'       => '<!-- wp:columns -->
								<div class="wp-block-columns"><!-- wp:column {"width":"40%"} -->
								<div class="wp-block-column" style="flex-basis:40%">
								... truncated

The following does work:

register_block_pattern(
		'twentyfourteen/list',
		array(
			'title'         => esc_html__( 'List', 'twentyfourteen' ),
			'categories'    => array( 'twentyfourteen' ),
			'viewportWidth' => 1000,
			'content'       => '<!-- wp:columns --><div class="wp-block-columns"><!-- wp:column {"width":"40%"} --><div class="wp-block-column" style="flex-basis:40%"><!-- wp:heading {"style":{"typography":{"fontSize":45}}} --><h2 style="font-size:45px">' . esc_html__( '2001', 'twentyfourteen' ) . '</h2><!-- /wp:heading --></div><!-- /wp:column --><!-- wp:column --><div class="wp-block-column"><!-- wp:paragraph --><p><em>' . esc_html__( 'My first year of traveling. I visited China, Thailand, Japan, and India.', 'twentyfourteen' ) . '</em></p><!-- /wp:paragraph --></div><!-- /wp:column --></div>
... truncated

Step-by-step reproduction instructions

  1. Download the patch for the patterns in Twenty Fourteen, or copy the pattern code into your current theme.
  2. In the editor, open the inserter, select patterns, select the Twenty Fourteen category, and see that only two patterns show.

Expected behaviour

All registered patterns should show

Actual behaviour

Only two of the patterns show.

WordPress information

  • WordPress version: 5.7.2
  • Gutenberg version: 10.7.0 RC1
  • Are all plugins except Gutenberg deactivated? yes
  • Are you using a default theme (e.g. Twenty Twenty-One)? Twenty Fourteen with above pull request. Armando.

Device information

  • Device: Desktop
  • Operating system: Windows 10
  • Browser: Chrome Version 90.0.4430.212

Metadata

Metadata

Assignees

Labels

[Feature] PatternsA collection of blocks that can be synced (previously reusable blocks) or unsynced[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions