-
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
Show Template Parts in Flyout Menu (or similar) #20470
Comments
I'm not sure it is necessary to show the template parts in this menu at all. The included template parts can be selected via the navigator or, with some minor changes to the template part blocks, directly in the editor. Why not use the inserter to add or create a new template part? |
The selection that occurs from this menu is different since it isolates the template part. It's the equivalent view you'd get by directly loading a single template post type. |
One thought on the combination of the template previews, and the template part flyout: The position of these elements is different.
Does this mixing of positions feel ok? |
Also, thinking a little bit about mobile. We could make the dropdown a fullscreen modal on small devices, and how the template parts inline: Alternatively, we could keep the dropdown/flyout interaction the same on mobile, repositioning the flyout menu as needed: I thought the flyout might be problematic on mobile devices, but when playing with the the above prototype on my phone it actually feels pretty natural. |
@shaunandrews Could the template parts flyout show up when hovering over a template? Edit: It's not clear to me if the template parts are part of the selected template or if it is a list of all template parts. |
@MichaelArestad list of all so far. |
Ah. Thanks for clarifying @mtias. I think we can move forward with the proposals (without tabs) from @shaunandrews. |
Do we have any existing components which handle flyouts? Do we need to create one? |
Not currently. We need to create one. |
It doesn't look as if the current Popover positioning will be able to handle this style, so I created an issue about improving the API to make it more flexible (#21275). I'm working towards getting a basic flyout working, even if the style doesn't match 100% yet |
Display the current theme name in the template selector of `edit-site`. Since the `/themes` endpoint currently only exposes the `theme_supports` field for each theme, this PR adds a number of additional fields to it, using the `rest_prepare_theme` hook. (I also filed a WordPress/wordpress-develop#222 against Core to extend the, err, upstream endpoint accordingly so that we can eventually drop the filter.) In addition, this PR adds a new `getCurrentTheme` selector and related reducer/resolver/action to `core-data` (including a `themes` reducer for better normalization). Finally, that selector is used to render the theme name in `edit-site`'s template selector. The fields I've chosen to add should be sufficient to implement the on-hover previews seen at #20469 (comment). However, this PR doesn't implement those previews yet, since we need to implement the underlying fly-out menu component first (see #20470).
Given that we'll likely be removing the template dropdown and replacing it with navigation sidebar (#23939), this issue is probably no longer relevant? |
@vindl let's keep this open for now, but focus on the sidebar. If we can get that sidebar implemented, we can close this out. |
This UI has changed quite a bit and is no longer applicable. |
We should find a more scalable way to show template parts as the dropdown could start growing a lot. Either a flyout menu like:
Or something like splitting the whole panel with tabs (Templates and Parts).
The text was updated successfully, but these errors were encountered: