-
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 Editor: Add ability to focus only on editing page content #49980
Site Editor: Add ability to focus only on editing page content #49980
Conversation
Size Change: +1.54 kB (0%) Total Size: 1.37 MB
ℹ️ View Unchanged
|
Hey Robert. This is exciting! I went to gutenberg.run and inserted the PR number and went to the Site Editor. The Navigation area is not seen there. Test site. Regarding editing a page (or post) through the Site Editor. PagesWhen I select the Pages option I would expect to see the list of pages on the site (even the parent - sub page structure) clicking a page to edit it. NavigationI would expect something feature full as this screen. Nav block features List view version 2-3. (Should not look like that but should contain most of the features of the old Menus screen.) What I am saying is that using Navigation to click to edit a page to me feels out of the place of what Navigation should do (at the moment). Navigation really just helps me create a good navigation for the page. Or helps me create multiple menus that can be used different locations of the site. It would be great to look at the features of the old Menus structure and see what could/should be transferred over to the Navigation block List view as well as the Site Editor sidebar Navigation area. Editing a page which is very interesting is further down the list of what the Navigation list currently is capable of. I would say let's get Navigation in a great state with needed features and the structure in place and then relook at editing a page or other elements in the menu. Thank you for an awesome exploration! |
@paaljoachim I added some extra context to this work here.
Your thoughts here align well with milestone 1 and 2 listed here. This particularly piece of work is mostly satisfying milestone 1, after which we can look at #2 which is surfacing content in the sidebar (via pages item or similar). |
Flaky tests detected in 5d317d8. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4782003853
|
@paaljoachim There's a bug where the Navigation section doesn't appear until you save a Navigation menu via the Navigation block. Once you do that it should appear and you can test this PR. Agree that surfacing content within the site editor needs work. Not aiming to do that here though. |
Functionally I'm happy with this. Just need to add inline documentation, tests, etc. I'm away tomorrow but on Wednesday will split out the |
I've split the more foundational block-editor changes out into #50082 which will need to be merged first. |
Apologies if I'm doing something wrong, my environment has been acting up, but I can't seem to test this latest that well: I have a custom menu set up. Do I need to also check out #50082? Thanks for all the work here, this is potent and important stuff 🔥 |
First of all thank you for the various links @SaxonF . Those are very fascinating things I got to spend more time going through! Retesting. Began with using gutenberg.run. Went into a template and added a navigation block. Saved it and expected it to show up in the left sidebar. But it did not. I probably forgot something. Anyhow I am now using the Gutenberg PR build I got to say that the approach happening here has a lot of potential and is highly interesting to test out! Using my own dev site running WordPress 6.2. Navigation is seen in the left sidebar with links to three pages. Top area in Page information: 1st panel: Content Comments did not show up 2nd panel: Template Some thoughts as they come up. Perhaps there should be a panel for: What is the purpose of the Content panel? I ask because the page is active showing template content and not page content. When I click the Post Featured Image I see a Replace button show up instead of the toolbar. The sidebar shows interesting information. Information should be associated with the current editing mode one is in. Be it a single page (such as About Us) or a Page template. How would we go from an About Us page -> Page template and then back again? Should there be a list of pages in the sidebar that use a specific template? So that one can choose any of the listed pages, edit in the site editor and then go back again into the Page template. Select another page and edit that and then return again to the Page template. This way sidebar information for example for About Us / Page template would be stronger associated with each other. As they contain similar information associated to the environment these are seen in. |
This works -- I did find a couple of issues though:
Screen.Recording.2023-04-27.at.3.32.26.PM.movI realize this is just a first step, there's some more design feedback I would give, but I'll wait for this to develop more. :) |
@jasmussen: I'm not sure what's going on there. It looks like you're running into a bug with the Navigation list that appears in the sidebar. Clicking on an item there should open the page but for you it seems to be opening the link modal. Does it happen for you also in |
We have a separate issue for post content blank state. Definitely agree it needs to be resolved before releasing this more widely.
We decided to remove any sort of selection mechanics for template blocks but probably worth experimenting with to see if we can educate people on why they can't select anything outside post content e.g. trigger snackbar on each click |
Is the snackbar supposed to only trigger on the first click on a template block? It wasn't triggering at all, even on the first click. |
Gah, always accidentally ping everyone when changing the base of a PR. I'll scrap this and open a new PR: #50857 |
What?
Requires #50082.
Part of #49404 and #44461.
Adds functionality to the Site Editor that lets you, when editing a page, switch between focusing on editing the page's content versus editing the page's template.
Why?
Adding some separation helps to prevent a very common point of frustration encountered when a user attempts to change something on a specific page but the change is made everywhere.
How?
wp-edit-site
that lets the user toggle between focusing on editing the template and focusing on editing the page.wp-block-editor
.templateLock: 'contentOnly'
to be provided at the root level via editor settings.settings.contentBlockTypes
.Testing Instructions
templateLock: 'contentOnly'
functionality still works by inserting a block pattern that uses it, e.g. this one: https://gist.github.com/richtabor/ddeea41ced691721318649bea8ce9db8Screenshots or screencast
Kapture.2023-04-21.at.16.14.44.mp4