Feature - Code
Paste Code that will be rendered in the page as code
Some code
@{
// Check if the block grid item has settings
bool hasSettings = Model.Settings != null;
string colorLabel = null;
// If the block grid item has settings, get the background colour
if (hasSettings)
{
var backgroundColour = Model.Settings.Value<ColorPickerValueConverter.PickedColor>("featureSettingsColourPicker");
colorLabel = backgroundColour?.Label;
}
}
As an aside
RTE's can be added in asides like this one
Here we are showing what text looks like in an RTE in an aside.
featureCode.cshtml
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridItem<FeatureCode>>
@{
Layout = "_Layout_Features.cshtml";
}
<pre><code>@Model.Content.FeaturePropertyFeatureCode</code></pre>