WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.29k stars 4.11k forks source link

Add documentation describing how plugins can add templates #37476

Closed talldan closed 1 month ago

talldan commented 2 years ago

Related #37401, #36597

What problem does this address?

It was mentioned in https://github.com/WordPress/gutenberg/issues/36597#issuecomment-973992841 that plugins can add templates via a filter. Setting some template fields (setting the source to 'plugin', and theme to the plugin slug) helps to indicate where the template came from.

Support for this has since been added to the template list interface.

As mentioned on #37401 the process for plugins adding templates isn't necessarily all that clear as the theme field doesn't seem obvious, but that's hard to change now due to backwards compatibility.

There's a risk if this isn't documented well that plugins will end up using inconsistent techniques for providing templates.

cc @Aljullu @tjcafferkey

What is your proposed solution?

Add some documentation and/or a tutorial for this process

Mamaduka commented 2 years ago

I am removing this issue from the 5.9 board. It's tracked in the documentation project.

mburridge commented 1 year ago

Add some documentation and/or a tutorial for this process

Where do you think this documentation / tutorial should live?

talldan commented 1 year ago

Probably in the plugin handbook.

mburridge commented 1 year ago

Thanks @talldan. In that case, if it's not something for the Block Editor Handbook, do you think we should close this and open a new issue over in Documentation-Issue-Tracker?

annezazu commented 10 months ago

@ndiego noting for you as you work on the block editor handbook overhaul. Can you follow up on this/ensure it's in the right place?

talldan commented 1 month ago

Closing this in favour of #61577, which should add a much easier API and docs.