Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some block patterns do not show in the inserter #32139

Open
carolinan opened this issue May 24, 2021 · 0 comments
Open

Some block patterns do not show in the inserter #32139

carolinan opened this issue May 24, 2021 · 0 comments

Comments

@carolinan
Copy link
Contributor

@carolinan carolinan commented May 24, 2021

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant