Skip to content

Make it possible to create a template part directly via the Inserter #31746

Closed

Description

@jameskoster

For new template parts that you want to assign to the Header or Footer area the process is a little convoluted and can be refined.

Current flow:

  1. Insert Template Part block
  2. Choose "New template part" in the placeholder
  3. Insert blocks
  4. Manually assign template part to the appropriate area in the "Advanced" panel of the Inspector
  5. Give the template part a name

This can be simplified down to:

  1. Insert New Header (or similarly named) block
  2. Input a name
  3. Insert blocks

In this case the area is assigned automatically upon insertion.

Activity

  1. jameskoster commented on May 18, 2021

    @jameskoster
    ContributorAuthor

    I've been thinking that it might be interesting to repurpose our semantic template part variations in order to serve as 'starter' blocks. IE:

    • "Header" block becomes "New Header"
    • "Footer" block becomes "New Footer"
    • "Template Part" becomes "New Template Part"

    The addition of the "New" prefix clearly defines the purpose of the block, and releases "Header" and "Footer" as names that folks (end users and theme developers) can safely use for the actual site header/footer template parts. This will be important when we expose existing template parts in the inserter (#31748).

    We can utilise the designs in #31033 to present users with contextually relevant patterns upon insertion. Here's a diagram outlining the flow:

    Screenshot 2021-05-18 at 11 21 38

    And here's a video demonstrating the flow for adding a new header:

    new.header.mp4

    Rather than asking the user for a name up-front, it might be simpler to assign a name automatically, but provide an affordance to immediately rename it via the Snackbar confirmation notice.

    If no suitable patterns exist then the template part would be inserted in an empty state and exhibit the same characteristics as other empty containers.

    Once the new template part is published, it will appear in the Inserter as outlined in #31748.

    My main area of concern with this concept is the totally new interaction of seeing a modal when clicking a block in the inserter. Some finely tuned animation might help better illustrate the relationship here. A rough mockup:

    block-to-modal.mp4

    Note: The icons are essentially placeholders for now, we should probably discuss those in more detail in a dedicated issue if we go ahead with this approach.

  2. changed the title [-]Creating a from scratch template part via the Inserter[/-] [+]Make it possible to create a template part directly via the Inserter[/+] on May 23, 2022
  3. self-assigned this
    on Jul 4, 2022
  4. talldan commented on Jul 4, 2022

    @talldan
    Contributor

    I'll start exploring this.

  5. removed their assignment
    on Apr 5, 2023
  6. karmatosed commented on May 31, 2025

    @karmatosed
    Member

    I am going to be cautious and say this has been iterated on now considering that there are PRs linking out and the interface has changed since this work. We can always reopen it but closing feels like the next step for this.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions