-
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
Site Editing: Simplify template part toolbar #27397
Conversation
I think the above iteration would be good to try. Adding the Needs Dev label as it goes beyond my designer brain to implement :D |
This seems much better to me. Not sure about the menu that opens, it feels like it should be the default transforms menu perhaps augmented with the template part switcher. |
Agreed. Additionally, renaming a template-part could possibly, probably, and in fact most likely interfere and prevent us from implementing #27337. footer, header etc are currently determined by their "name". Renaming them can cause issues if not properly implemented... The template-part's name is referenced in the template, so if I change the template-part's name while editing the |
I think title and description (not slug) could be valuable to be editable, so if you have multiple headers saved for different purposes you can describe their intent |
Yeah, if the slug remains unchanged there shouldn't be any issues 👍 |
Different headers will still need different slugs though, right? Could the name could be appended to the slug, making the whole thing behave like get_template_part()? That would raise the question of how the "default" |
I think that would be ideal... So we'd have Thinking out loud, we wouldn't want users to be able to add a footer template-part in lieu of a header... So if we have a "header" area, users would preferably only be able to choose from one of the available headers - or create a new header. So if we go down that road, perhaps we should start thinking of template-part "zones"? 🤔 |
That's an interesting idea, but I wonder if it might be too restrictive? I'm not sure how sidebars would interact with headers / footers – what if I wanted a full-height sidebar? 🤔 |
This is how renaming now works after recent changes. Renaming only changes the title and not the slug.
Agreed it may not need to be this prominent. However, I would argue we should move the renaming feature "somewhere" that is still usable inside the editor. Any ideas where it should go?
Creating any new template part starts with the title "Untitled Template Part", this should remain easily re-namable in some way without leaving the editor. Im definitely in agreement with the new design, but I think it would be a shame for the renaming feature to disappear altogether. |
I'm working on some ideas that will most likely be shared as a part of the designs for this issue. Ideally renaming a template part should be somewhat consistent with renaming a regular template. |
Using the same UI for the reusable blocks transform menu and the template part switcher makes sense to me, but just to clarify, are we getting rid of the "Transform to" options for template parts entirely? Or are we combining them with the "Switch to" options in James's mocks? |
I'm not sure, because we also need to account for patterns here. Also it's not an interaction we support elsewhere (like swapping a reusable block for another). The closest I can think of is the "Replace" we have on images. I think my vote would be to not touch this just yet and leave it on pause until the patterns flow is worked out. |
Latest explorations in this context are shared in #28737 (comment). I just noticed that the concepts there include a transform option on the template part block... you can probably ignore that detail – I don't think template parts should be transformable 😅 |
Aren't there cases where you might want to add a layout wrapper using transforms? Like placing a navigation in a column or a group. |
@@ -89,3 +91,13 @@ | |||
box-shadow: 0 0 0 $border-width var(--wp-admin-theme-color); | |||
} | |||
} | |||
|
|||
.block-editor-block-toolbar__slot { | |||
.components-toolbar-group { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Careful with "order", as they might make for inopportune tabbing flows.
Sidebar might be a better example, I would imagine it was able to sit at any level of the hierarchy, whether inside a group, or a column. |
Perhaps that would live in the "transform menu", but it isn't really a transform per se, and so would possibly need a unique treatment. I'm also wondering if this "transform" wouldn't be better handled by the pattern work we've been exploring recently. It seems plausible that high-level layout patterns that include elements like sidebars could exist. I am sure we'll look at this more closely when we (eventually) get around to from-scratch template creation flows. |
Revisiting this once we have the toolbar pattern insertion flow more well defined makes makes sense to me. On that note, after a brief investigation yesterday, simplifying the template part toolbar and the solution to handle switching template part entities is pretty straightforward. (At least for the existing mocks we have) If we eventually decide that we'd like the end state to look like this, it should be relatively easy to implement. 👍 |
Removing the input from the toolbar would also solve #28825 |
@jameskoster depending on how long it takes for us to find a good solution for the "switch" flow we might consider updating the icon from the standalone chevron to something else in the meantime. |
Here's the current template part toolbar:
While template part renaming is an important feature, I am not convinced it needs to be so prominent in the UI. Renaming a template part is a relatively rare exercise after all.
If instead we just display the template part name we can remove the "name" label, and simplify the toolbar while saving space:
Renaming can still be accomplished via the Appearance > Template Parts screen, and we might consider adding it to the ellipsis menu in the template part toolbar as well in the future.
In this branch I have also moved the name 'above' the alignment tool using CSS, but I am certain there is a better way to do that :D