Skip to content

Add a preview only mode to the navigation block #60809

@fabiankaegy

Description

@fabiankaegy

Part of #60316

The core navigation block currently does not render navigation menus for user roles that can view a menu but cannot edit it. This is problematic because when we try to show a locked preview of the a template whilst editing the current post to lower user roles they see the "This navigation Menu doesn't exist" fallback state in the preview.

To solve for this we should allow the Navigation block to exist in a read-/preview-only mode.

If a user has the capabilities to view a navigation menu but doesn't have the capabilities to edit that navigation menu they should be presented with this preview-only mode.

Proposed UX

The way I would handle this for the navigation specifically is similar to how we handled it in the Post Template block in #60326. The navigation block wrapper sets it's block editing mode to disabled or content only. So none of the child blocks ever get exposed. Also any of the block inspector controls are automatically disabled though this.

User roles that cannot edit a menu should not be able to change anything about its content. They may only move the block around or change the visual appearance of the navigation block itself.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions