Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,17 @@ Example:
@using ContentModels = Umbraco.Cms.Web.Common.PublishedModels;
@{
var content = (ContentModels.MyElementTypeAliasOfContent)Model.Content;
var settings = (ContentModels.MyElementTypeAliasOfSettings)Model.Settings;
var settings = Model.Settings as ContentModels.MyElementTypeAliasOfContent; // using as here, fixes CS8600 - Converting null literal or possible null value to non-nullable type.
}

// Output the value of field with alias 'heading' from the Element Type selected as Content section
@{ // Output the value of field with alias 'heading' from the Element Type selected as Content section }@
<h1>@content.Value("heading")</h1>
```

With ModelsBuilder:

```csharp
// Output the value of field with alias 'heading' from the Element Type selected as Content section
@{ // Output the value of field with alias 'heading' from the Element Type selected as Content section }@
<h1>@content.Heading</h1>
```

Expand Down