-
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
Proposal to use classic theme ( single theme ) either as complete FSE theme or classic theme ( with customizer ) #36864
Comments
Hey there @premanshup! I don't think that having a "switch" would be the best option... The HTML templates are a starting point, but it's also possible to override the HTML templates with custom templates. With that in mind, a theme can create migration routines and start migrating their users to the new structure. |
@premanshup I'd recommend reviewing this discussion! #30496 For now, I'm going to close this out since it's not directly related to the functioning of the Gutenberg project. I'd recommend perhaps bringing this to the next block theme discussion in Make Slack for further thoughts if you need them :) More details about meetings can be found in the sidebar of this blog: https://make.wordpress.org/themes/ |
What problem does this address?
It is currently difficult to use the legacy theme as both legacy theme ( with customizer ) and FSE theme.
[Discussion] Hybrid themes: Templating hierarchies
#29024
In the above discussion, It is proposed that theme developers can create a hybrid theme.
If the HTML template is not added by theme for FSE, it currently fallbacks to themes PHP template.
I'm thinking of a scenario where users want to use a classic theme as a complete FSE theme or use the same classic theme as a complete classic theme with the customizer.
With hybrid themes, for HTML templates, the Header and Footer ( for example ) will load from HTML and where there is no HTML template it will load PHP header footer ( with customizer settings ). It may be a little inconvenient for the users to use both FSE features and customizer in a single site.
For example, If the classic theme has only implemented the front-page.html, only front-page.html gets overridden and other pages fall back to PHP templates. This may cause inconsistency across the website.
In case, theme authors want to support both the FSE and classic customizer-based PHP templates there is no option as far as I can see for users to select if the current theme should be completely FSE or should be completely a classic customizer based theme.
What is your proposed solution?
What I want to propose is classic themes can be used completely as FSE themes or as completely classic customizer-based themes.
Users would be able to add a filter to their child theme or theme authors can provide an option from where users can toggle and use the theme as a complete FSE theme or classic theme.
To achieve this I was thinking of introducing two filters:
Why am I concerned about the theme.json file?
I have added these two filters in this PR - #35616
Using these filters, users can completely switch the themes from classic to FSE and vice versa.
I would appreciate any feedback on this.
My apologies if I'm missing anything here or if I'm completely off here. Thank you.
The text was updated successfully, but these errors were encountered: