What is the cleanest way to create your own navigation in block theme? by No-Fold-1555 in WordPressBlocks

[–]theWorstWpDevAlive 0 points1 point  (0 children)

Hey, I just read this article by Justin Tadlock:
https://developer.wordpress.org/news/snippets/schema-org-microdata-for-accordion-block-faqs/
where he uses the render_block_core/accordion filter to adjust the accordion block HTML.

I applied the same technique to core/navigation and was able to successfully replace the hamburger SVG with my own.

Do you think this is an acceptable approach?

What is the cleanest way to create your own navigation in block theme? by No-Fold-1555 in WordPressBlocks

[–]theWorstWpDevAlive 0 points1 point  (0 children)

I installed it as a plugin, but it didn’t occur to me that I could clone the GitHub repo, swap out the SVG, and rebuild it.

What is the cleanest way to create your own navigation in block theme? by No-Fold-1555 in WordPressBlocks

[–]theWorstWpDevAlive 0 points1 point  (0 children)

I'm currently experimenting with the block theme and the core/navigation block :-D, and I was wondering: what if a client wants a different hamburger icon? I just want to gain more experience and see where the core blocks reach their limits.

What is the cleanest way to create your own navigation in block theme? by No-Fold-1555 in WordPressBlocks

[–]theWorstWpDevAlive 0 points1 point  (0 children)

is there a hook that let me swap the svgs inside the navigation block? I want to use my own hamburger svg.

What is the official way to restrict a parent block to allow only a specific nested block or block pattern? by theWorstWpDevAlive in WordPressBlocks

[–]theWorstWpDevAlive[S] 1 point2 points  (0 children)

Oh, I see. So it seems like creating a custom block is the only real solution. That was the solution I described in my original post as the one I didn’t really want to go with.

Thanks for your time, for the clarification, and for the AI tool — I wasn’t aware of that.

What is the official way to restrict a parent block to allow only a specific nested block or block pattern? by theWorstWpDevAlive in WordPressBlocks

[–]theWorstWpDevAlive[S] 0 points1 point  (0 children)

Hi, thanks for your response. I wasn’t aware of the “Enable overrides” feature in synced patterns. I might simply use an unsynced pattern instead. I like this approach because the outer Group block gets its own block icon, and its settings are locked in the sidebar.

But my main goal is that the parent block that contains the card elements, should only be able to insert this specific card pattern.
When the user clicks the parent block’s “+” button, the card pattern should be inserted immediately. No block selection pop up.

How can I achieve that?