Error executing template "Designs/SeedsNZ/_parsed/SeedsNZ_Page.parsed.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_0a824b7fe52448a99cb23160c14f3275.Execute() in C:\home\site\wwwroot\Application\Files\Templates\Designs\SeedsNZ\_parsed\SeedsNZ_Page.parsed.cshtml:line 162
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 ViewModelTemplate<PageViewModel>
2 @using PgwSeeds.SeedsNZ
3 @using Dynamicweb.Frontend;
4 @using Dynamicweb.Rendering;
5 @using System.Configuration
6 @using System.Web;
7 @using System.Web.Optimization
8 @using System.Net
9
10 @{
11 var tagManagerCode = Model.Area.Item.GetString("Google_TagManager_Code");
12 var siteVerificationKey = Model.Area.Item.GetString("Google_Site_Verification_Key");
13 }
14
15
16 <!DOCTYPE html>
17 <html>
18 <head>
19 @if (tagManagerCode != null)
20 {
21 <!-- Google Tag Manager -->
22 <script>
23 (function (w, d, s, l, i) {
24 w[l] = w[l] || []; w[l].push({
25 'gtm.start':
26 new Date().getTime(), event: 'gtm.js'
27 }); var f = d.getElementsByTagName(s)[0],
28 j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src =
29 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f);
30 })(window, document, 'script', 'dataLayer', '@tagManagerCode');
31 </script>
32 }
33 <script type="text/javascript">
34 var sdkInstance = "appInsightsSDK"; window[sdkInstance] = "appInsights"; var aiName = window[sdkInstance], aisdk = window[aiName] || function (e) { function n(e) { t[e] = function () { var n = arguments; t.queue.push(function () { t[e].apply(t, n) }) } } var t = { config: e }; t.initialize = !0; var i = document, a = window; setTimeout(function () { var n = i.createElement("script"); n.src = e.url || "https://az416426.vo.msecnd.net/scripts/b/ai.2.min.js", i.getElementsByTagName("script")[0].parentNode.appendChild(n) }); try { t.cookie = i.cookie } catch (e) { } t.queue = [], t.version = 2; for (var r = ["Event", "PageView", "Exception", "Trace", "DependencyData", "Metric", "PageViewPerformance"]; r.length;)n("track" + r.pop()); n("startTrackPage"), n("stopTrackPage"); var s = "Track" + r[0]; if (n("start" + s), n("stop" + s), n("setAuthenticatedUserContext"), n("clearAuthenticatedUserContext"), n("flush"), !(!0 === e.disableExceptionTracking || e.extensionConfig && e.extensionConfig.ApplicationInsightsAnalytics && !0 === e.extensionConfig.ApplicationInsightsAnalytics.disableExceptionTracking)) { n("_" + (r = "onerror")); var o = a[r]; a[r] = function (e, n, i, a, s) { var c = o && o(e, n, i, a, s); return !0 !== c && t["_" + r]({ message: e, url: n, lineNumber: i, columnNumber: a, error: s }), c }, e.autoExceptionInstrumented = !0 } return t }(
35 {
36 instrumentationKey: '@ConfigurationManager.AppSettings["aiinstrumentationKey"]',
37 disableCorrelationHeaders: false
38 }
39 );
40 window.appInsights = aisdk;
41 window.appInsights.queue.push(function () {
42 var serverId = "@HttpContext.Current.GetRequestTelemetry().Context.Operation.Id";
43 appInsights.properties.context.telemetryTrace.traceID = serverId;
44
45 });
46 aisdk.trackPageView();
47 </script>
48 <meta charset="utf-8" />
49 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
50 <meta name="google-site-verification" content="@siteVerificationKey" />
51 @Model.MetaTags
52 <title>@Model.Title | PGG Wrightson Seeds</title>
53
54 <link rel="apple-touch-icon" sizes="57x57" href="/Files/Templates/Designs/SeedsNZ/assets/favicon/apple-touch-icon-57x57.png" />
55 <link rel="apple-touch-icon" sizes="60x60" href="/Files/Templates/Designs/SeedsNZ/assets/favicon/apple-touch-icon-60x60.png" />
56 <link rel="apple-touch-icon" sizes="72x72" href="/Files/Templates/Designs/SeedsNZ/assets/favicon/apple-touch-icon-72x72.png" />
57 <link rel="apple-touch-icon" sizes="76x76" href="/Files/Templates/Designs/SeedsNZ/assets/favicon/apple-touch-icon-76x76.png" />
58 <link rel="apple-touch-icon" sizes="114x114" href="/Files/Templates/Designs/SeedsNZ/assets/favicon/apple-touch-icon-114x114.png" />
59 <link rel="apple-touch-icon" sizes="120x120" href="/Files/Templates/Designs/SeedsNZ/assets/favicon/apple-touch-icon-120x120.png" />
60 <link rel="icon" type="image/png" sizes="32x32" href="/Files/Templates/Designs/SeedsNZ/assets/favicon/favicon-32x32.png" />
61 <link rel="icon" type="image/png" sizes="96x96" href="/Files/Templates/Designs/SeedsNZ/assets/favicon/favicon-96x96.png" />
62 <link rel="icon" type="image/png" sizes="16x16" href="/Files/Templates/Designs/SeedsNZ/assets/favicon/favicon-16x16.png" />
63 <link rel="icon" href="/Files/Templates/Designs/SeedsNZ/assets/favicon/favicon.ico" />
64
65 <!-- FontAwesome -->
66 <script src="https://use.fontawesome.com/6326434619.js"></script>
67
68 <!-- TypeKit -->
69 <script src="https://use.typekit.net/oel8lyn.js"></script>
70 <script>try { Typekit.load({ async: false }); } catch (e) { }</script>
71
72 @Styles.Render("~/Content/custom/seedsnz")
73
74 @RenderSnippet("StyleSheet")
75 @RenderSnippet("JavaScript")
76 </head>
77 <body>
78
79 @if (tagManagerCode != null)
80 {
81 <!-- Google Tag Manager (no script) -->
82 <noscript>
83 <iframe src="https://www.googletagmanager.com/ns.html?id=@tagManagerCode"
84 height="0" width="0" style="display:none;visibility:hidden"></iframe>
85 </noscript>
86 }
87
88 <div class="layout__main wrap">
89 @{
90 var searchPage = GetPageIdByNavigationTag("Search");
91 }
92
93
94 <header class="container-fluid">
95 <div class="max-width-wrap col-no-padding-desktop">
96 <div>
97 <nav class="navbar" role="navigation">
98 <div class="navbar-header">
99 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
100 <span class="icon-bar"></span>
101 <span class="icon-bar"></span>
102 <span class="icon-bar"></span>
103 </button>
104 <a href="Default.aspx?Id=@GetPageIdByNavigationTag(NavigationTags.Home)" id="logo" title="Back to homepage">
105 <img class="img-responsive" src="/Files/Templates/Designs/SeedsNZ/assets/img/logo.png" alt="PGG Wrightson Seeds Logo">
106 </a>
107 </div>
108
109 <div class="navbar-collapse collapse pull-right-md">
110 <ul class="nav navbar-nav pull-right-md" id="navbar">
111 @RenderNavigation(new
112 {
113 Id = "navbar",
114 Template = "navbar.xslt",
115 ExpandMode = "All",
116 EndLevel = 3
117 })
118 </ul>
119
120 <div class="search-btn-wrap visible-xs visible-sm">
121 <a data-target="#search-wrapper"
122 data-toggle="collapse"
123 aria-expanded="false"
124 aria-controls="search-wrapper"
125 role="button">
126 <span class="fa fa-search hidden-xs hidden-sm"></span>
127 <span class="search-text hidden-md hidden-lg">Search</span>
128 </a>
129 </div>
130 </div>
131 </nav>
132 </div>
133 </div>
134 <div class="row collapse" id="search-wrapper">
135 <div class="max-width-wrap">
136 <div class="form-search-wrap">
137 <form method="get" action="Default.aspx" name="" novalidate="novalidate">
138 <input type="hidden" name="ID" value="@searchPage" />
139 <input type="search" placeholder="Enter Keyword to Search" name="q">
140 <submit class="animate-right" role="button">
141 <span class="rounded-icon icon fa fa-angle-right"></span>
142 </submit>
143 </form>
144 </div>
145 </div>
146 </div>
147 </header>
148
149 @inherits Dynamicweb.Rendering.ViewModelTemplate<PageViewModel>
150
151 @using Dynamicweb.Frontend;
152
153
154 @using PgwSeeds.SeedsNZ
155 @Title("Default page template")
156
157
158 [Include file 'Partials/_LoadSprout.cshtml' not found in 'Templates/Designs/SeedsNZ/SeedsNZ_Page.cshtml']
159 @inherits Dynamicweb.Rendering.ViewModelTemplate<PageViewModel>
160 @using Dynamicweb.Frontend
161 @{
162 var desktopImage = Model.Item.GetFile("DesktopImage")?.Path;
163 var handsetImage = Model.Item.GetFile("HandsetImage")?.Path;
164 var strapLineTop = Model.Item.GetString("StraplineTop");
165 var strapLineBottom = Model.Item.GetString("StraplineBottom");
166 var straplineNotice = Model.Item.GetString("StraplineNotice");
167 var bannerImageAltText = Model.Item.GetString("BannerImageAltText");
168 var bannerSecondLineColour = string.Empty;
169
170 if (!string.IsNullOrEmpty(Model.Item.GetString("StraplineBottomColor")))
171 {
172
173 bannerSecondLineColour = $"color: {Model.Item.GetList("StraplineBottomColor").SelectedValue}";
174
175 }
176
177 }
178
179 @if (!string.IsNullOrWhiteSpace(desktopImage))
180 {
181 <div class="container-fluid banner-wrap">
182 <div class="banner overflow-img-wrap">
183 <img src="/Files/Templates/Designs/SeedsNZ/assets/img/1x1.png" alt="@bannerImageAltText" data-image-desktop="@desktopImage" data-image-handset="@handsetImage" class="img-srcset">
184 <div class="strapline-wrap">
185 <div class="max-width-wrap">
186 <div class="wrap-md-offset-1-leftright">
187 @if (!string.IsNullOrWhiteSpace(strapLineTop))
188 {
189 <div class="strapline-inner-wrap">
190 <h1 class="first-line truncate-text" data-lines-xs="1" data-lines-sm="1" data-lines-md="1" data-lines-lg="1">@strapLineTop</h1>
191 <h2 class="second-line truncate-text" data-lines-xs="1" data-lines-sm="1" data-lines-md="1" data-lines-lg="1" style="@bannerSecondLineColour; overflow-wrap: break-word;">@strapLineBottom</h2>
192 @if (!string.IsNullOrWhiteSpace(straplineNotice))
193 {
194 <h3 class="notice-line truncate-text" data-lines-xs="1" data-lines-sm="1" data-lines-md="1" data-lines-lg="1" style="overflow-wrap: break-word;">@straplineNotice</h3>
195 }
196 </div>
197 }
198 </div>
199 </div>
200 </div>
201 </div>
202 </div>
203 }
204
205
206
207 @{
208 var titleIcon = Model.Item.GetFile("TitleIcon")?.Path.IconImage();
209 }
210
211 <div class="container">
212 @if (Model.Item.GetBoolean("DisplayBreadCrumb"))
213 {
214 @RenderNavigation(new
215 {
216 id = "breadcrumbs",
217 template = @".\breadcrumb.xslt",
218 expandmode = "Pathonly"
219 })
220 }
221 @{
222 var logoutClass = Model.CurrentUser.ID > 0 ? "logout-wrap" : string.Empty;
223 }
224 <div class="wrap-md-offset-1-leftright @logoutClass">
225 <div class="row">
226 <div class="col-xs-12 col-sm-9 col-md-9 title-component-wrap">
227 <div class="va-middle">
228 <h1 class="title">@Model.Item.GetValue("Title")</h1>
229 @if (!string.IsNullOrWhiteSpace(Model.Item.GetString("Subtitle")))
230 {
231 <h2 class="subtitle">@Model.Item.GetString("Subtitle")</h2>
232 }
233 </div>
234 </div>
235 <div class="col-xs-12 col-sm-3 col-md-3">
236 @if (Model.Item.GetBoolean("Display_Logout") && Model.CurrentUser.ID > 0)
237 {
238 <a href="/Admin/Public/ExtranetLogoff.aspx?redirect=@System.Web.HttpUtility.UrlEncode("/Default.aspx?Id=245")" class="border-link danger pull-right">LOGOUT</a>
239 }
240 <div class="product-logo-wrapper text-right-sm">
241 @if (!string.IsNullOrWhiteSpace(titleIcon))
242 {
243 <img src="@titleIcon" alt="@Model.Item.GetString("TitleIconAltText")">
244 }
245 </div>
246 </div>
247 </div>
248 </div>
249 @Model.Placeholder("main")
250 </div>
251
252
253 <!-- SOCIAL SHARING -->
254 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
255 @using System.Web
256 <div class="share-wrap text-center">
257 <h4>Share this page</h4>
258 @{
259 var request = HttpContext.Current.Request;
260 var subPath = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(request.Url.PathAndQuery.TrimStart('/'));
261 var friendlyUrl = $"{request.Url.Scheme}://{request.Url.Authority}{subPath}";
262 var url = WebUtility.UrlEncode(friendlyUrl);
263 }
264 <ul class="list-inline">
265 <li>
266 <a class="fa fa-facebook text-center" href="https://www.facebook.com/sharer/sharer.php?u=@url" title="Share page via Facebook" target="_blank"></a>
267 </li>
268 <li>
269 <a class="fa fa-twitter text-center" href="https://twitter.com/home?status=@url" title="Share page via Twitter" target="_blank"></a>
270 </li>
271 <li>
272 <a class="fa fa-linkedin text-center" href="https://www.linkedin.com/shareArticle?mini=true&url=@url" title="Share page via Linkedin" target="_blank"></a>
273 </li>
274 </ul>
275 </div>
276
277 <!-- Footer -->
278 <footer class="container-fluid contact-sticky-tile">
279 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
280 @using Dynamicweb.Frontend
281 @using PgwSeeds.SeedsNZ
282
283 @{
284 var footerColumns = Model.Area.Item.GetItems("Columns") != null ? Model.Area.Item.GetItems("Columns").Take(4) : new List<ItemViewModel>();
285 }
286
287 <div class="max-width-wrap">
288 <!-- duplication for mobile -->
289 <div class="clearfix">
290 <div class="clearfix">
291 <div class="mobile-compact-contact-wrap hidden-md hidden-lg col-xs-12 col-sm-6">
292 <a class="collapsed" data-target="#contact-footer-tile" role="button" data-toggle="collapse" aria-expanded="false" aria-controls="contact-footer-tile">
293 <h4>
294 <span class="greeting">HI!</span> NEED TO GET IN TOUCH?
295 </h4>
296 <img src="/Files/Templates/Designs/SeedsNZ/assets/img/Phone.jpg" maxheight="120"
297 class="img-responsive img-circle" alt="General Contact" maxwidth="120">
298 </a>
299 </div>
300 </div>
301
302 <div class="clearfix">
303 <div class="col-sm-5 pull-right hidden-sm hidden-xs contact-footer-desktop">
304 <div class="contact-tile-outer-wrap">
305 <div class="contact-us-greeting">
306 <div class="contact-us-greeting-inner">
307 <a class="collapsed" data-target="#contact-footer-tile" role="button" data-toggle="collapse" aria-expanded="false" aria-controls="contact-footer-tile">
308 <h4>
309 <span class="greeting">HI!</span> NEED TO GET IN TOUCH?
310 </h4>
311 </a>
312 </div>
313 </div>
314 </div>
315 </div>
316 </div>
317
318
319 <div class="hidden-lg hidden-md collapseable collapse" id="contact-footer-tile">
320 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
321 @using PgwSeeds.SeedsNZ
322 <div class="contact-tile-outer-wrap">
323 <div class="contact-tile-wrap">
324 <div class="row">
325 <div class="col-xs-4 col-no-right-padding">
326 <img src="/Files/Templates/Designs/SeedsNZ/assets/img/Phone.jpg" maxheight="120" class="img-responsive img-circle" alt="General Contact" maxwidth="120">
327 </div>
328 <div class="col-xs-8">
329 <h4>Contact Us</h4>
330 <p>
331 Sales & General Enquiries<br> Nationwide
332 </p>
333 </div>
334 </div>
335 <ul class="list-inline text-uppercase">
336 <li>
337 <span class="glyphicon glyphicon-earphone"></span>
338 <a href="tel:@Pageview.Area.Item["NZPhoneNumber"]">
339 @Pageview.Area.Item["NZPhoneNumber"]
340 </a>
341 </li>
342 <li>
343 <span class="glyphicon glyphicon-envelope"></span>
344 <a href="mailto:@Pageview.Area.Item["Email"];">
345 Email Me
346 </a>
347 </li>
348
349 </ul>
350 </div>
351 <a class="animate-right" href="Default.aspx?ID=@GetPageIdByNavigationTag(NavigationTags.ContactUs)">
352 <span>Contact your local rep</span>
353 <span class="rounded-icon icon fa fa-angle-right"></span>
354 </a>
355 </div>
356
357
358 </div>
359 </div>
360 <!-- duplication for mobile -->
361 <div class="row">
362 <div class="col-md-6 col-sm-12 link-tiles-wrap">
363 <div class="row">
364 @foreach (var aColumn in footerColumns)
365 {
366 var subLinks = aColumn.GetItems("Sub_Links");
367 <div class="col-md-3 col-sm-3 col-xs-6">
368 <strong>@aColumn.GetString("Title")</strong>
369 @if (subLinks.Any())
370 {
371 <ul class="list-unstyled">
372 @foreach (var link in subLinks)
373 {
374 var hrefValue = link.GetBoolean("Is_Download_Link") ? link.GetString("Link").GetDownloadPath() : link.GetString("Link");
375 <li>
376 <a href="@hrefValue">@link.GetString("Name")</a>
377 </li>
378 }
379 </ul>
380 }
381 </div>
382 }
383 </div>
384 <div class="row">
385 <div class="col-xs-6 col-md-12">
386 <div class="member-login va-middle hidden-sm hidden-xs">
387
388 @if (Model.CurrentUser.ID == 0)
389 {
390 <a href="Default.aspx?ID=@GetPageIdByNavigationTag(NavigationTags.LoginPage)" class="member-login btn btn-default">Retail Login</a>
391 }
392 else
393 {
394 <a href="Default.aspx?ID=@GetPageIdByNavigationTag(NavigationTags.MemberHome)" class="member-login btn btn-default">Retail Home</a>
395 }
396 </div>
397 <div class="footer-social-bar va-middle">
398 <a href="https://www.facebook.com/@Pageview.Area.Item["Facebook_Page"]/" class="fa fa-facebook" target="_blank" title="PGW Seeds Facebook"></a>
399 <a href="https://twitter.com/@Pageview.Area.Item["TwitterHandle"]" class="fa fa-twitter" target="_blank" title="PGW Seeds Twiiter"></a>
400 </div>
401 </div>
402
403 <div class="member-login va-middle hidden-md hidden-lg col-xs-6">
404
405 @if (Model.CurrentUser.ID == 0)
406 {
407 <a href="Default.aspx?ID=@GetPageIdByNavigationTag(NavigationTags.LoginPage)" class="member-login btn btn-default">Retail Login</a>
408 }
409 else
410 {
411 <a href="Default.aspx?ID=@GetPageIdByNavigationTag(NavigationTags.MemberHome)" class="member-login btn btn-default">Retail Home</a>
412 }
413 </div>
414 </div>
415 </div>
416 <div class="col-sm-5 pull-right hidden-sm hidden-xs">
417 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
418 @using PgwSeeds.SeedsNZ
419 <div class="contact-tile-outer-wrap">
420 <div class="contact-tile-wrap">
421 <div class="row">
422 <div class="col-xs-4 col-no-right-padding">
423 <img src="/Files/Templates/Designs/SeedsNZ/assets/img/Phone.jpg" maxheight="120" class="img-responsive img-circle" alt="General Contact" maxwidth="120">
424 </div>
425 <div class="col-xs-8">
426 <h4>Contact Us</h4>
427 <p>
428 Sales & General Enquiries<br> Nationwide
429 </p>
430 </div>
431 </div>
432 <ul class="list-inline text-uppercase">
433 <li>
434 <span class="glyphicon glyphicon-earphone"></span>
435 <a href="tel:@Pageview.Area.Item["NZPhoneNumber"]">
436 @Pageview.Area.Item["NZPhoneNumber"]
437 </a>
438 </li>
439 <li>
440 <span class="glyphicon glyphicon-envelope"></span>
441 <a href="mailto:@Pageview.Area.Item["Email"];">
442 Email Me
443 </a>
444 </li>
445
446 </ul>
447 </div>
448 <a class="animate-right" href="Default.aspx?ID=@GetPageIdByNavigationTag(NavigationTags.ContactUs)">
449 <span>Contact your local rep</span>
450 <span class="rounded-icon icon fa fa-angle-right"></span>
451 </a>
452 </div>
453
454
455 </div>
456 </div>
457 </div>
458 </footer>
459 <div class="visible-lg-block visible-md-block visible-sm-block visible-xs-block go-to-top hidden">
460 <div class="triangle"></div>
461 TOP
462 </div>
463 </div>
464
465 <script src="https://code.jquery.com/jquery.min.js"></script>
466 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.1/jquery.validate.min.js"></script>
467 <!-- Custom handling of unobtrusive validation css classes -->
468 <script src="Files/Templates/Designs/Common/assets/js/validation.custom.js"></script>
469
470 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validation-unobtrusive/3.2.11/jquery.validate.unobtrusive.min.js"></script>
471
472 @Scripts.Render("~/bundles/custom/seedsnz")
473 @RenderSnippet("JavaScriptBottom")
474 <!--[if lt IE 9]>
475 <script src="/Assets/Core/js/dist/ie/html5shiv.min.js"></script>
476 <script src="/Assets/Core/js/dist/ie/respond.min.js"></script>
477 <![endif]-->
478 <!--[if lt IE 10]>
479 <script src="/Assets/Core/js/dist/ie/jquery.placeholder.min.js"></script>
480 window.onload = function() {
481 $('input, textarea').placeholder();
482 };
483 <![endif]-->
484 </body>
485 </html>