-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Template Parts: name displayed inconsistent in UI #61175
Comments
Hi @colorful-tones, thank you for addressing this ticket. |
Thanks for clarifying. I've reassigned Bug. I would encourage updating the title for discoverability. Maybe: "Template Parts: name displayed inconsistent in UI" Ultimately, I think that Template Parts will be handled differently, but good to report this. Thanks! |
Hi @colorful-tones, thank you for the suggestion. Regarding your last observation, do you have a specific ticket to refer to in order to discover more about how the template parts will be handled in the future? |
My GitHub searching is not all that great today, but here is one issue to maybe take a peak at and many other links in it to point in your further direction around Template Parts: #55595 |
Adding this to the polish board as these sorts of inconsistencies add up and this would be a good one to rectify. For now, some work is underway to remove the Details view (what's seen in the first 5 seconds) to consolidate it with the Inspector (what's shown after 5 seconds): #59689 This could be a part of that work potentially cc @jameskoster |
Correct me if I'm wrong, but I believe that "areas" are user-defined (via PHP and theme.json) logical placements for matching name template parts. Areas must be associated with an area-tag, which is a valid block-level HTML sectioning element (even if WooCommerce defines a mini-cart area-tag). Areas should carry a stronger significance compared to template parts, as I perceive them to be "required" for the specific template. Leaving only the header and footer is not particularly helpful. It would be interesting to have a representation of the higher-level structure, where you can see the header, the content (identified as the first high-level block), followed by theme-defined areas, optional template parts, and footer. This could help users in understanding the elements' interaction, especially since the "list view" cannot be opened by default, and the right sidebar is the first thing a user sees. I'm not sure if this makes sense, but I'd be happy to discuss it further since I find editing the template crucial yet also the most disorienting. |
The separation of "other template parts" seems like a good idea for all those templates that are instantiated only within the template being edited. However, the question of "areas" defined by the theme remains open, because given the explanation provided in this article (https://developer.wordpress.org/news/2023/06/16/upgrading-the-site-editing-experience-with-custom-template-part-areas/), I would expect to find them in the "areas" group, where you have placed header and footer. The idea of having "title," "content," etc. is okay only if these are template parts or areas; otherwise, I'm not sure it's right to include them under "areas." |
I am referring to what was explained in the previously linked article, which can be better seen in this image. 'Sidebar' is an area registered by the theme and has an associated template part in that specific template, and therefore it is displayed in the list of 'areas.' But if I create a template part while I am editing the page template, it is fine for it to be listed under "other template parts".
The idea of "add a ..." could be interesting because it could hook into the pattern inserter by pre-filtering a specific category. Clearly, the observation you made about WooCommerce is correct, but it would be worth asking whether they are taking the wrong approach in this case, especially considering the improper use of the tag. |
Description
Issues
When highlighting a specific template part, the name shown is almost always incorrect. (detailed in the video)
Inconsistencies
There are some inconsistencies in the editing of a Template part regarding the part's name.
Before entering the template editing mode, the sidebar on the left displays a list of "areas" with specific names. However, when I start editing the template, everything is not registered as an area but rather as a simple template part under a generic "General" area. (detailed in the video)
Improvements
The process of defining a new "area" should be streamlined in the UI of the Template part editing. This will encourage the use of the Site editor as a no-code tool. Currently, in order to define a new area, the user must be able to edit a PHP file and the theme.json.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
template.issues.mp4
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: