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

Use template editing mode when editing a template via Appearance > Templates #35990

Closed
jameskoster opened this issue Oct 27, 2021 · 5 comments · Fixed by #36294
Closed

Use template editing mode when editing a template via Appearance > Templates #35990

jameskoster opened this issue Oct 27, 2021 · 5 comments · Fixed by #36294
Assignees
Labels
[Feature] Template Editing Mode Related to the template editor available in the Block Editor Needs Dev Ready for, and needs developer efforts [Status] In Progress Tracking issues with work in progress

Comments

@jameskoster
Copy link
Contributor

Currently, if you navigate to Appearance > Templates and open a template, the post editor mode is used. IE the content area is squished into a narrow column, and the document title is visible on the canvas.

This should instead use the same mode as when you edit a template in the site editor, or via the "Template" section of the Inspector when editing a post.

@jameskoster jameskoster added [Feature] Full Site Editing [Feature] Template Editing Mode Related to the template editor available in the Block Editor labels Oct 27, 2021
@carolinan
Copy link
Contributor

Agreed, that it is using the post editor mode is something that has been confusing to both users and developers when I have tried to explain how templates work.

@carolinan
Copy link
Contributor

carolinan commented Oct 28, 2021

So where would the edit link lead to if the template is not assigned to a post/page/custom post type?
What if it is assigned to more than one post? Then you'd have to select which post to open with the template editing mode.

Especially if the site editor is not in 5.9. If it is in 5.9, I think the edit link would need to go there.

@carolinan
Copy link
Contributor

carolinan commented Oct 28, 2021

The site editor uses a URL format with the theme name and the name (slug) of the template.
admin.php?page=gutenberg-edit-site&postId=theme-experiments%2Femptytheme%2F%2Fsingular&postType=wp_template

The edit link in the appearance > templates view would need to be updated to point to the site editor.
I was not able to figure out how to update/filter the _edit_link argument of register_post_type to include the theme name and template name, so perhaps the site editor could be updated to accept the post id instead.

@jameskoster jameskoster added the Needs Dev Ready for, and needs developer efforts label Nov 2, 2021
@jameskoster
Copy link
Contributor Author

So where would the edit link lead to if the template is not assigned to a post/page/custom post type?
What if it is assigned to more than one post? Then you'd have to select which post to open with the template editing mode.

This is a template editing environment, so my expectation would be that they all link to a view where you edit the template, not the content. Something like:

Screenshot 2021-11-02 at 12 14 13

In the future it might be nice to preview different items of compatible content while editing the template, but that doesn't seem essential for now.

@carlomanf
Copy link

Please look at addressing #36060 as a follow-up to this, because the post editor mode did enable access to revisions and the new mode should enable similar access.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Template Editing Mode Related to the template editor available in the Block Editor Needs Dev Ready for, and needs developer efforts [Status] In Progress Tracking issues with work in progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants