-
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
Template Parts should allow setting HTML tag #20997
Comments
But we should make a decision on whether template parts should render markup by default using group. I'd say probably, yes. |
I wonder if it can be a bit confusing UX wise:
Technically speaking, we have two options:
|
It feels like a template part is just an augmented "group" block. Particularly since we are also exposing the "convert this selection to a template part" which is equivalent to converting to a group. I think we should avoid extra levels of nesting as much as possible. If we check what themes are initially doing, the group seems to come immediately after: https://github.com/WordPress/theme-experiments/blob/master/ambitious/block-template-parts/layout/header.html |
+1 to this. So far while building block-based themes, I have't encountered any use case where I don't want the template part to behave akin to a full-width Group block. |
I have also used a wrapper for every section, but not always at full width. |
Makes sense — if there were a sidebar template part for instance, the full-alignment would not make sense. But I do think having some sort of container wrapper does seem like a common use case. |
+1 It also just feels like I should get those same controls here to help "design" my site without adding the complexity of one more wrapper layer. Reiterating (copy/paste) a comment from a related issue: Being able to semantically tag a template part feels very useful. Particularly as it could be a nice way to add a taxonomy to these template parts. This could make swapping out template parts fairly simple as headers could transform into other headers. Are there any reasons not to add markup? |
I think this is what we should do. Another layer of nesting here wouldn't be good. |
We might want to allow an advanced setting on the template part inspector to be tag-less for the more rare occasions but still legitimate where you don't want a single container. |
Related: #20200
This is a setting that would make a lot of sense in the template part inspector controls settings. We should also see if template parts should be by default a variation on the
group
block, so that they inherit color controls, etc.cc @youknowriad
The text was updated successfully, but these errors were encountered: