This repository was archived by the owner on Feb 17, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 365
Remove manual menu data stuff and replace with target menu data slug #3658
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Quadrat: Override BCB's index.html template
Closed
7 tasks
jffng
reviewed
Apr 14, 2021
| <!-- wp:navigation-link {"label":"Home","url":"#"} /--> | ||
| <div class="wp-block-column is-vertically-aligned-center"> | ||
|
|
||
| <!-- wp:navigation {"orientation":"horizontal","itemsJustification":"right","source":"primary"} --> |
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love this API of identifying a nav area to render via a block attribute.
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+10000
Contributor
0b57627 to
fd635dd
Compare
Contributor
Author
|
The PR has triggered a lot of conversation but the branch has a lot of extra baggage. Closing this, though some of the ideas may live on... |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

This is an experiment to see if a "classic menu data source" can be used in the Navigation Block.
This branch of Gutenberg (from my fork) is needed to test out that functionality.
When a navigation block has NO child items it will attempt this alternate rendering.
The change renders a menu using the classic method
wp_nav_menu()and modifies as much as possible using the provided tools to make the result appear like the navigation block. The remainder is done with DOM/string manipulation.Thoughts
Ideally the Navigation block is able to target this data source and use that as the source of menu options instead of IMPORTING that data and storing it on the block.
The block could be given a control in the block editor so that a classic "source" can be chosen to be rendered dynamically OR child 'nav' blocks could be added.
Even better would be the ability for the navigation block to allow for editing of this data and persist it (as data instead of as blocks).
EVEN IF the ability to target a menu location is ONLY available as a hand-coded attribute in a block-template this still provides value as a tool themes can use during the transitional time.
ALTERNATIVELY rather than adding this (handy dandy) functionality to the Navigation block another "Classic Navigation" block could be created where that is the only purpose (rendering classic navigation data) which could just be swapped out for a regular Navigation block at the appropriate time.