-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 Block: Dynamic menus #27130
Comments
@jasmussen what happens if you add another top level page to your site? Is it added to the menu automatically? Or what happens if you add another item to the Primary menu? What seems to happen is that once the items are defined in the block they become disconnected from the rest of the site. I would expect these items to relate to the old "Menus" section, so that changes to one menu are reflected in other. For example if I had the Primary menu in my header and my footer I would expect that changing one would change the other. |
Oh I see, you're referring to the sync thing. Excellent. The way I believe we solve that is through #23689 (cc: @shaunandrews @mkaz @draganescu). That is: There is a new block allowed in the Navigation block, simply called "Pages" or "All pages". It's a single block that outputs every page you have. You can detach that block, converting it to individual menu items. At that point, the link is severed. I see that block as being inserted by default when you click "all pages". |
That makes sense. What about other types of menu? |
The idea is that you should be able to insert this all pages block in and menu, whether created in the site editor or in a separate navigation screen. |
Right, but I mean what if I wanted the same menu in multiple places that wasn't "all pages" - Primary for example, or Social... |
I'm almost certainly missing some context, so apologies if there's something obvious I'm missing. Basically I'm picturing that any menu you can create can include the "Pages" block, and it will simply show all the pages. So it starts with the creation of the menu, and pages should stay in sync regardless of where it's inserted. Reusable blocks and template parts in the site editor can then help keep the remaining stuff in sync. I believe @shaunandrews had some thoughts to on the ability to include this block only as a subpage for a primary menu item, say you had 4 custom curated menu items, but wanted the submenus to stay in sync, you'd insert the Pages block as a submenu item (or perhaps "Subpages"), as the sole submenu item. |
Thanks @jasmussen I think we can go ahead and close this in favour of #23689 |
The navigation block gives you the option to "Create from top level pages", or to select a predefined menu (e.g. primary):
When I select "Create from top level pages" I would expect new pages to be added but they aren't. Also, there is no way to create a new dynamic menus when a block theme is enabled as the menus section in wp-admin is hidden.
The text was updated successfully, but these errors were encountered: