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

Use an alternate "portfolio" template for pages/posts #406

Closed
wants to merge 7 commits into from

Conversation

richtabor
Copy link
Member

Description

@MaggieCabrera Explored your PR as template type pattern, instead of a template within the site editor sidebar. With this method, you can assign the template to pages or posts (holistically, or single).

Screenshots

CleanShot.2023-09-18.at.13.06.03.mp4

@richtabor richtabor self-assigned this Sep 18, 2023
@richtabor richtabor changed the title Use as an alternate template for pages/posts Use an alternate template for pages/posts Sep 18, 2023
@richtabor richtabor changed the title Use an alternate template for pages/posts Use an alternate "portfolio" template for pages/posts Sep 18, 2023
@carolinan
Copy link
Contributor

carolinan commented Sep 18, 2023

This pattern selection only works if the template is blank. By making it a template, any post and page be changed without having to delete anything.

It creates a new template in the database, and by having the template as part of the theme, the user doesn't have to do this step.

@richtabor
Copy link
Member Author

any post and page be changed without having to delete anything.

Currently you can do this with posts and pages like in my screen recording, without having to delete anything.

by having the template as part of the theme, the user doesn't have to do this step.

Yes, but the consequence is that it's confusing to see a Portfolio template in the site editor, if you don't have a portfolio site.

We need to decide on the route we go:

  • Do we make templates available everywhere as a one-off application (essentially a post format type deal), or...
  • Do we leverage template types so that alternates are available to swap out holistically in the site editor?

I lean towards the latter, where we register alternate templates, not make all templates always available. Otherwise it's confusing seeing alternate templates in the site editor and trying to figure out how to make one of those your page template too.

The same argument holds for template parts (header/footer) where we don't want them all always visible, but you can swap to an alternate and have it consistent throughout your site (#9 (comment)).

@carolinan
Copy link
Contributor

Creating a new template is not at all intuitive when what you want it so change the template.
Custom page and post templates have been available in themes, including default themes, for many more years than the Site Editor has been available.

@richtabor
Copy link
Member Author

richtabor commented Sep 18, 2023

Creating a new template is not at all intuitive when what you want it so change the template.

I'm thinking at the site level, not the page level. Do you want your single posts to look like A, or B? Not every time you want to publish a post, you decide if you want A or B.

Custom page and post templates have been available in themes, including default themes, for many more years than the Site Editor has been available.

I don't understand the relevance.

@carolinan
Copy link
Contributor

The relevance is that it is easy for current users to change templates in the block editor. By making it a pattern only, that option is not available.

Site level and post level does not have to be mutually exclusive, not one or the other.

@richtabor
Copy link
Member Author

richtabor commented Sep 18, 2023

I would rather not include a bunch of templates that confuse the site editor experience. As-is, the list of templates is very confusing, and most are unlikely to be relevant to the majority of sites.

@carolinan
Copy link
Contributor

carolinan commented Sep 19, 2023

That rebase did NOT go as expected, sorry Rich. I don't know how to revert it.

@carolinan
Copy link
Contributor

I recorded some videos of template swapping, but then realised that the page template for the portfolio was never removed, only the posts template. So my videos still used the html template not the pattern.

@MaggieCabrera
Copy link
Collaborator

I think the problem with the rebase is that this branch wasn't created from trunk. Do you mind if we do this on my PR instead?

I agree that polluting the list of templates with confusing options is probably not the best idea. A portfolio site would swap to this particular pattern as the default page/post template and then they have the option to select one of the other templates for their text-based posts instead. We need to iron out and document the different flows because it's hard to follow for us who are working on this, so I expect it to be confusing for users anyway. Also, there's work being done on these flows that even if they don't make it to 6.4, they most likely will for 6.5 which is still early in the lifecycle of TT4 and I'm happy with that as long as they get there.

@MaggieCabrera MaggieCabrera force-pushed the add-single-portfolio branch 2 times, most recently from 561d433 to 216a353 Compare September 19, 2023 11:13
/**
* Title: Portfolio Single Template
* Slug: twentytwentyfour/template-single-portfolio
* Template Types: page, single
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My PR ended up being mostly the same but I have posts/single here. I don't think we should have page here, maybe we should have all 3? we can revisit that

@MaggieCabrera
Copy link
Collaborator

I'm closing this one since my PR was merged but they ended up being mostly the same implementation. Thank you for this

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

Successfully merging this pull request may close these issues.

3 participants