WordPress / gutenberg

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

Improve the edit experience for the page that displays latest posts according to reading settings #63748

Open jameskoster opened 1 month ago

jameskoster commented 1 month ago

When configuring a 'Posts page' in reading settings and editing it in the Site Editor, the following issues arise:

  1. Restricted Block Selection: Users cannot select or edit any blocks (except for the header and footer) unless they switch to template editing mode. This requirement is an unintuitive and cumbersome step for users.
  2. Confusing Edit Environment: If the 'Show template' option is toggled off, users find themselves in an odd editing environment where they can add blocks that will never appear on the frontend.
  3. Limited Settings Access: Users cannot manipulate settings like the number of posts per page without switching to template editing mode.

Proposed improvements

Posts page

Given that the 'Posts page' is technically a template, it may be reasonable to allow users to directly manipulate the template blocks. The template that resolves to display this page (either home.html or index.html) will typically only display this one page (unless the theme does not include an archive.html template which is pretty rare), minimizing the risk of users unintentionally affecting other pages.

To improve the editing experience, I propose the following solutions:


This issue is closely related to https://github.com/WordPress/gutenberg/issues/60772

richtabor commented 1 month ago

Here's a recording of the current experience:

https://github.com/user-attachments/assets/df988875-480f-49fd-82fd-9ca7c048f462

felixarntz commented 1 week ago

After initially thinking about this in https://github.com/WordPress/gutenberg/issues/60772#issuecomment-2329507992, sharing here some revision of that idea:

Rather than mixing page and template, might it be a better long-term solution to rethink what defines the blog of a WordPress site? Most confusion today stems from that this is both a page and a template.

I question why the blog needs to be a "page" (WordPress post type) in the first place. Why should there even be a page_for_posts option? Rationale:

Now I'm not saying the blog should be treated entirely like post type templates - it still does need a more prominent role in the UI. But I think for all of the above reasons we should work towards a solution that gets rid of having a "page" for the blog.

jameskoster commented 1 week ago

These are good thoughts, thanks for sharing :)

I question why the blog needs to be a "page"

One argument is that it leans into conventional mental models associated with site management. It seems quite safe to say that users generally think about websites in terms of pages; not templates, archives, or other esoteric concepts. For most people their blog is a page—maybe with some special properties—but for the most part no different to 'About', 'Services', 'Contact', and so on. If that assumption is correct then it seems reasonable that folks would expect to find their blog within the page management section of the admin.

This may go for other 'virtual' pages as well, e.g. the Shop page in WooCommerce, taxonomy archives, maybe even templates like 404 and search results. By presenting these as Pages we can simplify a lot.

I think there's also something to be said about simplifying the optics in the edit experience too. For instance if you go to edit your blog and find yourself editing a template with a complex name like "Index" that can be intimidating.

All that said I do appreciate that this is all a veneer to hide the underlying complexity. But without throwing out the template hierarchy it's tricky to see another approach. If there wasn't a page associated with the blog, what would the navigational flow to edit the blog look like? Currently you have to enter template management, work out which template resolves to display the blog and edit it. Clearly this is a very poor UX for any non-technical users, and difficult to document given there are several templates that can resolve to display the blog.

felixarntz commented 1 week ago

For most people their blog is a page

I question this statement. Even today, the blog is only a "page" in WordPress if it's not configured as the home page. It always is however a template (e.g. home.html/home.php).

No archive in WordPress (whether it's categories, tags, custom post types) is a page, they are all represented by templates. So why should the blog ("post" archive) be any different?

This may go for other 'virtual' pages as well, e.g. the Shop page in WooCommerce, taxonomy archives, maybe even templates like 404 and search results. By presenting these as Pages we can simplify a lot.

When you say "presenting these as Pages", do you mean showing them alongside other WordPress pages, or actually creating WordPress "page" instances for them too? Are you saying that there should be a page for every kind of archive that WordPress has?

jameskoster commented 6 days ago

Sorry, I was talking conceptually. I understand that the posts page is technically a template, the point was that users who are unfamiliar with the template hierarchy think of it as a page. The hypothesis is that the UI would feel more intuitive if it was aligned with that mental model.

When you say "presenting these as Pages", do you mean showing them alongside other WordPress pages, or actually creating WordPress "page" instances for them too? Are you saying that there should be a page for every kind of archive that WordPress has?

This part isn't 100% clear to me, and is where the technicalities get a bit tricky. These are all mostly ideas at this point, working on the assumption that pages are a familiar and intuitive concept, whereas templates (and by extension the template hierarchy) as they exist today are not; especially for 'virtual pages' like the posts page.

Worth reminding (as you know) that this is a very long-standing issue – editing the posts 'page' has been a poor experience in WP since forever. There is time to go broad on ideas.

felixarntz commented 6 days ago

Sorry, I was talking conceptually. I understand that the posts page is technically a template, the point was that users who are unfamiliar with the template hierarchy think of it as a page. The hypothesis is that the UI would feel more intuitive if it was aligned with that mental model.

Okay, so let's decouple the conceptual "page" from the WordPress post type "page" then. What would potentially make sense to me is:

WDYT?

jameskoster commented 3 days ago

if you click "Edit" on one of those archives in the list, it would open the respective template for editing, not a WordPress "page"

That's definitely one approach, but there is a drawback; the 'Edit' button is associated with a specific post/page, but the Editor UI will communicate that you're editing something totally different (a template) which might be confusing. There's also a question about what the canvas should show... generally when editing templates blocks will show placeholder content rather than actual content. This probably isn't ideal in a flow to edit a specific post category (for example).

An alternative approach would be to essentially replicate the page edit experience. So when you go to edit the "Recipes" category via pages:

I suppose the drawback to this approach is that we'd need to 'spoof' pages for all taxonomy archives. But if we're contemplating this for the homepage (when set to display latest posts) I'm not sure how much of a concern that would be? They can likely share the same rules.

which, if it is not also used as the home page, is technically a "page"

If we can refine the edit-ability aspect, the experience around the current posts page might be a decent example of how all of these 'virtual pages' could work.

creativecoder commented 3 hours ago

I like the direction this discussion is going. Putting the technical challenges aside for a moment, I think expanding the idea of what a "page" is could greatly improve the usability of the site editing experience:

Redefining pages

Following this line of thought, the list of pages in the site editor should show any unique url on the site that isn't a single post, term, or custom post type

The most relevant side-effect of this is that any "page" can then be assigned as the home page. Reading settings are flattened to just one setting -- which page is the homepage (very close to https://github.com/WordPress/gutenberg/issues/60772).

But I think it benefits other archive pages as well: author/date/taxonomy archives have their own urls, so could also show in the list of pages. By default, these may inherit the generic archive template. But customizing them to be unique can then be done as if editing any other page.

The huge benefit here is that when I visit the url, I can go and edit the content there without needing to understand the template hierarchy, until I want to make layout edits that apply in multiple places.

Templates

Layouts on the site that are re-used in some way, and don't have their own unique url, stay as templates. These continue to be edited through template editing mode or by going to the Templates section of the site editor.


Coming back to this issue, improving the experience of editing the home and posts pages from the pages list in the site editor seems like a good way to move in this direction.