Site Editor: Navigation templates #25739
Conversation
Size Change: +168 B (0%) Total Size: 1.18 MB
|
Filename | Size | Change | |
---|---|---|---|
build/a11y/index.js |
1.14 kB | 0 B | |
build/api-fetch/index.js |
3.35 kB | 0 B | |
build/autop/index.js |
2.72 kB | 0 B | |
build/block-directory/style-rtl.css |
943 B | 0 B | |
build/block-directory/style.css |
942 B | 0 B | |
build/block-library/theme-rtl.css |
741 B | 0 B | |
build/block-library/theme.css |
741 B | 0 B | |
build/block-serialization-spec-parser/index.js |
3.1 kB | 0 B | |
build/date/index.js |
31.9 kB | 0 B | |
build/deprecated/index.js |
772 B | 0 B | |
build/dom-ready/index.js |
568 B | 0 B | |
build/dom/index.js |
4.42 kB | 0 B | |
build/edit-navigation/style-rtl.css |
868 B | 0 B | |
build/edit-navigation/style.css |
871 B | 0 B | |
build/edit-widgets/style-rtl.css |
3 kB | 0 B | |
build/edit-widgets/style.css |
3 kB | 0 B | |
build/editor/editor-styles-rtl.css |
492 B | 0 B | |
build/editor/editor-styles.css |
493 B | 0 B | |
build/format-library/style-rtl.css |
547 B | 0 B | |
build/format-library/style.css |
548 B | 0 B | |
build/hooks/index.js |
1.74 kB | 0 B | |
build/html-entities/index.js |
621 B | 0 B | |
build/i18n/index.js |
3.54 kB | 0 B | |
build/keycodes/index.js |
1.85 kB | 0 B | |
build/list-reusable-blocks/index.js |
3.02 kB | 0 B | |
build/list-reusable-blocks/style-rtl.css |
476 B | 0 B | |
build/list-reusable-blocks/style.css |
476 B | 0 B | |
build/notices/index.js |
1.69 kB | 0 B | |
build/nux/style-rtl.css |
671 B | 0 B | |
build/nux/style.css |
668 B | 0 B | |
build/primitives/index.js |
1.34 kB | 0 B | |
build/redux-routine/index.js |
2.85 kB | 0 B | |
build/token-list/index.js |
1.24 kB | 0 B | |
build/viewport/index.js |
1.74 kB | 0 B | |
build/wordcount/index.js |
1.17 kB | 0 B |
Looking forward ideas about how we should handle empty menus. For example
EDIT: Probably this wouldn't work in practice, since we might have other kind of items in the menu. So probably the best way is to create a context and store what should be visible. And nested menus..... |
I don't think we need to show this in the sidebar anymore. At least I haven't seen it in any of latest design iterations. It might make more sense in Document Settings dropdown maybe. Also I don't think we need a Current Template section. That should be obvious from active item and title in the header? |
It's probably fine to leave it as a placeholder for now until we add more items for it. And yes, this should be a separate issue for navigation component and not handled in this PR. |
I left it there so we can overwrite templates. I think it will be replaced by the + button later |
In that I case I think it's better to introduce it when we add the +/overwrite functions then? |
cc @ockham since you worked on template resolution before :) |
packages/edit-site/src/components/left-sidebar/navigation-panel/index.js
Show resolved
Hide resolved
...ages/edit-site/src/components/left-sidebar/navigation-panel/constants.js
Outdated
Show resolved
Hide resolved
...rc/components/left-sidebar/navigation-panel/template-navigation-items.js
Outdated
Show resolved
Hide resolved
...rc/components/left-sidebar/navigation-panel/template-navigation-items.js
Outdated
Show resolved
Hide resolved
...rc/components/left-sidebar/navigation-panel/template-navigation-items.js
Show resolved
Hide resolved
This works nice, thanks @david-szabo97! I'll open two follow up issues shortly:
|
Nice work @david-szabo97! |
@@ -177,6 +202,13 @@ function filter_rest_wp_template_collection_params( $query_params ) { | |||
* @return array Filtered $args. | |||
*/ | |||
function filter_rest_wp_template_query( $args, $request ) { | |||
// Create auto-drafts for each theme template files. | |||
$block_template_files = gutenberg_get_template_paths(); |
vindl
Oct 6, 2020
Member
As already mentioned, accessing these files on each request is going to have a negative impact on performance. We can probably store this info once on theme activation and we'll also need it after theme updates.
As already mentioned, accessing these files on each request is going to have a negative impact on performance. We can probably store this info once on theme activation and we'll also need it after theme updates.
// General | ||
'front-page': { | ||
title: 'Front page', | ||
description: '', |
vindl
Oct 6, 2020
Member
We could've added "Display the contents of your Front Page" here, or something along the similar lines.
We could've added "Display the contents of your Front Page" here, or something along the similar lines.
mcsf
Oct 7, 2020
Contributor
@david-szabo97 @vindl — Let's not forget i18n. Constants files like this should be i18n-ready from the start, otherwise getting everything ready for a testable Site Editor around WP 5.6 will be much more difficult.
@david-szabo97 @vindl — Let's not forget i18n. Constants files like this should be i18n-ready from the start, otherwise getting everything ready for a testable Site Editor around WP 5.6 will be much more difficult.
); | ||
|
||
return ( | ||
<NavigationMenu |
vindl
Oct 6, 2020
Member
We could've delayed adding this until we had actual content for it.
We could've delayed adding this until we had actual content for it.
## Description Discovered while working on WordPress/wordpress-develop#1267. First introduced in `lib/template-loader.php` in #25739. No longer used per #26650 (where its callsites started using [`_gutenberg_get_template_paths`](https://github.com/WordPress/gutenberg/pull/26650/files#diff-f5b03c388f81fea69d0ababd289047e20deaad43084ad6e00ec14a5613e25136R60) in `lib/templates-sync.php` -- now in [`lib/full-site-editing/block-templates.php`](https://github.com/WordPress/gutenberg/blob/d7714aa8adf19277da1f0ea83b20be1cf234e50c/lib/full-site-editing/block-templates.php#L17)).
…ess#32066) ## Description Discovered while working on WordPress/wordpress-develop#1267. First introduced in `lib/template-loader.php` in WordPress#25739. No longer used per WordPress#26650 (where its callsites started using [`_gutenberg_get_template_paths`](https://github.com/WordPress/gutenberg/pull/26650/files#diff-f5b03c388f81fea69d0ababd289047e20deaad43084ad6e00ec14a5613e25136R60) in `lib/templates-sync.php` -- now in [`lib/full-site-editing/block-templates.php`](https://github.com/WordPress/gutenberg/blob/d7714aa8adf19277da1f0ea83b20be1cf234e50c/lib/full-site-editing/block-templates.php#L17)).
## Description Discovered while working on WordPress/wordpress-develop#1267. First introduced in `lib/template-loader.php` in #25739. No longer used per #26650 (where its callsites started using [`_gutenberg_get_template_paths`](https://github.com/WordPress/gutenberg/pull/26650/files#diff-f5b03c388f81fea69d0ababd289047e20deaad43084ad6e00ec14a5613e25136R60) in `lib/templates-sync.php` -- now in [`lib/full-site-editing/block-templates.php`](https://github.com/WordPress/gutenberg/blob/d7714aa8adf19277da1f0ea83b20be1cf234e50c/lib/full-site-editing/block-templates.php#L17)).
## Description Discovered while working on WordPress/wordpress-develop#1267. First introduced in `lib/template-loader.php` in #25739. No longer used per #26650 (where its callsites started using [`_gutenberg_get_template_paths`](https://github.com/WordPress/gutenberg/pull/26650/files#diff-f5b03c388f81fea69d0ababd289047e20deaad43084ad6e00ec14a5613e25136R60) in `lib/templates-sync.php` -- now in [`lib/full-site-editing/block-templates.php`](https://github.com/WordPress/gutenberg/blob/d7714aa8adf19277da1f0ea83b20be1cf234e50c/lib/full-site-editing/block-templates.php#L17)).
david-szabo97 commentedSep 30, 2020
•
edited
Description
A couple of things done in this PR to match the draft #23939 (comment))
Themes
Current Theme
groupCurrent Template
groupTemplatesMenu
)TemplatePartsMenu
)TemplatesPagesMenu
)TemplatesPostsMenu
)overflow:hidden
on theNavigation
component)How has this been tested?
yarn wp-env start
Screenshots
Types of changes
New feature
Checklist: