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:
148148@using ContentModels = Umbraco .Cms .Web .Common .PublishedModels ;
149149@{
150150 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
152152 }
153153
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 * @
155155< h1 > @content .Value (" heading" )< / h1 >
156156```
157157
158158With ModelsBuilder:
159159
160160``` 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 * @
162162< h1 > @content .Heading < / h1 >
163163```
164164
Original file line number Diff line number Diff line change @@ -52,3 +52,5 @@ redirects:
5252 release-notes/2024-07-releasenotes : release-notes/overview-2024/2024-07-releasenotes.md
5353 release-notes/august-2024 : release-notes/overview-2024/august-2024.md
5454 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