Skip to content

Site Editor: Consider adding in descriptions to "Add New Templates" flow #59046

Closed

Description

@annezazu

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:

Screenshot 2024-02-14 at 3 51 41 PM

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.

Activity

  1. added
    [Type] Enhancement
    Needs Design Feedback
    [Feature] Site Editor
    on Feb 15, 2024
  2. t-hamano commented on Feb 15, 2024

    @t-hamano
    Contributor

    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:

    function get_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.' ),
    		),
    		// ...
    	);
    	// ...
    }

    cc @ntsekouras @richtabor @jameskoster @jasmussen

  3. jameskoster commented on Feb 15, 2024

    @jameskoster
    Contributor

    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.

  4. annezazu commented on Feb 15, 2024

    @annezazu
    ContributorAuthor

    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.

  5. jasmussen commented on Aug 13, 2026

    @jasmussen
    Contributor

    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.

    Is that the action item here?

  6. added
    Needs Dev
    and removed
    Needs Design Feedback
    on Aug 13, 2026
  7. ntsekouras commented on Sep 1, 2026

    @ntsekouras
    Contributor

    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:

    1. has some basic fallback templates like archive
    2. 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.

  8. t-hamano commented on Sep 4, 2026

    @t-hamano
    Contributor

    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.

    Before After
    Image Image
  9. jasmussen commented on Sep 4, 2026

    @jasmussen
    Contributor

    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 🤔

  10. t-hamano commented on Sep 4, 2026

    @t-hamano
    Contributor

    the main downside is all the buttons get different heights now, not sure if grid allows us a way to keep that consistent

    We can apply a minimum height as before, but it would be impossible to make all grid cells match in height using only CSS.

  11. jameskoster commented on Sep 14, 2026

    @jameskoster
    Contributor

    A nice middle-ground could be to display descriptions as InfoTips to avoid adding so much noise to the dialog.

  12. t-hamano commented on Sep 17, 2026

    @t-hamano
    Contributor

    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.

  13. jasmussen commented on Sep 17, 2026

    @jasmussen
    Contributor

    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?

  14. added
    [Status] In Progress
    on Sep 17, 2026
  15. t-hamano commented on Sep 17, 2026

    @t-hamano
    Contributor

    Also, isn't that a button inside a button?

    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

  16. jameskoster commented on Sep 21, 2026

    @jameskoster
    Contributor

    There are other ways to include an InfoTip without nesting inside a button.

  17. t-hamano commented on Sep 21, 2026

    @t-hamano
    Contributor

    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.

  18. jameskoster commented on Sep 21, 2026

    @jameskoster
    Contributor

    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:

    Image

    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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Needs Dev[Feature] Site Editor[Status] In Progress[Type] Enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions