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

Template Part Support Page #74

Closed
annezazu opened this issue Nov 29, 2021 · 5 comments
Closed

Template Part Support Page #74

annezazu opened this issue Nov 29, 2021 · 5 comments
Assignees
Labels
5.9 Changes in 5.9 release new document Requests for new page/article. user documentation (HelpHub) Improvements or additions to end-user documentation

Comments

@annezazu
Copy link
Collaborator

What is the new page you are requesting?

An article describing what a template part block is and how best to use it, likely similar to Query Loop or other theme blocks.

How will this new page help you?

It's part of a feature that will see greater adoption with WordPress 5.9's feature set.

@annezazu annezazu added 5.9 Changes in 5.9 release new document Requests for new page/article. labels Nov 29, 2021
@zzap zzap added the user documentation (HelpHub) Improvements or additions to end-user documentation label Nov 30, 2021
@carolinan
Copy link
Collaborator

I have started on this, and I found it difficult to describe how:

  • The settings are different depending on if it is a full site editing theme or a theme that supports template editing.
  • The alignments depend on if the template part block is inside a block with "inherit default layout".
  • The Replace option in the toolbar is only available if there is a template part to replace it with (requires theme.json in the theme).

https://wordpress.org/support/?p=15124095&post_type=helphub_article&preview=1&_ppp=d5f684b542

@carolinan carolinan moved this from Todo to In Progress in WP 5.9 Documentation Dec 2, 2021
@annezazu
Copy link
Collaborator Author

annezazu commented Dec 15, 2021

Finally digging in here. Thanks for the patience. For starters, love the simplicity of this line:

The template part block can be used with a block theme or a theme that has support for template editing.

Stealing it for the navigation block as I had a much clunkier one in place! I'd recommend moving this line after intro-ing, loosely, what it is.

This is repeated twice:

Template parts are used to manage blocks that are repeated across the website, for example, the site header and site footer.

I might also update it to say something closer to what's in the glossary (wouldn't reuse all of it, just parts):

"Building on Block Templates, these parts help set structure for reusable items like a Footer or Header that one typically sees in a WordPress site. They are primarily site structure and are never to be mixed with the post content editor. With Full Site Editing and block based themes, users can create their own arbitrary Template Parts, save those in the database for their site, and re-use them throughout their site. Template parts are equivalent – in blocks – of theme template parts. They are generally defined by a theme first, carry some semantic meaning (could be swapped between themes such as a header), and can only be inserted in the site editor context (within “templates”)."

I'd have "Replacing one template part with another" at the same heading level as "Making changes to a template part".

P.S. For some reason the screenshots you included are a bit blurry for me.

@annezazu
Copy link
Collaborator Author

annezazu commented Jan 5, 2022

Alright! I dove in and built out this page today with sections similar to other advanced blocks, like the query loop block. As @carolinan noted, this is a tricky block to describe but I think this does it enough justice for now.

Going to ship today in light of this convo in slack where current links in 5.9 RC1 are broken because these are not published.

Going to keep this open for feedback though as I imagine we'll need to iterate cc @zzap @mkaz https://wordpress.org/support/?p=15124095&post_type=helphub_article&preview=1&_ppp=a24fdce4d9

Will loop back with a comment when live (need to finish edits to the Template editor 😅 ).

@annezazu
Copy link
Collaborator Author

annezazu commented Jan 5, 2022

Noting I had to make some changes since this PR wasn't backported for RC1 (I added way more than I needed to 🤦🏼 ): WordPress/gutenberg#36571

@annezazu
Copy link
Collaborator Author

annezazu commented Jan 5, 2022

Shipped: https://wordpress.org/support/article/template-part-block/

@annezazu annezazu moved this from In Progress to Done in WP 5.9 Documentation Jan 5, 2022
@annezazu annezazu closed this as completed Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.9 Changes in 5.9 release new document Requests for new page/article. user documentation (HelpHub) Improvements or additions to end-user documentation
Projects
Status: Done
Development

No branches or pull requests

3 participants