From 791b763be5d95f5fcc320487b169a4c65efb1f7f Mon Sep 17 00:00:00 2001 From: annezazu Date: Wed, 12 Oct 2022 17:50:58 -0700 Subject: [PATCH] Updating curation document to include content lock ability Building off of the launch of this new functionality in 6.1, this updates the curation resource to include information about content lock ability: https://github.com/WordPress/gutenberg/pull/43037 --- .../curating-the-editor-experience.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/docs/how-to-guides/curating-the-editor-experience.md b/docs/how-to-guides/curating-the-editor-experience.md index 4c7ef0096d051b..af5056a7c48ee6 100644 --- a/docs/how-to-guides/curating-the-editor-experience.md +++ b/docs/how-to-guides/curating-the-editor-experience.md @@ -14,10 +14,25 @@ Users have the ability to lock and unlock blocks via the editor. The locking UI Keep in mind that each block you want to lock will need to be individually locked as desired. There is not a way to mass lock blocks currently. -**Lock patterns or templates** +**Apply block locking to patterns or templates** When building patterns or templates, theme authors can use these same UI tools to set the default locked state of blocks. For example, a theme author could lock various pieces of a header. Keep in mind that by default, users with editing access can unlock these blocks. [Here’s an example of a pattern](https://gist.github.com/annezazu/acee30f8b6e8995e1b1a52796e6ef805) with various blocks locked in different ways and here’s more context on [creating a template with locked blocks](https://make.wordpress.org/core/2022/02/09/core-editor-improvement-curated-experiences-with-locking-apis-theme-json/). You can build these patterns in the editor itself, including adding locking options, before following the [documentation to register them](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-patterns/). +**Apply content locking in patterns or templates** + +This functionality was introduced in WordPress 6.1. In contrast to block locking, which removes the ability to remove or move blocks, content locking is both designed for use at the pattern or template level and hides all design tools, while still allowing for the ability to edit the content of the blocks. This provides a great way to simplify the interface for users and preserve a design. When this option is added, the following changes occur: + +- Non-content child blocks (containers, spacers, columns, etc) are hidden from list view, un-clickable on the canvas, and entirely un-editable. +- The Inspector will display a list of all child 'content' blocks. Clicking a block in this list reveals its settings panel. +- The main List View only shows content blocks, all at the same level regardless of actual nesting. +- Children are move / remove locked automatically. +- Additional child blocks cannot be inserted, further preserving the design and layout. +- There is a link in the block toolbar to ‘Modify’ that can be toggled on/off to have access to the broader design tools. + +To adopt this functionality, you need to use `"templateLock":"contentOnly"`. [Here's an example of a pattern](https://gist.github.com/annezazu/d62acd2514cea558be6cea97fe28ff3c) with this functionality in place. For more information, please [review the relevant documentation](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-templates/#locking). + +Note: There is no UI in place to manage content locking and it must be managed at the code level. + **Change permissions to control locking ability** Agencies and plugin authors can offer an even more curated experience by limiting which users have [permission to lock and unlock blocks](https://make.wordpress.org/core/2022/05/05/block-locking-settings-in-wordpress-6-0/). By default, anyone who is an administrator will have access to lock and unlock blocks.