-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 option to disable templates #49640
Comments
Thank you for creating this issue. Anne! Hey James @jameskoster I believe we have mentioned deleting templates in a few issues. Not sure where they are right now. |
Actually it would be helpful to disable a template first, and then either restore or delete the template as another step. |
A couple of thoughts on this... What is the motivation for disabling templates? The quote in the OP refers to $custom templates which I interpret as a desire to hide templates that are not in use. Is there more to it? If we make all templates disable-able, then what happens on the frontend if you disable all of them? The nomenclature is becoming a little verbose, we'd have:
Which all amount to roughly the same thing. Can we simplify? |
This is what I think. Different states. Reset - should instead be added to a template revisioning system. So that one can explore revisions go one step back or select to reset. Site needed templates - A question comes up should the user be able to disable and then delete these? So if we remove Reset from templates and just have it under Revisions. |
I love the idea of being able to disable templates (and of course also to delete them). But being able to disable first would allow to see the template hierarchy in action by disabling a more specific template (not only custom templates). |
To answer my own question, one motivation is when a theme includes a template like Front Page but you want to use a different template for the site homepage. The only way to achieve this currently would be to manually delete Front Page from the file system. This is too technical, and of course it will return when a theme update is installed. I still think we'll need some affordance to stop all templates being disabled and breaking the site. It could be something as simple as prohibiting Index from being disabled. |
While creating a Block Theme in the Site Editor, we encountered an issue where the template could not be deleted from the Site Editor. The above mentioned idea of deactivating and deleting is something I also found to be very brilliant. It's an idea that users are already familiar with through the WordPress plugin system. Certainly removing files from the editor and file navigation would solve the problem, but I don't think it's an essential solution to encourage a wide user base to create or customise block themes in the Site Editor. I am very much looking forward to the resolution of this issue here. |
Update on this effort that there were some designs shared recently around a disabled template flow: #36951 (comment) I've connected the two issues at this point and am adding this to 6.4 for good measure as it relates to TT4. |
I asked this in 36951 but worth bringing up here too; conceptually, disabling a template is going to be very similar to making it a draft. Is it worth leaning into that less technical and more familiar language here? Instead of disabling/enabling a template, you can make it a draft/publish it. The UI could be aligned with the one for updating a post/page status, and it could potentially pave the way for scheduling and other status changes. |
One way to build a theme is to install a Twenty theme, customize it to your liking, and save it as a new theme. Deleting templates to change the default behavior, or to just slim things down if you don't need multiple archive view types, feels entirely valid. Especially as, in the future, it will become possible for templates to detach from a theme, at which point you can delete and create templates to your own liking. To that end, it makes sense, "disable" should be thought of as a bandaid because you can't delete from an existing theme. Or to frame it differently, it's the button that takes the place of the "delete" button. To that end, the disable button could sit exactly where the delete button is for custom templates. Perhaps it can move all disabled templates under a subheading? |
Eventually bandaids are removed. Will that be the case here—will it ever be possible to delete theme files? My assumption was no. If the intention is to make theme files deletable then I agree. Otherwise it feels more like a status to me. Worth noting that you may also want to temporarily disable a template you created yourself. |
I guess that's valid enough, though the nuance probably is that it will eventually be possible to entirely detach a theme from the theme files, saved only into the database. In such a detached theme, you should be able to delete files. Presumably you could also download a zip, upload it again, in which case it would become manually "attached", as it were. |
Just wanted to note how important this is. Templates are automatically enabled as soon as they're created. So when you create a Front Page template the appearance of your site homepage is changed immediately – before you even had a chance to edit the template! For a new site in development this isn't a big deal, but for an established site that's not the case. This is the main reason I like the draft/published language rather than enabled/disabled. It effectively allows the creation of draft templates, which feels a bit more natural to me versus creating a template in a 'disabled' state. |
Punted after no efforts have been made here to move this forward. |
Hi folks, |
Here's another concrete motivation for wanting to disable templates. Blockbase is supposed to be a super minimalist parent for custom child themes. And Blockbase has many, many variations available as templates for headers, patterns, etc. And many of them look very similar. That's useful when initially beginning the design of a website, but it becomes confusing and encourages errors once that website moves into maintenance. Those who build new page templates when they add a feature a year from now will have to know which of the myriad of header templates was actually chosen for the website design. I'd like to be able to 1) start a new website design with Blockbase, 2) customize the fonts, colors, templates etc. that I want to make available to the site maintainers, 3) use the "Create Block Theme" plugin to lock in my design decisions into a child theme, and then 4) disable the parent Blockbase templates (especially the proliferation of headers) that are NOT part of that website's design. |
As part of the FSE Outreach Program's Build a Block Theme exploration, the following was brought up:
Right now, when you install a block theme, there's no option to delete or disable current templates. You can only delete custom templates or reset customizations to current ones. This is because template files that are bundled with your theme are not stored in the database. For folks building block themes or even switching between block themes with a desire to mix and match, this becomes a more important flow to unlock. This inherently relates to #25071 in that it's another use case around it in many ways afaik.
The text was updated successfully, but these errors were encountered: