Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Template selection #100

Closed
MaggieCabrera opened this issue Aug 27, 2023 · 25 comments
Closed

Template selection #100

MaggieCabrera opened this issue Aug 27, 2023 · 25 comments

Comments

@MaggieCabrera
Copy link
Collaborator

The idea for this theme is to have three possible use cases, hence why we have multiple options for templates like home, page or single. Right now there is no easy way in WordPress to swap an existing template with an alternative provided by the theme in a way that is not manually emptying/deleting the existing template and redoing it. There are some designs explorations for this flow on WordPress/gutenberg#36951 (comment) and I've discussed this with @richtabor during WCUS and we thought that we could make use of the tools that already exist for Block Patterns.

The idea would be to register these alternate versions of the templates as patterns and make use of templateTypes to assign the template that should use this pattern. This already works well for creation of new pages, but we are missing the flow for replacing.

@richtabor
Copy link
Member

We’d remove these templates as “templates” as well, right? I don’t think we need them front and center here, and as template types.

We may want them to show up when you add a new page too (without header and footer).

@dianeco
Copy link

dianeco commented Aug 28, 2023

Can we remove the home.html template? It conflicts with the settings saved in WordPress dashboard > Settings > Reading and can confuse the users.

@richtabor
Copy link
Member

Can we remove the home.html template?

Perhaps we need a quick play-by-play on the options we can use for the main page, and how those will interplay with the templateTypes selection above.

@kafleg
Copy link
Member

kafleg commented Aug 29, 2023

Can we remove the home.html template? It conflicts with the settings saved in WordPress dashboard > Settings > Reading and can confuse the users.

Or we can change home.html to front-page.html?

@maneshtimilsina
Copy link
Contributor

Both home.html and front-page.html will have conflicts with the settings saved in WordPress dashboard >> Settings >> Reading as mentioned by @dianeco

@richtabor
Copy link
Member

This issue would let us swap out entire templates: WordPress/gutenberg#51347

@carolinan
Copy link
Contributor

I do not understand in what way the home template conflicts with the reading settings, as mentioned above. It is the template used to display the blog.

@maneshtimilsina
Copy link
Contributor

@carolinan Go to Settings >> Reading and select A static page option for Your homepage displays. Assign pages for Homepage and Posts page. Check both the homepage and blog post page. I think one of them will not work as expected.

@carolinan
Copy link
Contributor

I made the test, and both the blog and the actual front page display the correct content.

@dianeco
Copy link

dianeco commented Sep 2, 2023

@carolinan In Settings > Reading, I set a static page as my Homepage and my “Blog” page as the Posts page. However, instead of displaying my posts, my Blog page shows a page about architecture (the same page as the homepage of https://2024.wordpress.net/). So, if a user switches their theme to Twenty Twenty-Four, their website will initially display content that is not theirs.

@carolinan
Copy link
Contributor

That does not happen on my installation. Please first try to reset any changes you have made to templates, and make sure you are using the latest version of the theme.

@carolinan
Copy link
Contributor

Make sure that no other template is "assigned" to the page called "Blog".

@dianeco
Copy link

dianeco commented Sep 6, 2023

I'm testing with Twenty Twenty Four trunk without making any changes to the theme on a fresh WordPress installation. The Blog Home template's description is "Displays the latest posts as either the site homepage or as the 'Posts page' as defined under reading settings". So, it's expected to see the content of the home.html (which contains content about architecture) on the Blog page.

twentyfour instawp

@carolinan
Copy link
Contributor

And I do see the content of home.html. I am still confused.
The screenshot above is of home.html. The posts are below that.

I think it is working as expected. It is just a matter of different expectations since the template uses the patterns.

@richtabor
Copy link
Member

richtabor commented Sep 8, 2023

@MaggieCabrera It may be good to try templateTypes out with the twentytwentyfour-page-portfolio-home pattern, in lieu of the home-portfolio.html template, as an alternate blog home. I think we'll run into a few issues that will be good to iron out early.

We may need to have a portfolio page pattern with header and footer parts, so it's a proper full replacement — whereas currently the portfolio page pattern is just the content (like other page patterns). We may need both (which shouldn't be a heavy lift, as we're building with pattern blocks anyhow).

For testing we can just add a new template.

@carolinan
Copy link
Contributor

Unpopular opinion: Maybe they should just be child themes.

@MaggieCabrera
Copy link
Collaborator Author

Unpopular opinion: Maybe they should just be child themes.

Not really unpopular, it's another very valid way of doing the same thing. It's still valid that a theme may want to include different versions of a same template (it's something commercial themes have done very often too in the past). I think having this problem means having this discussion, so that's a good thing.

@richtabor definitely we can add templateTypes but my testing of that has been that it doesn't do much more than Post Types: page is already doing

@richtabor
Copy link
Member

Unpopular opinion: Maybe they should just be child themes.

They're just different page designs; I don't think it's child theme territory.

@richtabor
Copy link
Member

richtabor commented Sep 11, 2023

@richtabor definitely we can add templateTypes but my testing of that has been that it doesn't do much more than Post Types: page is already doing

@MaggieCabrera In my testing we need to remove "Post types: page" from template patterns (related: WordPress/gutenberg#45859), then they show up in the template choose a pattern selector.

And we need to do this:

We may need to have a portfolio page pattern with header and footer parts, so it's a proper full replacement — whereas currently the portfolio page pattern is just the content (like other page patterns). We may need both (which shouldn't be a heavy lift, as we're building with pattern blocks anyhow).

CleanShot.2023-09-11.at.11.38.33.mp4

I just used "page" as a template type for the video, but front-page could work maybe.

@carolinan
Copy link
Contributor

By removing the template files and by removing full page designs that are similar but are intended to have a different context and footers, it feels like the concept of three different use cases is abandoned.

There is no easy way for users to switch both site building templates like the search results page and their content templates (page, post) to the same style: There is no way to switch all templates at once without child themes.

I don't agree that having template files in the Site Editor is confusing. And it is not more confusing than having things like the 404 template show up in the page list...
Especially page template switching is easier in 6.4 with the new template swap when you go to Appearance >Editor > Pages.
But I don't have real user testing data that points to either patterns or templates being easier.

I also don't think that having a portfolio template for a non-portfolio site is confusing. If the naming is the problem, then lets rename it.

For example, all custom page and post templates could be clearly named custom, optional, or alternative:
Custom page with sidebar (has no post meta information because it is a page...)
Custom post with sidebar (has post meta)
Custom page with two columns (this is the portfolio where the post title is on the left)

Custom site building templates (custom archives, index, search) can remain patterns since there is no easy way to replace them without deleting the blocks in the existing template).

But I have lots of opinions and I think that the decision must be based on how @luminuu and @MaggieCabrera wants the theme to work.

@richtabor
Copy link
Member

And it is not more confusing than having things like the 404 template show up in the page list...

Imagine you have three 404 templates. That’s the comparable here.

@MaggieCabrera
Copy link
Collaborator Author

And it is not more confusing than having things like the 404 template show up in the page list...

Imagine you have three 404 templates. That’s the comparable here.

I see this. I get that the list of templates should ideally should show one of each possible option, and then the alternatives should be shown some place else. This is the first time we are offering alternatives to other than the page/single templates, so we are risking polluting that list even more than previous default themes. We need to strike a balance between discoverability and overwhelming the user where he's not expecting.

I'm in the fence here, I think we've already built the expectation of some of the variations to be there (like no title or blank, it feels like we've been adding those templates since forever), but we probably shouldn't push that too much.

@luminuu
Copy link
Member

luminuu commented Sep 19, 2023

What I was originally thinking of how these different content approaches could be implemented was something like this:

CleanShot 2023-09-19 at 17 26 33@2x

These separate templates would have been a dropdown or something and would replace the entire existing template at once. Any default WP view (archive, categories, 404, single) could have multiple different options, or just one default. This would prevent the current "Page Portfolio", "Page Writer" etc on the main templates overview.

But I guess it's now too late already to get something like this done.

@MaggieCabrera
Copy link
Collaborator Author

This will be closed by WordPress/gutenberg#54609, which is a blessed task

@luminuu
Copy link
Member

luminuu commented Oct 11, 2023

While it does work with Beta 3, I found out in my testing yesterday it's not working anymore with the latest Gutenberg version installed, I opened an issue: WordPress/gutenberg#55218

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants