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

Bring back Navigation editor flag or implement other coherent check #25009

Closed
draganescu opened this issue Sep 2, 2020 · 1 comment
Closed
Labels
[Block] Navigation Affects the Navigation Block

Comments

@draganescu
Copy link
Contributor

Description

In #23021 settings.__experimentalNavigationScreen was removed. This is a useful flag for allowing blocks to know when they're used in the Navigation editor.

The reason this is needed is because on the instance of, for example, the Navigation block, when the block is used in the Navigation editor to edit classic menus some features of the block are unavailable and others are required.

For example any styling applied to Navigation block in the Navigation editor does not render so the controls will be removed. Likewise, on the editor we need the Navigation block to display (as per #24875) a toggle for automatically adding new pages to the menu, but this does not work in other places, as only the Navigation editor edits classic menus.

Options

The downside of adding this flag is a kind of coupling of this block to a WP specific setting.

Another option would be to add more attributes/props to the Navigation block and customize those for every on/off requirement. For adding things which are only required on the Navigation editor we could default to always use the inspector via slots.

@draganescu
Copy link
Contributor Author

This has been discussed on Slack and it appears that coupling blocks with such a flag is a bad idea. Instead filtering should be used to achieve the desired modification.

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
Projects
None yet
Development

No branches or pull requests

1 participant