UI: Add Page Templates
When you use the editor to edit a page, you need to be able to pick a template, set the order, and parent.
Those three properties are very likely to change in the future. But they are nonetheless important to be able to set in a transitional period.
What's the best way to approach this?
Here's a quick mockup of a transitional metabox that would be good to retire once something superior can replace it:


The Order field should be a [type="number"] input instead of a dropdown, by the way. Drop-down doesn't really make sense for numerical values, as you could be thousands of options.
The Order field should be a [type="number"] input instead of a dropdown, by the way. Drop-down doesn't really make sense for numerical values, as you could be thousands of options.
That was bad mockup copy/pasta on my part, sorry :) I meant for it to be a plain input field, but type="number" is even better.
Hm I'm not sure about the [type="number"] while technically it would be appropriate, we're discussing them in the accessibility team since it seems it's not widely supported by assistive technologies 😞 More details here: https://make.wordpress.org/accessibility/2017/02/13/testing-html5-type-attributes-in-forms-with-different-browsers-and-at/
[type="number"] seems problematic especially with speech recognition software (Dragon), more details here: https://make.wordpress.org/accessibility/2017/01/16/testing-form-functionality-with-different-assistive-technology/
we're discussing them in the accessibility team since it seems it's not widely supported by assistive technologies 😞 More details here: https://make.wordpress.org/accessibility/2017/02/13/testing-html5-type-attributes-in-forms-with-different-browsers-and-at/
My takeaways from this post are: validation isn't always reliable (maybe not a blocker?), shows a small input by default (could be resolved by styling or size attribute?). Anything I overlooked?
[type="number"]seems problematic especially with speech recognition software (Dragon), more details here: https://make.wordpress.org/accessibility/2017/01/16/testing-form-functionality-with-different-assistive-technology/
That's a shame. If this becomes a blocker, maybe it could be enough to recreate the effect with a text type, numeric pattern attribute, and manually bind to the keyboard events to simulate increment effects?
This is something that needs to be added. For v2 we'll rethink how you select templates, maybe with an upfront selection process like when creating a new slide in keynote or pages document.
I'd like to see, probably in v2, page templates that specify the blocks that they allow, their order, how many of each type, and so on. When they do these blocks then get added to the editor as locked. This could be added to the page template metadata PHP docblock comment.
that specify the blocks that they allow
See also #1654
Added "Needs API Endpoint" label. To my knowledge, there's currently no way to retrieve available page templates from the REST API.
Something else to note is that the list of available page templates can actually vary from page to page, due to the theme_{$post_type}_templates filter. So the endpoint would need to hang off of the page resource itself, like: /wp-json/wp/v2/pages/:id/available-templates
@aduth I've started a PR (#2086) to add a new available_page_templates field to the page resource which we can use to obtain the available templates and their names for use in a page template selector.
Punting.
From my understanding #2086 has been closed. I can take this up.
This is important to have, let's try to work on this soon.
Just wondering about the status of including page templates. I just downloaded the recent version and there is no where to choose a page template. I like idea of adding certain blocks based on a CPT but there are plenty of times where there is NO CPT created but I still need to use a custom template. So just checking on the status of how and when the ability to choose a custom template from the Gutenberg editor.

I would like to see this functionality too!
@brothman01 This feature has since been implemented, so it should be available for you to use. If you're not seeing the option, can you verify that you're editing a page? Can you provide more information about the theme you're using, and which page templates you're expecting to see?
aduth, thanks for the information. Yes it is showing up now.
Thanks!
Still not seeing it, running Gutenberg 3.7 on WordPress 4.9.8
@gmariani Make sure that your theme is loading at least one page template, because if your theme is not, then it won't show up.
@ajvillegas I am also not able to see any page template selectors, and I'm pretty sure that my theme is loading up a template. I'm just using a modified version of twentyseventeen.