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

Site Editor: Add New - Custom/General template #36860

Closed
paaljoachim opened this issue Nov 25, 2021 · 17 comments · Fixed by #42127
Closed

Site Editor: Add New - Custom/General template #36860

paaljoachim opened this issue Nov 25, 2021 · 17 comments · Fixed by #42127
Assignees
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@paaljoachim
Copy link
Contributor

Associated:
[Site Editor] Templates list screen overview
#36597

What problem does this address?

In Templates.
When clicking "Add New". There is no option to create a general/custom template.

Add-new-template

What is your proposed solution?

We should be able to create a "Custom" template.

--

I initially added some info about it here:
Site Editor: Create consistency between Template and Templates Part - "Add New" modal/dropdown.
#36741

@paaljoachim paaljoachim added [Type] Enhancement A suggestion for improvement. [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") labels Nov 25, 2021
@paaljoachim
Copy link
Contributor Author

paaljoachim commented Nov 25, 2021

@annezazu

I am able to add a new template for "Front Page", "Archive" and "Search" but not a custom/general template.
Are there plans to extend?

Anne made this reply:

+1 to this question. I originally had the call for testing setup to add a custom/general template but now see this isn't an option. Going to have folks select Archive to move the task along but ideally would like them to create a custom template.

cc @kevin940726

Here: #36741 (comment)

@jameskoster
Copy link
Contributor

I think this goes hand-in-hand with both #36773 and #36664.

At the moment the name and description are hard coded. But custom templates will require those to be supplied by the user.

@kevin940726
Copy link
Member

I believe this is how it worked before. I'm not sure what needs to be done to support adding a custom template. See #26941 and #27235.

@jameskoster
Copy link
Contributor

Yup, custom templates are an enhancement.

It's already possible to create them in the post editor using this UI:

Screenshot 2021-11-30 at 10 26 30

We need to bring that functionality to the templates list view as well.

A little thought will be required to get the name / description right in the popover. @paaljoachim did you have any thoughts there?

@paaljoachim
Copy link
Contributor Author

paaljoachim commented Nov 30, 2021

@jameskoster I am not fully sure I am on the same track so to speak, but this is what I am thinking.

Starting with what we have currently. The Add New drop down showing various Template types and their description.
I would just add Custom to the drop down list as well as adding a generic description.

Custom-template

User should then be able to edit a template and modify the descriptions of the custom templates. (Could do so through the 3 dot menu or directly inside the sidebar of a selected template.)

@jameskoster
Copy link
Contributor

I think the description may need to be a little more elaborate, and explain where these "custom template"s can be used.

@paaljoachim
Copy link
Contributor Author

Yes. That it does. Here is one suggestion. I assume it would be something like this (from my limited understanding).
"Create a custom template which can be used by any page or post by opening the Template sidebar panel and selecting the template you would like to use." I assume there is something more needed.

@jameskoster
Copy link
Contributor

Maybe something like:

Custom
Can be applied manually to any post or page

What do you think?

@paaljoachim
Copy link
Contributor Author

That is right on the dot! As the template is applied to a post or page.
Having the text "Can be applied manually to any post or page." Is exactly what it does!

@annezazu
Copy link
Contributor

annezazu commented Dec 1, 2021

+1 I really like that phrasing!

@paaljoachim
Copy link
Contributor Author

paaljoachim commented Dec 6, 2021

A use case.

I noticed the following brought up in the Slack channel: #fse-outreach-experiment
https://wordpress.slack.com/archives/C015GUFFC00/p1638588535130900

Point number 3.
"Could not find the Add New button on Templates screen. It was available only on template parts screen."

I am bringing it up here as another reason why we also need the Custom/General template in WP 5.9.
Through the theme or the user the Front Page, Search and Archive templates might already be added so that the Add New button will not any longer be seen.

Screenshot 2021-12-06 at 21 37 00

Adding in the General/Custom option will always keep the Add New button visible in the Templates screen.

@ndiego
Copy link
Member

ndiego commented Dec 8, 2021

Yes, I agree with @paaljoachim. The lack of an Add New button is a bit disorienting and would be a huge add if it can be included in 5.9.

@kevin940726
Copy link
Member

Pinging @priethor, @noisysocks, and @youknowriad for whether or not to include this in 5.9. (I have no idea how this feature works though 😅 )

@Mamaduka
Copy link
Member

Mamaduka commented Dec 8, 2021

I think it could be similar to how we handle it in PostTemplateActions - https://github.com/WordPress/gutenberg/blob/trunk/packages/edit-post/src/components/sidebar/template/actions.js#L64-L118

@priethor
Copy link
Contributor

priethor commented Dec 8, 2021

@kevin940726 Although it can feel strange to the most advanced/tinkerer users to be able to add custom templates in the Template Editor and not in the Site Editor (less advanced users won't use the Template Editor), this will be the first version of the templates list, so although a nice to have, I don't think this is a blocker.

There is already a lot of work and testing in the works in #36488 and we should be mindful of the timeline, but I'm also happy to include it if contributors feel it is ok to add it at this late stage and somebody has the bandwidth to implement it 🙂

@kevin940726
Copy link
Member

Works for me! Thank you @priethor!

@annezazu
Copy link
Contributor

annezazu commented May 2, 2022

Noting this remains a point of confusion for the Site Editor functionality and came up in the fourteenth call for testing for the FSE Outreach Program:

I think I prefer creating a new template in the Site Editor and not the Post or Page editor. I would like Post or Page templates to be choices under “Add New” on the Templates screen in the Site Editor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants