-
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 part controls should be identical to a group block #22034
Comments
I'm not sure. I don't think sizing and alignment should be handled by it. Template parts should be thin block boundaries that fill their containers, just like reusable blocks. We shouldn't mirror the group block and use all the same controls when you can just make a full-size group block the first child of the template part. Colors and styles are a bit different because we will need global style controls for template parts in there. I guess we should limit controls there to what global styles offers, cc @ItsJonQ @mtias. |
At the moment template parts don't render markup of their own, so they cannot have the same attributes as the group block. I've been going back and forth on this, because in many cases it'd make sense for a template part to define a semantic tag directly ( |
@mtias All good points. 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. It feels to me these arguments strengthen the idea of iterating the template part block to have markup of their own to support various features and simplify the experience. Are there any reasons not to? |
I really like the points on semantics behind template parts. If we did allow the use of |
There's more discussion on that here: #20997 |
It sounds like the current feeling is to
Is that accurate? I would vote in favor of this approach because navigating around template parts is fairly tricky if a group block is outside or inside of the template part. Particularly in select mode, you have to click through multiple times, and it's tricky to select the actual wrapper in edit mode if there are multiple. It also sounds like wrapping a template part in a group block is a common use case (so far) by theme devs to add styling anyways, so first-party support seems good. That said, from a technical standpoint, I want to note that we are talking about block attributes of the template part block. Specifically, these attributes would save to the containing parent not to the template part itself. So if you create a new template part block, make a new template part called Which raises some questions:
|
Yes.
I'm not sure we should make either recommendation.
No. While I understand the technical difficulties here, as a user, I would expect those settings to be part of the template part. If I insert the template part elsewhere, I expect, at the very least, it's background color to remain the same (group block settings). I don't know if the size settings should stay the same. I'm on the fence there.
Yes. |
I have been thinking about this more and more lately. My initial reaction was "no", but there could be a strong argument for this approach. Im copying a comment I posted earlier today in another issue (#22717 (comment)): Thinking about this more, there can be a solid argument for just using the block attributes for this kind of thing. No, it will not persist when you insert that template part on a new template, but maybe the template should have that control in the first place. Consider the following example - A user wants to create a website to support bi-partisan political blogging. They want to use the same header across all pages of their site, but want different variations of the background color:
If these settings are on the block attribute level, all these pages need is a different template that references the same template part. If these settings persist across the entity itself, not only would they need a different template for every situation, but a different Template Part as well! Looking back at the semantic tag, this makes sense to be applied at the Template level as well. As the template is what determines where that template part is placed and what it is being used for in that specific circumstance. If a template supplies a template part block at the top of the template and lists its semantic tag as a header, its semantic tag should probably still be a header even if the user switches the entity it references to a template part that was initially intended to be a footer. Now, we could ALSO use taxonomy to aid in the searching of template parts based on what they may have been intended for.. but in terms of applying specific wrapper styles and semantic tags it may make the most sense to do it at the block level as opposed to restricting the entity itself. |
I'm on board with just leaving it as block attributes at the template level. The two things that persuaded me:
So I think just leaving it as normal could be the best solution here. From a theme dev standpoint:
|
Currently, the template part controls look like this:
I would expect them to be the same as the group block including the ability to go full width and change background colors. The full width aspect would be good in the near future for testing, but I expect will no longer be necessary if we add some sort of grid system to the template editor.
Here's what I would expect:
@epiqueras What do you think?
The text was updated successfully, but these errors were encountered: