Skip to content

Commit 8546da0

Browse files
authored
Merge branch 'main' into 15/launchPrep
2 parents 10c6ff5 + 970a5cd commit 8546da0

File tree

5 files changed

+69
-0
lines changed

5 files changed

+69
-0
lines changed

15/umbraco-cms/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
* [Block Editors](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/block-editor/README.md)
7474
* [Block Grid](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/block-editor/block-grid-editor.md)
7575
* [Block List](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/block-editor/block-list-editor.md)
76+
* [Block Level Variance](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/block-editor/block-level-variance.md)
7677
* [Configuring Block Editor Label Properties](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/block-editor/label-property-configuration.md)
7778
* [Dropdown](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/dropdown/README.md)
7879
* [Rich Text Editor](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor/README.md)
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
description: An intro to achieving content variance at block level.
3+
---
4+
5+
# Block Level Variance
6+
7+
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.
8+
9+
In other words, both Block content and structure can vary between each Document variant.
10+
11+
![Default Block Editor behavior in the backoffice](images/block-level-variance-1.png)
12+
13+
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.
14+
15+
This is known as Block Level Variance:
16+
17+
![Block Level Variance in the backoffice](images/block-level-variance-2.png)
18+
19+
Block Level Variance is achieved when:
20+
21+
* The [Document Type](../../../../data/defining-content/default-document-types#document-type) is configured for variance, and
22+
* The Block Editor property is _not_ configured for variance, and
23+
* The Block Editor property editor is configured to use [Element Types](../../../../data/defining-content/default-document-types#element-type) that _do_ vary.
24+
25+
## The "unexposed" Block state
26+
27+
When adding a new _variant_ Block to one Document variant, it is automatically added to all variants of the Document.
28+
29+
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.
30+
31+
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):
32+
33+
![Block Level Variance in the backoffice - with an unexposed block](images/block-level-variance-3.png)
34+
35+
{% hint style="info" %}
36+
"Unexposed" Blocks are omitted from the published Document output. So, you do not need to worry about defensive coding to avoid rendering these Blocks.
37+
{% endhint %}
38+
39+
## Invariance vs. Block Level Variance
40+
41+
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.
42+
43+
Invariance within Block Level Variance follows the same rules as invariance at Document level:
44+
45+
- Invariant content is added to and updated across all Document variants.
46+
- Invariant content is explicitly published for all published Document variants when one or more variants are published.
47+
48+
### Examples
49+
50+
Consider a Document with English and Danish language variants, which is published in both languages.
51+
52+
- An editor opens the English variant.
53+
- They add an invariant Block, and
54+
- They re-publish the English variant.
55+
56+
**Result:** The new block will appear in both the English and Danish published content.
57+
58+
- An editor opens the Danish variant.
59+
- They update an invariant property value in a variant Block, and
60+
- They re-publish the Danish variant.
61+
62+
**Result:** The updated property value appears in both the English and Danish published content.
63+
64+
## Structure vs. Block Level Variance
65+
66+
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.
67+
68+
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.
Loading
Loading
Loading

0 commit comments

Comments
 (0)