-
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
Hybrid themes don't work if the fallback is block-based #31633
Comments
The template fallbacks currently only work for the frontend, the site-editor is still a WIP and has not been taken into account. Since the site-editor will not be included in WP5.8 this was not a pressing priority. |
What would be the correct behaviour? I'm curious. |
Hey! I created a proof of concept theme to showcase how some classic themes might want to allow users to take advantage of the full-site-editing features. I've mentioned it in #46495, which has been marked as a duplicate of this issue. You can find the repository here: https://github.com/abaicus/fse-hybrid-poc. The main issue I've encountered seems to be the same as what's mentioned here. In my case, enabling the FSE templates only for single posts & pages will break the site editor, as it tries redirecting to the front page when loading (which will use the old PHP template). I think that points 1 & 2 suggested by @carlomanf could be viable solutions. |
I am trying to understand this better: you want to enable all the site editor features: not only the template editing, in a classic theme, but only for some pages. |
If you only wanted to enable template editing, the theme support should be enough. |
I think this is indeed the real issue. If a hybrid theme forcibly enables the site editor in order to edit 404 and archives with blocks, any present PHP templates will cause the site editor to crash. See also #44224. |
I still strongly believe that enabling the site editor in classic themes would be a step backwards, and not make it easier for users and developers to switch, only make it easier for them to fall behind. |
I think such a discussion is more relevant to #44224. I don't have a strong personal preference about whether the site editor is enabled for hybrid themes, but if not, solution number 3 as described above would be required in order to disable the site editor for hybrid themes. |
Description
I understand that the support for hybrid themes was mostly tested on cases where the fallback template was
index.php
rather thanblock-templates/index.html
.When
block-templates/index.html
is present, and there is a mix of PHP and block templates, the support for hybrid themes is unclear.Step-by-step reproduction instructions
single-post.php
to TT1 BlocksExpected behaviour
I can think of three possible solutions:
block-templates/index.html
is present. This could be done by gating the template loader's support for hybrid themes behind! gutenberg_is_fse_theme()
.The text was updated successfully, but these errors were encountered: