-
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
Try: Update template titles #51428
Try: Update template titles #51428
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple suggestions. Might not want to implement all of them. Naming is hard.
@@ -146,19 +146,19 @@ function gutenberg_get_default_block_template_types( $default_template_types ) { | |||
} | |||
if ( isset( $default_template_types['single'] ) ) { | |||
$default_template_types['single'] = array( | |||
'title' => _x( 'Single', 'Template name', 'gutenberg' ), | |||
'title' => _x( 'Single Posts', 'Template name', 'gutenberg' ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'title' => _x( 'Single Posts', 'Template name', 'gutenberg' ), | |
'title' => _x( 'Single Post', 'Template name', 'gutenberg' ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this exercise I considered the template names in terms of what they 'apply to', hence using the plural form here. The singular form makes it slightly less obvious that the template will apply to all posts.
This format is also useful in the add-template flow, if we frame that as: "What would you like to apply the template to?", there would be options:
- Single posts
- Choose a post
You can see those designs in #50395.
'description' => __( 'Displays single posts on your website unless a custom template has been applied to that post or a dedicated template exists.', 'gutenberg' ), | ||
); | ||
} | ||
if ( isset( $default_template_types['page'] ) ) { | ||
$default_template_types['page'] = array( | ||
'title' => _x( 'Page', 'Template name', 'gutenberg' ), | ||
'title' => _x( 'Pages', 'Template name', 'gutenberg' ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'title' => _x( 'Pages', 'Template name', 'gutenberg' ), | |
'title' => _x( 'Single Page', 'Template name', 'gutenberg' ), |
@@ -167,7 +167,7 @@ function gutenberg_get_default_block_template_types( $default_template_types ) { | |||
} | |||
if ( isset( $default_template_types['author'] ) ) { | |||
$default_template_types['author'] = array( | |||
'title' => _x( 'Author', 'Template name', 'gutenberg' ), | |||
'title' => _x( 'Author Archives', 'Template name', 'gutenberg' ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'title' => _x( 'Author Archives', 'Template name', 'gutenberg' ), | |
'title' => _x( 'Single Author Post Archive', 'Template name', 'gutenberg' ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to the comment about plurals above, I think the use of 'Single' here can potentially be a bit confusing.
I don't know that we need to include 'post'... it feels like a technicality that can be defined in the description.
@@ -209,13 +209,13 @@ function gutenberg_get_default_block_template_types( $default_template_types ) { | |||
} | |||
if ( isset( $default_template_types['attachment'] ) ) { | |||
$default_template_types['attachment'] = array( | |||
'title' => _x( 'Media', 'Template name', 'gutenberg' ), | |||
'title' => _x( 'Attachment Pages', 'Template name', 'gutenberg' ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'title' => _x( 'Attachment Pages', 'Template name', 'gutenberg' ), | |
'title' => _x( 'Single Attachment Page', 'Template name', 'gutenberg' ), |
Thanks @alexstine! |
Flaky tests detected in 6a469cb. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5390898135
|
Thanks for taking a stab at this. To Alex' point, yes, naming is hard. I'm in general on board with most of these, but the three that stand out to me — and this is almost certainly due to my historic knowledge of WordPress — is Front Page, and Index. I'm not convinced "Homepage" is better than "Frontpage". "All Posts & Pages" instead of "Index" is unclear to me, but that may betray a technical gap on my end: shouldn't it just be "All Posts"? |
I think the main argument for "homepage" is that being the term used in reading settings, and the front-page template will always display the homepage regardless of settings. "Homepage" feels like it might be a more familiar term in general, but that may be language dependent? Index is probably the trickiest to get right. There are two angles to capture:
"All Posts" covers the first angle, but not the second. Perhaps something like "Base" or "Default" 🤔 Or, we could just leave it alone. The technical name may not be so bad considering:
We might even de-emphasise / hide Index when the conditions are right, but that's one to explore separately. |
I'd be tempted to leave it alone, at least for now, but will also acknowledge that this is my template hierarchy and historical "template names" lore that gives me bias.
The second use case seems exotic to me, and something we could potentially address in the template description, rather than the title itself? |
I reverted the change to Index. |
It would also be nice to leave Front page as it is. Going through the list. Home → Blog Page Front Page → Homepage Singular → Single Entries Page → Pages Archive → All Archives Category → Category Archives Date → Date Archives Media → Attachment Pages Search → Search Results 404 → Error: 404 I believe there are a few people whom might want to know about this PR. |
With naming I like to do the exersize where you start a sentence and you have to end it - it helps with the consistency. This would also help with the discussion on singular or plural.
|
Including 'page' in the 404 title could work given it appears in the Pages panel too. |
On a similar train of thought, I wonder if it might be worth considering leaning more into 'page' as a term rather than 'archive', where appropriate. 'Page' is probably a bit friendlier, and the template hierarchy does refer to many templates as pages, so there's precedent. Instead of:
We might try:
|
Just be careful conflating pages. As in page.php or frontpage.php are also page templates. |
That would create too much focus on the word page. It is better to keep the word archive. As in a sense that is what it is. |
I think that
Will make it easier for any new user who has never needed to figure out what the "home" template is. I think it will be confusing if the HTML file names do not match the title. How will beginner developers who want to |
@carolinan yes that's the tricky part to balance. It's a question about who the UI should be optimised for, technical users (theme developers), or non-technical users. The current setup caters more to the former, but in doing so makes things a bit more confusing than they might be for the majority. I didn't mock it up yet, but it may be reasonable to include the technical name somewhere in the template details panel as a hint for developers? |
Taking stock:
Can we do the following?
The description becomes a bit more verbose, but I don't think that's a problem, in fact it's part of the point of the detail pages that they can afford this pertinent information. If we do those changes, I think we can land this rename in time for 6.3. This gives us the beta phase to then listen to feedback, and revert if we need to. What do you think? |
That sounds very sensible to me |
@jasmussen I think that's a good point about the Home template. It's really the only one where a developer might not make the connection immediately. Things like "Date archives" → |
I pushed a (hopefully) simpler solution. "Blog page" → "Blog home page". What do you think? I'm not sure, but a core patch may be required for this. Perhaps @ntsekouras knows? |
I agree the description works better than the ellipsis menu, because that menu is mostly used for actions, not information. |
@carolinan how do you feel about the updated title instead? It's a little tricky to fit the technical name into the current description, but I would welcome any ideas:
|
Should "Homepage" just be "Home" and the "Blog page" be "Blog"? "Page" isn't appended to other template titles. |
Size Change: +95 B (0%) Total Size: 1.44 MB
ℹ️ View Unchanged
|
* Update template titles * Fix typo Co-authored-by: Alex Stine <[email protected]> * Revert Index rename * "front page" -> "homepage" * Update 404 Page make more sense given the template appears in the Pages panel too. * Front Page * home title + description * Revert Home name change, and move compat files * separate code for wp versions * update tests --------- Co-authored-by: Alex Stine <[email protected]> Co-authored-by: ntsekouras <[email protected]>
I just cherry-picked this PR to the add/pre-beta1-bugfixes branch to get it included in the next release: 449ec38 |
* Restore sidebar in focus mode on Pattern click through in Browse Mode Library (#51897) Brings back #51492 * [Command center]: Add preferences and keyboard shortcuts commands (#51862) * [Command center]: Add preferences and keyboard shortcuts commands * update labels * [Site Editor]: Fix `library` command path (#51837) * Updating social link attributes (#51997) * Try: Update template titles (#51428) * Update template titles * Fix typo Co-authored-by: Alex Stine <[email protected]> * Revert Index rename * "front page" -> "homepage" * Update 404 Page make more sense given the template appears in the Pages panel too. * Front Page * home title + description * Revert Home name change, and move compat files * separate code for wp versions * update tests --------- Co-authored-by: Alex Stine <[email protected]> Co-authored-by: ntsekouras <[email protected]> * Update text color (#51965) * Modal: Add small top padding to the content so that avoid cutting off the visible outline when hovering items (#51829) * Site Editor: Fix focus cutoff in add template modal * Add padding-top to the modal content * Remove unnecessary padding-top * Remove unnecessary padding-top * Update changelog * Revert top padding from block patterns list * Revert top padding from block patterns list * Remove unnecessary changes * Remove unnecessary changes * Add CSS inline comment * Change padding metrics * Rest API: rename navigation fallback classes from WP_ to Gutenberg_ (#51959) * The `WP_REST_Navigation_Fallback_Controller` class has been committed to core and therefore results in a naming conflict and unit test failures. Ideally `WP_REST_Navigation_Fallback_Controller` should have been named `WP_REST_Navigation_Fallback_Controller_Gutenberg` and extended `WP_REST_Navigation_Fallback_Controller`. But we can conditionally load the file instead. * Renamed WP_Classic_To_Block_Menu_Converter to Gutenberg_Classic_To_Block_Menu_Converter Load WP_REST_Navigation_Fallback_Controller dependencies in load.php * Renamed all 6.3 classes to have the Gutenberg_ prefix. This should avoid compat errors and hopefully some confusion later. * Also rename test files for completeness * Updated deprecation notices to refer to Gutenberg classes * Fix phpunit failures (#51950) * Fix phpunit failures * Add comment * Update comment with actual reason this fix works --------- Co-authored-by: Dave Smith <[email protected]> Co-authored-by: Nik Tsekouras <[email protected]> Co-authored-by: Ramon <[email protected]> Co-authored-by: James Koster <[email protected]> Co-authored-by: Alex Stine <[email protected]> Co-authored-by: Aki Hamano <[email protected]> Co-authored-by: Robert Anderson <[email protected]>
Primarily, this class reverts some of the changes made to template titles in Gutenberg: WordPress/gutenberg#51428 It keeps some of the ideas with alterations to the singular/plural forms. Revisit this and do a full audit over template names. This class also sets us up to add some templates that core doesn't yet handle, which need to be added in.
@tellthemachines this was supposed to make it into beta 1 but I am still seeing in beta 3 the following (with 404 listed up top): If I use 6.3-beta3-56182, I'm able to correctly see the following: Can you confirm what's going on here and ensure it makes it appropriately into beta 4? |
@annezazu something I've noticed happening intermittently is: if you customised a template like 404 before the name change, it seems to retain that name in perpetuity. But if you Clear customizations it will 'revert' to the new name. Might be worth investigating. |
The core patch was committed last Thursday so it's in core trunk now, ready to go into Beta 4. |
Excellent. Thank you for confirming! |
* Update template titles * Fix typo Co-authored-by: Alex Stine <[email protected]> * Revert Index rename * "front page" -> "homepage" * Update 404 Page make more sense given the template appears in the Pages panel too. * Front Page * home title + description * Revert Home name change, and move compat files * separate code for wp versions * update tests --------- Co-authored-by: Alex Stine <[email protected]> Co-authored-by: ntsekouras <[email protected]>
Warning: Type of PR label error To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. |
Part of #50395
What?
Update template titles.
Why?
See #47551, #44524. In short: Template names are not always particularly intuitive. This PR sacrifices a little brevity in order to (potentially) address that.
How?
Update
title
s in$default_template_types
. Here's the full list of changes:Testing Instructions
Screenshots
Note the names in the modal, and in the sidebar.
Before
After
Caveat: Any theme templates that have been customised will retain their old names. I'm not sure how to address that, if we should, or if it's even possible.