-
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
Site Editor: Add New - Custom/General template #42127
Site Editor: Add New - Custom/General template #42127
Conversation
This is looking good and working well. My one small piece of feedback is that the the description appearing both on the menuitem, and in the modal feels a bit repetitive. I think we can remove it from the modal like so: I acknowledge that some context will be lost in the post editor, but now that we can create templates for single entities we need to revisit that UX anyway (#41257). |
@@ -253,6 +259,19 @@ export default function NewTemplate( { postType } ) { | |||
); | |||
} ) } | |||
</MenuGroup> | |||
<MenuItem |
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.
Should we append this to the existing MenuGroup
? Should we add in a separate one? 🤔 Right now there is more space from the other items due to that..
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.
Nice catch I missed wrapping the item in a group. We want a new group so we have a divider.
|
||
setIsBusy( true ); | ||
|
||
await createTemplate( |
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 don't think we need to await
and close the modal here, as the passed createTemplate
will navigate to a different page after creation and unmount this component.
3faa4df
to
35451ea
Compare
35451ea
to
1a89e8e
Compare
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.
Hi @ntsekouras, @jameskoster thank you for the reviews. Your feedback was applied!
Size Change: +367 B (0%) Total Size: 1.25 MB
ℹ️ View Unchanged
|
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.
Thanks for the design tweak @jorgefilipecosta.
It's somewhat tangential and doesn't need to hold up this PR but I'd love to hear thoughts from @WordPress/gutenberg-design and/or the copy review team on the input helper text:
On reflection I'm not sure that "purpose" is the correct wording, and whether there might be a better example than "full width". Perhaps it should just be:
Describe the template, e.g. "Post with sidebar"
Hi @jameskoster, I like |
@jorgefilipecosta sounds good, let's open a PR and get the wording right therein :) |
This PR adds an option to create a generic template on the site editor. The generic template can be used on any post or page.
Closes: #36860
Part of: #37407
No UI is created, we are using the same modal that already exists on the edit post.
cc: @jameskoster in case you have any design insights.
The template is created in a blank content state for now like what happens for all the other templates.