WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.36k stars 4.13k forks source link

When viewing the posts page, “Edit page” control should open the template #63787

Open richtabor opened 2 months ago

richtabor commented 2 months ago

When the "Reading Settings" > Homepage setting is set to "A static page", its difficult to edit the blog — unless you know to navigate not to the page you've assigned, but the Site Editor > Templates > Index template.

You have "Edit page" available in the WP Admin Bar, but it's not helpful.

Current flow

Currently, if you have a block theme active, selecting “Edit page” when viewing the posts page (index or home.html template), opens the page assigned as the "posts page" the Post Editor—but it has no content; it’s a blank page with a notice that the contents on this page technically does not display anything.

Proposal

I propose that if you have a block theme active, "Edit page" opens the Site Editor, with the template of that posts page engaged (home.html if available, or index.html if not).

This would help reduce complexity of understanding the nuances of having a page for posts and a template that you would actually edit when attempting to edit the blog.

Visual

Here's the current flow. You'll see that "Edit page" is not useful, when viewing the posts page:

https://github.com/user-attachments/assets/8f7ab35a-c559-492c-b20e-7ee06d656de5

carolinan commented 2 months ago

My first reaction is a big YES!! to this suggestion. I believe this is solvable, I would just like to see a discussion around the flow. :)

Whether the content that you add to this page displays on the front or not is depending on the template and traditionally, theme authors do not commonly print the post content in this scenario.

richtabor commented 1 month ago

I'm referring to the Posts page (whichever template the site is using). So if you select "Edit page" you don't go to the blank page in the Post Editor, but to that template in the Site Editor.

As a user, how will I understand that I am editing a template? Is the notice that shows at the bottom left corner enough?

I don't think it matters to be honest. It's your posts "page" that you're editing, which you initiated the editing of. Whether or not it's technically a page, or technically a template (it's both ha) I don't think is particularly relevant.

If there is page content, but the template does not have the post content block, should there be a hint or friendly warning when editing the template?

If the first view is the Site Editor template, how easily can I switch to editing the page content?

The "page" should almost never be edited—as it is not reflected on index/home templates. That's why we have the "This is your posts page" notice, to let you know it's not really a page, but a placeholder. I'm suggesting we help orient people where they're intending to go. For the posts page, editing this page really means editing this template.

richtabor commented 1 month ago

Related https://github.com/WordPress/gutenberg/issues/63784

carolinan commented 1 month ago

The "page" should almost never be edited—as it is not reflected on index/home templates

It is reflected if the template contains the post content (block). That is why I wrote "Whether the content that you add to this page displays on the front or not is depending on the template"

carolinan commented 1 month ago

One of the things that I see users requesting is having a featured image on the posts page. They could achieve adding any image to the template: But for it to be the actual featured image, they would need to access the real page. I have not followed up with either of these users to ask if any image at the top of their page would be enough.

The current notice does not actually explain that the content does not show, and it could be updated separately from this suggested flow.

carolinan commented 1 month ago

Technically, where in the code should the check for the posts page be implemented? Before the Edit link is printed in the toolbar? What about when the user goes to Site Editor > Pages > Chosen page > Edit

richtabor commented 1 month ago

That is why I wrote "Whether the content that you add to this page displays on the front or not is depending on the template"

Sorry I'm only referring to the Posts page there. Not the page assigned as the homepage in Reading settings.

richtabor commented 1 month ago

What about when the user goes to Site Editor > Pages > Chosen page > Edit

It should open the template editor, as there is no page content. Otherwise you will need to do this, anytime you view the page in the editor, as seen below.

I have an issue for this here: https://github.com/WordPress/gutenberg/issues/63788

CleanShot 2024-07-26 at 22 23 36

richtabor commented 1 month ago

One of the things that I see users requesting is having a featured image on the posts page. They could achieve adding any image to the template: But for it to be the actual featured image, they would need to access the real page.

I mention in https://github.com/WordPress/gutenberg/issues/63788, but perhaps the posts page is "unlocked" for editing, as it is template and content in one—the template editor is not invoked in full here. That way you can still add a featured image, rename, trash it, etc.

jameskoster commented 1 month ago

This issue feels roughly the same as https://github.com/WordPress/gutenberg/issues/63748.

I'm not sure we should redirect to the template; it will be confusing will likely cause routing issues. Instead how about you stay in the page-edit context but we make a few changes to the UX:

Posts page

I'd add that editing the posts page should by almost identical to editing a homepage set to display latest posts.

What do you think?