-
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
Edit Site: Add home icon to template switcher. #22004
Conversation
Size Change: +251 B (0%) Total Size: 821 kB
ℹ️ View Unchanged
|
The icon should have the same proportions and 24x24 grid of the other icons. I think it'd made sense for it to be aligned with the little circle-dot on the right (Home, then dot). |
This likely needs different scales for different contexts |
I used the SVG @MichaelArestad posted on the issue. Can you post the new SVG here and I'll add it to the icons package and pull it from there? |
@epiqueras This should work for now:
|
That sounds good to me. |
Yeah the icon should be 24x24 like the other icons in the g2 figma file, and icon component. But that includes clearance around the icon. I'll provide an svg when I'm able. |
Try this one:
|
@@ -189,6 +189,7 @@ function gutenberg_edit_site_init( $hook ) { | |||
$template_part_ids = $template_part_ids + $_wp_current_template_part_ids; | |||
} | |||
$settings['templateId'] = $current_template_post->ID; | |||
$settings['homeTemplateId'] = $current_template_post->ID; |
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.
Is this meant to grab the template that is assigned as the home every time?
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.
Yes
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.
I'm confused then regarding when templateId
and homeTemplateId
would be different.
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.
When the client changes templateId
to switch templates.
Home icon merged and available here. |
2f72e70
to
81cca04
Compare
Rebased |
81cca04
to
631bac2
Compare
I hate to frustrate, but just wanted to clarify, this is the latest version of the icon: A little confusion in the icon files led to the double icon, sorry about that. So you can update the file that Jay links to when the svg code I posted. |
Done |
.edit-site-template-switcher__label-home-icon { | ||
width: 24px; | ||
height: 24px; | ||
position: absolute; |
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.
Definitely not a blocker, but you could use something like this demo to make it a little more flexible for adding in things like the dot icon.
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.
Yes, we should probably switch to this soon. I thought I had done it for #21202 but it looks like I never did it.
Visually, looks pretty good. I left a suggestion on the CSS used. Not a blocker, though. Nice work. Thanks. |
Thanks, can I get approval? |
@MichaelArestad we should also start looking at ways in which to surface the homepage setting (blog or static page or front-page template) and switching between them. |
Closes #20788
Description
This PR adds a home icon to the current home template in the template switcher.
How has this been tested?
It was verified that the home icon shows for the home template in the site editor's template switcher.
Screenshots
Types of Changes
New Feature: The site editor's template switcher now has an icon to show the current home template.
Checklist: