-
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
Template definitions don't belong in theme.json #42732
Comments
I'm not so sure, I thought one of the goals were to move even more things to theme.json, for example the data in the style.css header? |
I think it depends on the things. The way I see it a theme.json file should work for any theme, so it can't be tied to templates. |
It will never work for any theme unless the color and font size slugs are forced and the custom option is removed. |
I think that's why we're having these discussions about settling on a standard naming for spacing and typography. I don't think we need to remove custom, themes just need to be aware that things in there aren't transferable to other themes. |
Establishing a best practices is not the same as enforcing and not allowing any custom slugs though. |
WordPress should handle templates and parts that are listed in theme.json but does not exist in the theme without any errors. |
If only there would be some way to specify the information coupled to a template (& -part) just like we do it with file headers in php (patterns). From my point of view It makes more sense if that info is in the template file itself, instead of the overarching theme.json. |
That makes sense to me too. I always found it a strange missmatch that classic templates has that file header, but when we added the HTML block based templates, they didn't. And then we added the file header to the patterns instead and the inconsistencies increased.
|
Out of interest, can we make use of the current class template file header parsing for this? I would guess it would be a case of using that functionality when the theme loads, parsing the files in the templates and parts directories and then setting them up in the same way the theme.json parser would. |
What problem does this address?
The theme.json file should work for any theme and is meant to define the visual appearance of a site, it should not be coupled to templates in any way. We currently have keys for both
customTemplates
andtemplateParts
in theme.json, but these don't belong here.What is your proposed solution?
This information should live somewhere else, not sure where!
The text was updated successfully, but these errors were encountered: