-
Notifications
You must be signed in to change notification settings - Fork 813
Add docs for Block Level Variance #6657
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
Merged
sofietoft
merged 6 commits into
umbraco:main
from
kjac:v15/feature/block-level-variance
Nov 13, 2024
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
df005d9
Add docs for Block Level Variance
kjac c8c34ec
Merge branch 'refs/heads/master' into v15/feature/block-level-variance
kjac b607bae
Make the linter happy
kjac d108357
More linter and a little formulation change
kjac 4060399
Grammar fixes
sofietoft b701fa8
Update 15/umbraco-cms/fundamentals/backoffice/property-editors/built-…
kjac File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
...-editors/built-in-umbraco-property-editors/block-editor/block-level-variance.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| --- | ||
| description: An intro to achieving content variance at block level. | ||
| --- | ||
|
|
||
| # Block Level Variance | ||
|
|
||
| In a variant context, a Block Editor behaves like any other Umbraco property editor by default. The Blocks contained within the editor "belong" to the Document variant, and there is no connection between Blocks across variants. | ||
|
|
||
| In other words, both Block content and structure can vary between each Document variant. | ||
|
|
||
|  | ||
|
|
||
| This is the desired behavior for many cases. However, in some cases it is preferable to have a shared Block structure across all variants, where only the Block content varies. | ||
|
|
||
| This is known as Block Level Variance: | ||
|
|
||
|  | ||
|
|
||
| Block Level Variance is achieved when: | ||
|
|
||
| 1. The [Document Type](../../../../data/defining-content/default-document-types#document-type) is configured for variance, and | ||
| 2. The Block Editor property is _not_ configured for variance, and | ||
| 3. The Block Editor property editor is configured to use [Element Types](../../../../data/defining-content/default-document-types#element-type) that _do_ vary. | ||
|
|
||
| ## The "unexposed" Block state | ||
|
|
||
| When adding a new _variant_ Block to one Document variant, it is automatically added to all variants of the Document. | ||
|
|
||
| The Block will start out in an "unexposed" state for all other Document variants than the one where it was added. It will remain like that for each variant, until it is edited in that variant. | ||
|
|
||
| The "unexposed" state is visualized by a dimmed-down icon and title (or likely a missing title, if [Umbraco Flavored Markdown](../../../../../reference/umbraco-flavored-markdown.md) is used): | ||
|
|
||
|  | ||
|
|
||
| {% hint style="info" %} | ||
| "Unexposed" Blocks are omitted from the published Document output. As such, you need not worry about defensive coding to avoid rendering these Blocks. | ||
| {% endhint %} | ||
|
|
||
| ## Invariance vs. Block Level Variance | ||
|
|
||
| It is entirely possible to mix and match variance and invariance within the scope of Block Level Variance. Invariance is fully supported, both at Block level and at Block property level. | ||
|
|
||
| Invariance within Block Level Variance follows the same rules as invariance at Document level: | ||
|
|
||
| - Invariant content is added to and updated across all Document variants. | ||
| - Invariant content is explicitly published for all published Document variants, when one or more variants are published. | ||
|
|
||
| ### Examples | ||
|
|
||
| Consider a Document with English and Danish language variants, which is published in both languages. | ||
|
|
||
| - An editor opens the English variant. | ||
| - They add an invariant Block, and | ||
| - They re-publish the English variant. | ||
|
|
||
| **Result:** The new block will appear in both the English and Danish published content. | ||
|
|
||
| - An editor opens the Danish variant. | ||
| - They update an invariant property value in a variant Block, and | ||
| - They re-publish the Danish variant. | ||
|
|
||
| **Result:** The updated property value appears in both the English and Danish published content. | ||
|
|
||
| ## Structure vs. Block Level Variance | ||
|
|
||
| The Block Editor structure is _invariant_ for Block Level Variance. This means that the structure follows the same rules for invariance as outlined in the section above. | ||
|
|
||
| In other words: If an editor changes the order of the Blocks in one Document variant, it changes for all Document variants. The change is applied to all published Document variants, as soon as one or more variants are published. | ||
Binary file added
BIN
+57 KB
...uilt-in-umbraco-property-editors/block-editor/images/block-level-variance-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+39.6 KB
...uilt-in-umbraco-property-editors/block-editor/images/block-level-variance-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+49.2 KB
...uilt-in-umbraco-property-editors/block-editor/images/block-level-variance-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.