Show template part selection modal when inserting header or footer variations#42581
Show template part selection modal when inserting header or footer variations#42581
Conversation
…riations that have no slug
|
Size Change: +18 B (0%) Total Size: 1.26 MB
ℹ️ View Unchanged
|
Yes, that appears to be happening for me, too, both with the quick inserter and copy + pasting a Footer template part. It looks like Overall, though, I quite like the idea of attempting to make it work from within the block's edit component, mostly so that it's a smaller code change. That way folks can evaluate whether or not opening a modal on insertion is something that feels good to use, before building an API around it? On the other hand, it's very cool that #42142 allows the insert modal to occur before the block is inserted, so cancelling out the modal can be treated as cancelling out the insertion. I think I like the idea of pursuing #42142 further if we feel confident that the API will be useful for other blocks, too. |
|
Testing this PR. What I see. Comparing to what I remember from the other PR. Clicking Header Clicking "Existing template parts" or "Patterns" both are inserted as a Header template. Clicking to insert a Template Part. To me this feel better organized compared to #42142. |
BTW, this is almost the same as that other PR in terms of user experience, there's only a subtle difference in that here the block is inserted first before choosing a pattern from the modal, in the other PR the block is inserted after choosing a pattern. I think you tested an older iteration of #42142, so that's why it's confusing. The main reason for this separate PR is to try different technical approaches and get feedback from other developers (the main reason why I keep PRs in 'draft' status).
That's a good question. There's already a 'Replace' option for switching an existing header, which I think should be used for this, but that's less prominent after #41437.
This flow hasn't changed btw. |
|
Closing this down as it seems the preference is for the other version. |

What?
This is an alternative version of #42142
Why?
This should help explore alternative solutions that don't require such big API changes.
How?
This PR differs from #42142 in that:
Pros:
Cons: