-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Update Appearance > Templates to list all templates #35994
Comments
I don't think this will make it easier for users, because this view is recognizable as a page where you perform specific actions. What I mean is, the page looks the same as the list of post or pages, and having items on this list that are not editable is not expected. |
I would actually prefer if this view was not changed in the plugin, and not ported to core in 5.9, because it adds to the cognitive load because there are just too many ways to edit templates and template parts.
And for template parts, the isolated view is added to that list. I won't even include the code editor mode since it is not (yet) implemented for templates. |
But they are editable. Or to be precise, folks are able to customise them, and subsequently revert their customisations. But I don't think we need to surface that technicality here. As far as the end user is concerned, they are editing the template. FWIW this is exactly how it is implemented in the Site Editor currently.
It seems highly unlikely this will be included in 5.9 in its current state.
The average user will very rarely touch these. You can even make the case that the block-based template editor supplants the theme file editor entirely. |
I wanted to highlight that this is something that is affecting us as we are preparing WC for WP 5.9 and FSE editing. Until now, we worked on making WooCommerce templates (ie: Single product, Product archive, etc.) available from the Site Editor, so users could modify them from there (see woocommerce/woocommerce-blocks#5062). Since #36194, however, that's no longer possible and there is no other way to modify templates added by plugins. Listing all of them in Appearance > Templates would solve this, assuming the same functions/hooks will be used. @jameskoster do you know if that's something that is tracked for inclusion in WP 5.9? Is there anything we can do to help to move this forward from our side? If not, is there any other recommended way for plugins to add templates that can be modified? |
@Aljullu Yup, this should be included in 5.9 :) Edit: That said, I don't think it has been assigned to anyone yet (maybe @kevin940726 ? 🤔), so if y'all have the bandwidth, I'm sure any help would be appreciated! |
I've looked into this, but unfortunately I'm still not sure how to fix this. Perhaps would be easier for PHP/WP experts to take this ;) |
While referring to this issue and trying to find a developer to work on it, I was notified that the issue is not well documented, and I was asked to link to the decision about why the screen needs to show the different types of templates. I am not sure what to point to other than the design proposals in #29630 I'll link to this PR as well if it helps add context #36194 @kevin940726 Do you want to include a summary about what you tried that did not work? |
In addition to the links you provided I would say: if we don't list all templates here then it will not be possible for users to customize templates that are added by themes or plugins in 5.9. They will only be able to create (and edit) templates from-scratch, which seems like a shame. I believe @Aljullu is looking in to working on this. I don't know if you want to assign this issue Albert? |
@tjcafferkey @dinhtungdu are interested on working on it. For some reason I'm unable to assign the issue to them (and they can't assign it either). |
I tried looking into the source and couldn't find a way to extend the default list. I'm definitely missing something, but I don't have time to dig into it deeper 😅. |
Me and @dinhtungdu have been looking into this issue over the past day or so and have not come up with a suitable solution. Fundamentally the templates in this screen are being treated like they are for every other post type using the
And because of this, it also means:
There were a number of workarounds we considered which included creating database entries which were just references to files in the filesystem, however these felt very much like hacks and came with complexities of their own. Seeing as this is a problem all theme and plugin developers are going to have we didn’t want to set a precedence which was fundamentally a workaround or not officially supported. It seems as though we need a solution which behaved like the recently removed Site Editor navigation where:
Because of the points mentioned above, I can’t think of an approach which would be suitable not only for WooCommerce but also every other plugin or theme out there which will want to use this feature and I am wondering whether the current approach needs a re-think, or whether we’ve just missed something in the current implementation which supports our needs. |
Thanks for the excellent summary, @tjcafferkey. One alternative I can think of is to:
|
@Mamaduka thanks for sharing the alternative, we considered the approach you mentioned but we haven't found the solution for pagination that approach introduces. If you have any idea to solve that issue, please let us know.
|
It seems like we can't do much in the WP admin style list. If it's too tricky to do then I don't think it'd be worth it. I created #36379 as an alternative to implement the list from scratch. It also matches the ultimate design we had in #29630 (comment). |
@dinhtungdu The We can fake pagination by slicing results, but this still means we fetch every template. So I think it's okay to ignore it v1; we don't have data on how many templates sites might have. @kevin940726 building SPA will probably be more time-consuming than using a custom |
As long as we're only returning the results that are related to the site in its current state (ie not returning templates from deactivated themes or plugins) then I agree, I can't imagine there being lots of templates either.
I'm not super familiar with all the code involved, but I'd imagine building a SPA from scratch would be more time consuming. @dinhtungdu would you agree? |
I don't think we have to build a traditional SPA from scratch. We can just start by implementing client side router, so that we don't have to reload the page over and over again when we're inside the site editor. It will also paves the way for future improvements, as I believe SPA is a much better architecture for the site editor. |
I am late to the party here, but I am confused how I edit a template now in 11.9. If I do a fresh install of WordPress, Gutenberg 11.9 and TT2, how would I, for example, go about editing the 404 page template supplied by the theme? Because the template file has not yet been edited by me, it does not display in Appearance > Templates. |
Hi there, I'm a bit confused right now as well. I always thought it's super helpful FSE feature for users to have a nice overview of all the available templates a theme or plugin provides. Will this be added again once FSE is further along? |
@ndiego From what I've gathered the overview list of all templates is gone right now, but users are still able to edit a template when they chose it for a page (Page Sidebar settings/Template: Choose your template has the option 'Edit'). |
That list only includes the page templates not 404, search, archive etc. |
Hi, In my opinion the templates should appear in a list when the customer publishes a page or a post with a certain template, giving the possibility to modify them. I am creating a theme using the template part function a lot, because it makes the theme very customizable by replacing, for example, one Header rather than another and so on.However, in many layouts I have given the possibility to customize it 100% through the editor of the complete site, but if this feature is no longer available I would have to review the whole project. |
I presume this change was made because complete FSE is not coming to 5.9. And I understand why 5.9 should not have it. That said, I propose this change (the Site Editor sidebar being removed) be reverted in Gutenberg specifically asap for all the developers currently working on FSE. Once a suitable replacement is built, then it can be removed/updated as originally planned. The current setup makes it extremely challenging to built and test a FSE theme. Personally I have a demo site reverted to 11.8.2 just for that purpose. |
I agree with Nick |
Suggestion from DYI WordPress User To mitigate concerns that users messing up with FSE template editing features, these theming tools could be linked to the user's role. Yet, a new Theme Author user category (equivalent of admin) could be created and assign FSE theme authoring tools to theme authors only; auto disable them through |
There are details of how it will be added again in the OP :)
You can still access the Site Editor via Appearance > Editor. |
Yes, but you cannot edit the templates. |
Right. That is why we're updating Appearance > Templates to list all templates, as outlined in the OP. |
I agree, asap. |
it should not be removed from first. you don't remove something very important unless the replacement is ready. |
I agree with these sentiments. Removing features from the plugin because they are not ready for core does not make sense. If they are not ready for core, then why not just leave them out of core but leave them in the plugin? |
So by now I understand that this all default templates will be added to the Appearance/Templates list as a solution to the current issue that templates can't be edited as we were used to from the Site Editor menu. I think many of us how have started to build for FSE are a bit confused that the Site Editor experience has changed quite significantly after being introduced already. I also don't really understand why the Site Editor menu had to be taken out of the Gutenberg plugin. Going forward is there some form of documentation on how the Site editor will evolve from here? Will the Site Editor menu (I mean the left-aligned dark menu) be added again? Or what will happen with it? |
Perhaps adding in something to the Add New button for templates would make the most sense. I spent nearly an hour trying to use that button to add a "Category" template today, fiddling with the slug, the naming, etc, to no avail. I did figure a way to edit, for example, the 404 template properly, but only because that was a template in 2022 already, and the way I used through the Page editor is nonsensical. If the default list item table needs adjustments, then it's okay to adjust it to fit the purpose. Right now, FSE simply doesn't work because there's no actual way to even start editing templates other than "index". |
Just a note that we've restored the W menu in Gutenberg 11.9.1. This fixes the immediate problem people are having which is that they can't edit templates when running WordPress 5.8 + Gutenberg 11.9. We're still exploring removing the W menu in favour of Appearance → Templates, etc. This will be a part of Gutenberg 12.0 and WordPress 5.9. |
At the moment Appearance > Templates only lists templates that have been created from scratch, or theme templates that have been customised by a user at the site.
It seems sensible to display all templates here, including those supplied by themes and plugins. Just like we
dodid in the Site Editor. This provides a convenient pathway for folks to go and edit all the templates in use at their site.Since templates supplied by third parties cannot be edited, we may need to disable bulk actions for those templates.
The text was updated successfully, but these errors were encountered: