Skip to content
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

Navigation sub-blocks offer Create Template Part option #55521

Open
TonyGravagno opened this issue Oct 20, 2023 · 1 comment
Open

Navigation sub-blocks offer Create Template Part option #55521

TonyGravagno opened this issue Oct 20, 2023 · 1 comment
Labels
[Block] Navigation Affects the Navigation Block Needs Design Feedback Needs general design feedback. [Type] Enhancement A suggestion for improvement.

Comments

@TonyGravagno
Copy link
Contributor

Description

I don't think we want the ability to create template blocks from the navigation block. A block pattern would be more useful and will fit with existing constructs.

You can't use a template part as a navigation sub-block. To do so, open a page containing the navigation block. Add the template part with the saved navigation sub-block, reveal the nested component within the template part. Copy the nested component. In the navigation block, add a temporary spacer. Paste from the clipboard onto that temporary block to replace it. It works great. There are many similar ways to do this, but none of them are elegant.

Perhaps the issue is not that we are allowed to save a navigation sub-block as a template part, but that we are not allowed to add a template part back into a navigation block. The add/search dialog has no option to insert a template part into a navigation block. We can add patterns, but we can't use our own block patterns either.

Screenshots 2-3 show no locally-defined patterns, and Explore all Patterns does not include local patterns.

I don't think we want to add template parts into navigation blocks. I think the solution is to change the "Create template part" option to the common "Create pattern/reusable block" option, then under the Add option on the Navigation block, enhance the Browse All list of Patterns to include patterns saved with this feature.

I don't know what the flag is in specific Call To Action blocks that allows only specific CTAs to be added to a Navigation block, but that's the flag that we would want set on new patterns from the nav block.

As an aside, when I do test the "Create template part" option and confirm the save, it does create a template part, but the progress animation on the Create button doesn't stop and the dialog needs to be closed manually. If this ticket is processed, this bug doesn't need to be processed, though a developer might want to look into why that animation might not stop under other conditions.

Step-by-step reproduction instructions

  1. Edit a Navigation block.
  2. Focus on a child block.
  3. Open options
  4. Note the option to "Create template part".

Screenshots, screen recording, code snippet

No response

Environment info

WP 6.3.2 Production without additional Gutenberg plugin.

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@jordesign jordesign added [Type] Enhancement A suggestion for improvement. [Block] Navigation Affects the Navigation Block labels Oct 22, 2023
@draganescu draganescu self-assigned this Mar 26, 2024
@draganescu draganescu removed their assignment Apr 2, 2024
@draganescu draganescu added the Needs Design Feedback Needs general design feedback. label Apr 2, 2024
@draganescu
Copy link
Contributor

I have tried to solve this in #60197 but turns out this behaviour is by design. Since I would say building a special block actions component for the navigation block is a bad idea, I've added the needs design feedback label to help with closing or fixing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Affects the Navigation Block Needs Design Feedback Needs general design feedback. [Type] Enhancement A suggestion for improvement.
3 participants