Skip to content

Twenty Twenty-One: Add block template support, including a default template#1455

Open
kjellr wants to merge 22 commits intoWordPress:masterfrom
kjellr:try/add-block-template-support-to-twenty-twenty-one
Open

Twenty Twenty-One: Add block template support, including a default template#1455
kjellr wants to merge 22 commits intoWordPress:masterfrom
kjellr:try/add-block-template-support-to-twenty-twenty-one

Conversation

@kjellr
Copy link
Copy Markdown

@kjellr kjellr commented Jun 30, 2021

This PR adds block template support to Twenty Twenty-One, and also provides a default block template, as per the instructions here:

https://make.wordpress.org/core/2021/06/16/introducing-the-template-editor-in-wordpress-5-8/

The default template includes a simplified approximation of the default page layout, minus things like navigation and a footer (which requires translatable text — something not yet possible in block templates). This was pulled from TT1 Blocks, but simplified down a little bit.

Note: The theme stylesheet is not loaded in the template editor. A warning is thrown about this, but I'm not sure what to make of it since Twenty Twenty-One does enqueue the stylesheet properly via add_editor_style().

GIF:

block-templates

Trac ticket: https://core.trac.wordpress.org/ticket/53564


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

<!-- /wp:group -->

<!-- wp:group {"align":"full","tagName":"main"} -->
<div class="wp-block-group alignfull entry-header"><!-- wp:group {"align":"wide","layout":{"inherit":true}} -->
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the entry-header class should go on the header tag right above. This is adding a weird padding and border at the bottom of the page

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch, thank you! I've taken a different approach to this in 3bbcd26, and it should be working better now. 👍

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants