-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Allow templates to be applied to multiple items #50415
Comments
That would mean that every template that is not the default for the post type is a generic custom template. So the option to select one could also just be removed. That is how the template hierarchy works:
|
Hey @carolinan, thanks for your reply.
I understand your concert and in fact @jameskoster replied to me in #50134 suggesting three options:
Currently, if I want to apply a specific post template to some of my posts, I need to build a custom template, and this is not user friendly as it requires me to build a custom template that has to be designed from scratch, instead of relying a pre-made template that I can be build upon. I can give you a real life scenario where my proposal would make sense: |
I’d love to get a feedback from @jasmussen as well! |
I don't think that more options that does the same thing makes it easier. It sounds to me that the solution is to allow the user to select from a premade template when they create a new custom template. |
Hey, thanks for your energy on the project! Carolina is more knowledgable than myself on the inner workings of templates in the WordPress theming system, so I defer to her. It is my understanding that a fair bit of this falls down to the WordPress template hierarchy. I will say that I think we have an opportunity in the user interface, to increase the utility of those existing templates, and better explain what they do. For example when editing the structure of your site — your homepage, your static subpages, etc — many of the templates that exist are are conceptually related to that site structure, and very much feel like "content" pages. Search and 404 templates come to mind. Even archive, and many of the generic blog templates can be thought of as just pieces of site structure or content that can be edited together. Because all of these templates are automatically applied across your site. Custom page templates, on the other hand, say "Blank page" or "Page with sidebar", do not necessarily fall in that category. They are not applied by default — you have to actively edit a page, then apply that particular alternative page template for it to display. This type of template may also actually accomplish your stated use case, give or take a tweak in user experience. I suspect many users will think of such custom templates differently from the traditional and automatically applied templates. So in my mind, it could make sense to differentiate between the two types. It needs some exploration, though. |
I think it is apparent it needs to be improved, but how? |
This is one concept that explores it: #50418 |
For option 1 C, "Custom", how would you explain to the user that it is not automatically assigned? You would have to select it from the template dropdown in the block editor. Option 1 A (default) and B (one specific) and all templates except the "custom template" at the bottom of the list are automatic. |
"Selected pages" might work; I like it.
When "Add new template" is clicked, there is a modal with a list of templates. All templates are automatically assigned except the bottom one, the custom template, which is separated by a line from the rest. |
Thank you all for working on this. My instinct is that creating templates for specific entities is not a particularly intuitive concept, compared to creating a generic template and applying it. The latter seems more long-winded, but probably makes more sense, and a good design can streamline things for sure. One thing to consider though, is that $custom templates can only be applied to single entries. The template hierarchy would not allow the "Selected Pages" flow when creating a template for something like a post category. This seems like a bit of a shame, and would likely be confusing for end users. Is there anything we can do about this? |
Posts, pages and categories are not handled the same way. A custom template works for post types. |
Okay so the modal window that allows selecting the "Selected" template should appear only for Pages and Posts, not for tags and categories. |
My point was that it could be confusing if you can perform this "Selected pages" flow when creating templates for posts/pages, but not when creating templates for categories, tags, etc? But it may not be a big deal. The bigger question is whether it's something we want to consider enabling in the future. Expanding the template hierarchy has come up before. But I suppose that should be discussed elsewhere. Apologies for the detour :)
I think we should consider this as a part of the work in #50395. |
Perhaps a short note to highlight the related issue. It may end up being something that we action separately but the breadrcrumb trail can be useful. |
Currently, when creating a new template (page, article, etc), you have the option to choose between applying it to all items or to a specific item.
However, it's not clear that if I choose to apply it to a specific item, then I can't reuse it later for other items, because it doesn't appear in the template selection when writing a new article/page. To achieve this, one needs to create a custom template, which isn't very convenient since you start building from scratch and you don't have a pre-made template.
My proposed solution to this issue is changing the option from Specific item to Specific Items.
I've also created a mockup in Figma to show the difference between the current implementation and my proposal.
When choosing "for specific items", you can then select which items to apply the template to.
And then, when the template is published, it's also possible to apply it, when writing a new or article or page, in the template selection.
I believe this change will make the template creation process more user-friendly and improve the overall user experience.
Cc: jameskoster
The text was updated successfully, but these errors were encountered: