Error executing template "Designs/Hive/_parsed/Hive_ListComponent.parsed.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_58e41b02a24b494ab55abf40bfd25343.Execute() in C:\inetpub\wwwroot\directions2023\Files\Templates\Designs\Hive\_parsed\Hive_ListComponent.parsed.cshtml:line 148
at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)
at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
@using Dynamicweb
@using Dynamicweb.Environment
@{
string swiftVersion = ReadFile("/Files/Templates/Designs/Swift/swift_version.txt");
@* Branding Themes Fonts *@
var disableWideBreakpoints = Model.Area?.Item?.GetRawValueString("DisableWideBreakpoints", "default");
string favicon = Model.Area.Item.GetFile("Favicon") != null ? Model.Area.Item.GetFile("Favicon").Path : "/Files/Templates/Designs/Swift/Assets/Images/favicon.png";
string googleTagManagerID = Model.Area.Item.GetString("GoogleTagManagerID");
string googleAnalyticsMeasurementID = Pageview.AreaSettings.GetString("GoogleAnalyticsMeasurementID");
var cookieOptInLevel = CookieManager.GetCookieOptInLevel();
bool allowTracking = cookieOptInLevel == CookieOptInLevel.All || (cookieOptInLevel == CookieOptInLevel.Functional && CookieManager.GetCookieOptInCategories().Contains("Statistical"));
// Schema.org details for PDP
string productId = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString.Get("ProductID")) ? Dynamicweb.Context.Current.Request.QueryString.Get("ProductID") : "";
bool isProductDetailsPage = !string.IsNullOrEmpty(productId);
bool isArticlePage = Model.ItemType == "Hive_Article";
string schemaOrgType = string.Empty;
if(isProductDetailsPage)
{
schemaOrgType = "itemscope=\"\" itemtype=\"https://schema.org/Product\"";
}
if(isArticlePage)
{
schemaOrgType = "itemscope=\"\" itemtype=\"https://schema.org/Article\"";
}
}
<!doctype html>
<html lang="@Pageview.Area.CultureInfo.TwoLetterISOLanguageName">
<head>
<!-- @swiftVersion -->
@* Required meta tags *@
<meta charset="utf-8">
<meta name="viewport" content="height=device-height, width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="@favicon">
<link rel="apple-touch-icon" href="/Files/Templates/Designs/Swift/Assets/Images/logo_transparent.png">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="googlebot-news" content="nosnippet">
@Model.MetaTags
<title>@Model.Title</title>
@* Bootstrap + Swift stylesheet *@
@if (disableWideBreakpoints != "disableBoth")
{
<style>
@@media ( min-width: 1600px ) {
.container-xxl,
.container-xl,
.container-lg,
.container-md,
.container-sm,
.container {
max-width: 1520px;
}
}
</style>
if (disableWideBreakpoints != "disableUltraWideOnly")
{
<style>
@@media ( min-width: 1920px ) {
.container-xxl,
.container-xl,
.container-lg,
.container-md,
.container-sm,
.container {
max-width: 1820px;
}
}
</style>
}
}
@* Google tag manager *@
@if (!string.IsNullOrWhiteSpace(googleTagManagerID) && allowTracking)
{
<script>
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window, document, 'script', 'dataLayer', '@(googleTagManagerID)');
function gtag() { dataLayer.push(arguments); }
</script>
}
@if (!string.IsNullOrWhiteSpace(googleAnalyticsMeasurementID) && allowTracking)
{
var GoogleAnalyticsDebugMode = "";
bool isLoggedInBackendUser = false;
if (Dynamicweb.Security.UserManagement.User.GetCurrentBackendUser() != null) {
isLoggedInBackendUser = true;
}
if (Model.Area.Item.GetBoolean("EnableGoogleAnalyticsDebugMode") && @isLoggedInBackendUser)
{
GoogleAnalyticsDebugMode = ", {'debug_mode': true}";
}
<script async src="https://www.googletagmanager.com/gtag/js?id=@googleAnalyticsMeasurementID"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '@googleAnalyticsMeasurementID'@GoogleAnalyticsDebugMode);
</script>
}
</head>
<body class="brand ">
<main id="content" @(schemaOrgType)>
<div data-intersect></div>
@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
@using System
@using Dynamicweb.Ecommerce.ProductCatalog
@{
bool isVisualEditor = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString.Get("VisualEdit")) ? Convert.ToBoolean(Dynamicweb.Context.Current.Request.QueryString.Get("VisualEdit")) : false;
string gridContent = "";
if (Model.Item != null)
{
gridContent = Model.Grid("Grid", "Grid", "default:true;sort:1", "HivePage");
}
<div class="p-5 position-fixed" style="z-index: 10; margin-top: -120px">
<h3 class="h5">@Translate("Component builder for"): @Model.Item.GetString("Title")</h3>
</div>
<div class="bg-light position-absolute w-100" style="height: 120px; margin-top: -120px;"></div>
<div class="bg-light w-100 h-100" style="margin-top: 120px">
<div class="container-xl d-flex flex-row align-items-center justify-content-center h-100 min-vh-100">
<div class="w-100 shadow p-2">
@gridContent
</div>
</div>
</div>
<div class="bg-light position-absolute w-100" style="height: 120px"></div>
}
</main>
</body>
</html>