File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
16/umbraco-cms/fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/block-editor Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -148,17 +148,17 @@ Example:
148
148
@using ContentModels = Umbraco .Cms .Web .Common .PublishedModels ;
149
149
@{
150
150
var content = (ContentModels .MyElementTypeAliasOfContent )Model .Content ;
151
- var settings = ( ContentModels .MyElementTypeAliasOfSettings ) Model .Settings ;
151
+ var settings = Model . Settings as ContentModels .MyElementTypeAliasOfContent ; // Cast Model.Settings safely using 'as' to avoid null reference exceptions
152
152
}
153
153
154
- // Output the value of field with alias 'heading' from the Element Type selected as Content section
154
+ @ * Output the value of field with alias 'heading' from the Element Type selected as Content section * @
155
155
< h1 > @content .Value (" heading" )< / h1 >
156
156
```
157
157
158
158
With ModelsBuilder:
159
159
160
160
``` csharp
161
- // Output the value of field with alias 'heading' from the Element Type selected as Content section
161
+ @ * Output the value of field with alias 'heading' from the Element Type selected as Content section * @
162
162
< h1 > @content .Heading < / h1 >
163
163
```
164
164
Original file line number Diff line number Diff line change @@ -52,3 +52,5 @@ redirects:
52
52
release-notes/2024-07-releasenotes : release-notes/overview-2024/2024-07-releasenotes.md
53
53
release-notes/august-2024 : release-notes/overview-2024/august-2024.md
54
54
release-notes/september-2024 : release-notes/overview-2024/september-2024.md
55
+ product-upgrades/minor-upgrades : optimize-and-maintain-your-site/manage-product-upgrades/product-upgrades/minor-upgrades.md
56
+
You can’t perform that action at this time.
0 commit comments