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 Block: Dynamic menus #27130

Closed
scruffian opened this issue Nov 20, 2020 · 8 comments
Closed

Navigation Block: Dynamic menus #27130

scruffian opened this issue Nov 20, 2020 · 8 comments
Labels
[Block] Navigation Affects the Navigation Block [Feature] Themes Questions or issues with incorporating or styling blocks in a theme.

Comments

@scruffian
Copy link
Contributor

The navigation block gives you the option to "Create from top level pages", or to select a predefined menu (e.g. primary):

Screenshot 2020-11-20 at 09 53 11

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.

@scruffian scruffian added [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Feature] Full Site Editing [Block] Navigation Affects the Navigation Block labels Nov 20, 2020
@jasmussen
Copy link
Contributor

I can't reproduce this. Was the bug inadvertently fixed, or did I not reproduce the steps correctly?

Screenshot 2021-01-13 at 13 03 39

gif

@scruffian
Copy link
Contributor Author

@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.

@jasmussen
Copy link
Contributor

jasmussen commented Jan 13, 2021

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".

@scruffian
Copy link
Contributor Author

That makes sense. What about other types of menu?

@jasmussen
Copy link
Contributor

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.

@scruffian
Copy link
Contributor Author

Right, but I mean what if I wanted the same menu in multiple places that wasn't "all pages" - Primary for example, or Social...

@jasmussen
Copy link
Contributor

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.

@scruffian
Copy link
Contributor Author

Thanks @jasmussen I think we can go ahead and close this in favour of #23689

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 [Feature] Themes Questions or issues with incorporating or styling blocks in a theme.
Projects
None yet
Development

No branches or pull requests

2 participants