You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Site Editor: Consider adding in descriptions to "Add New Templates" flow #59046
Right now, you can toggle/hide descriptions for templates when in data views, but when you click "Add a new template" there's no description of the template you might add:
This makes it hard to know at a glance what each template might do. Perhaps when you hover, a tooltip could show? Or we could consider adding in very brief descriptions.
In #50595, when this modal dialog was implemented, a description existed. After that, it seems that the description was deleted in #51806.
I'm leaning toward bringing back the description, but the current description is quite long, so I think it would be nice to add a short description.
example:
functionget_default_block_template_types() {
$default_template_types = array(
// ...'archive' => array(
'title' => _x( 'All Archives', 'Template name' ),
'description' => __( 'Displays any archive, including posts by a single author, category, tag, taxonomy, custom post type, and date. This template will serve as a fallback when more specific templates (e.g. Category or Tag) cannot be found.' ),
'short_description' => __( 'Displays any archive, including posts by a single author, category, tag, taxonomy, custom post type, and date.' ),
),
// ...
);
// ...
}
That's right, the descriptions made the modal extremely noisy. Short descriptions could be worth a try, but it's not always easy to capture the full template purpose succinctly, especially things like front-page and home, or generic templates like archive.
There could even be a world where this becomes a data view grid with previews. Given blocks like Archive Title
now include contextual placeholders (for instance in the Author archives template it displays "Author name" on the canvas), the previews could be more useful. Then users / platforms could toggle fields like description accordingly.
Agreed completely around contextual placeholders. That's where my brain went too. Right now, with the power of data views there, it would be awesome for this modal to then "respect" the choices set.
There could even be a world where this becomes a data view grid with previews. Given blocks like Archive Title
now include contextual placeholders (for instance in the Author archives template it displays "Author name" on the canvas), the previews could be more useful. Then users / platforms could toggle fields like description accordingly.
There could even be a world where this becomes a data view grid with previews. Given blocks like Archive Title
now include contextual placeholders (for instance in the Author archives template it displays "Author name" on the canvas), the previews could be more useful. Then users / platforms could toggle fields like description accordingly.
This depends on whether a theme:
has some basic fallback templates like archive
in those templates some blocks with contextual placeholders are used
If some of the above are not the case for a theme, we can end up in multiple identical previews (e.g. index) which provide no value.
Additionally, even if the blocks with contextual placeholders exist etc.., are we sure they are easily distinguishable and easily scanned? The previews will not be huge and it depends on so many factors, like layouts, colors etc..
No strong opinions but IMO short descriptions seem to be a better way forward.
Considering the design improvements made in #51806, what do you think about restoring the description? What are your thoughts on this design? If the description is lengthy, we could potentially add a shorter description option.
A nice middle-ground could be to display descriptions as InfoTips to avoid adding so much noise to the dialog.
Does this mean overlapping the trigger button on each template button, like this? I feel like this might be a bit too much 😄
add-template.mp4
By the way, we could also display the description when the template button itself is hovered or focused, but that raises accessibility concerns because mobile devices do not support hover or focus states.
I feel like the descriptions are so important that for this modal you see so rarely, it might be okay to have them for each. Are we already using the smallest font size?
That is correct, and this is undesirable from an accessibility standpoint.
I feel like the descriptions are so important that for this modal you see so rarely, it might be okay to have them for each. Are we already using the smallest font size?
I submitted a PR that applies a minimum font size to the description. #83064
There are other ways to include an InfoTip without nesting inside a button.
@jameskoster A rough sketch or simple mockup would be fine, so I would really appreciate it if you could share your ideal UI. I would be more than happy to try implementing it.
Your original mockup works pretty well imo. It seems very similar to DataViews grid items where the checkbox and menu trigger overlap an interactive item:
Maybe we could do something similar here to avoid the nesting issue? The only other tweak I'd consider is a max-width on the info-tip to optimise readability, that should arguably built into the component via size prop though (like Dialog).
Activity
t-hamano commentedon Feb 15, 2024
In #50595, when this modal dialog was implemented, a description existed. After that, it seems that the description was deleted in #51806.
I'm leaning toward bringing back the description, but the current description is quite long, so I think it would be nice to add a short description.
example:
cc @ntsekouras @richtabor @jameskoster @jasmussen
jameskoster commentedon Feb 15, 2024
That's right, the descriptions made the modal extremely noisy. Short descriptions could be worth a try, but it's not always easy to capture the full template purpose succinctly, especially things like
front-pageandhome, or generic templates likearchive.There could even be a world where this becomes a data view grid with previews. Given blocks like Archive Title
now include contextual placeholders (for instance in the Author archives template it displays "Author name" on the canvas), the previews could be more useful. Then users / platforms could toggle fields like description accordingly.
annezazu commentedon Feb 15, 2024
Agreed completely around contextual placeholders. That's where my brain went too. Right now, with the power of data views there, it would be awesome for this modal to then "respect" the choices set.
jasmussen commentedon Aug 13, 2026
Is that the action item here?
ntsekouras commentedon Sep 1, 2026
This depends on whether a theme:
archiveIf some of the above are not the case for a theme, we can end up in multiple identical previews (e.g. index) which provide no value.
Additionally, even if the blocks with contextual placeholders exist etc.., are we sure they are easily distinguishable and easily scanned? The previews will not be huge and it depends on so many factors, like layouts, colors etc..
No strong opinions but IMO short descriptions seem to be a better way forward.
t-hamano commentedon Sep 4, 2026
Considering the design improvements made in #51806, what do you think about restoring the description? What are your thoughts on this design? If the description is lengthy, we could potentially add a shorter description option.
jasmussen commentedon Sep 4, 2026
No strong opinion either way. Could we use a help-text font size?
Not sure if possible, but the main downside is all the buttons get different heights now, not sure if grid allows us a way to keep that consistent 🤔
t-hamano commentedon Sep 4, 2026
We can apply a minimum height as before, but it would be impossible to make all grid cells match in height using only CSS.
jameskoster commentedon Sep 14, 2026
A nice middle-ground could be to display descriptions as InfoTips to avoid adding so much noise to the dialog.
t-hamano commentedon Sep 17, 2026
Does this mean overlapping the trigger button on each template button, like this? I feel like this might be a bit too much 😄
add-template.mp4
By the way, we could also display the description when the template button itself is hovered or focused, but that raises accessibility concerns because mobile devices do not support hover or focus states.
jasmussen commentedon Sep 17, 2026
Also, isn't that a button inside a button?
I feel like the descriptions are so important that for this modal you see so rarely, it might be okay to have them for each. Are we already using the smallest font size?
t-hamano commentedon Sep 17, 2026
That is correct, and this is undesirable from an accessibility standpoint.
I submitted a PR that applies a minimum font size to the description. #83064
jameskoster commentedon Sep 21, 2026
There are other ways to include an
InfoTipwithout nesting inside a button.t-hamano commentedon Sep 21, 2026
@jameskoster A rough sketch or simple mockup would be fine, so I would really appreciate it if you could share your ideal UI. I would be more than happy to try implementing it.
jameskoster commentedon Sep 21, 2026
Your original mockup works pretty well imo. It seems very similar to DataViews grid items where the checkbox and menu trigger overlap an interactive item:
Maybe we could do something similar here to avoid the nesting issue? The only other tweak I'd consider is a
max-widthon the info-tip to optimise readability, that should arguably built into the component viasizeprop though (likeDialog).