Error executing template "Designs/Warmtethuis/_parsed/page.parsed.cshtml"
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
at Warmgarant.Shop.Repository.Helpers.NavigationHelper.GetBreadCrumb(String containerClass) in D:\a\1\s\Warmgarant.Shop.Repository\Helpers\NavigationHelper.cs:line 522
at CompiledRazorTemplates.Dynamic.RazorEngine_72211b8e7ca5420f877cdbe2699b9a94.Execute() in D:\inetpub\wwwroot\www.warmgarant.nl\Files\Templates\Designs\Warmtethuis\_parsed\page.parsed.cshtml:line 188
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 @using Warmgarant.Shop.Repository.Helpers
2 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>>
3 @{
4 var requestHost = string.Format("{0}://{1}", GetGlobalValue("Global:Request.Scheme"), GetGlobalValue("Global:Request.Host"));
5 var hpId = AreaHelper.GetAreaItemIntValueBySystemName(Warmgarant.Shop.Models.Constants.StringConstants.WebsiteConfiguration.HeaderParagraphId);
6 var fpId = AreaHelper.GetAreaItemIntValueBySystemName(Warmgarant.Shop.Models.Constants.StringConstants.WebsiteConfiguration.FooterParagraphId);
7 var assetsDirectory = "./files/templates/designs/warmtethuis/styleguide/assets/";
8
9 // seo meta data
10 var pageDescription = GetString("Meta.Description");
11 var pageKeywords = GetString("Meta.Keywords");
12 var language = GetGlobalValue("Global:Area.Lang");
13
14 var templateDesignBaseUrl = GetString("Template:DesignBaseUrl");
15
16 var cssStyleguide = Fingerprint.Tag(templateDesignBaseUrl, "Styleguide/css/warmtethuis.min.css");
17 var cssWarmtethuis = Fingerprint.Tag(templateDesignBaseUrl, "Css/warmtethuis.min.css");
18
19 var vendorJs = Fingerprint.Tag(templateDesignBaseUrl, "Styleguide/js/vendor.min.js");
20 var warmtethuisStyleguideJs = Fingerprint.Tag(templateDesignBaseUrl, "Styleguide/js/warmtethuis.min.js");
21 var warmtethuisJs = Fingerprint.Tag(templateDesignBaseUrl, "Scripts/warmtethuis.min.js");
22 var reCaptchaSiteKey = AreaHelper.GetAreaItemStringValueBySystemName(Warmgarant.Shop.Models.Constants.StringConstants.WebsiteConfiguration.ReCaptchaSiteKey, Dynamicweb.Frontend.PageView.Current().AreaID);
23 }
24 <!DOCTYPE html>
25 <html lang="@language">
26 <head>
27 <title>@GetValue("Title")</title>
28 @GetValue("MetaTags")
29 @GetValue("CopyRightNotice")
30
31 <meta http-equiv="content-language" content="@language">
32 <meta http-equiv="content-type" content="text/html; charset=UTF-8">
33 <meta http-equiv="X-UA-Compatible" content="IE=edge">
34 <meta name="msapplication-tap-highlight" content="no">
35 <meta name="format-detection" content="telephone=no">
36 <meta name="viewport" content="width=device-width, initial-scale=1.0">
37 <meta name="application-name" content="warmtethuis.nl">
38 <meta name="author" content="Innovadis BV, Enschede">
39 <meta name="copyright" content="Innovadis BV, Enschede, @DateTime.Now.Year">
40 <meta name="web_author" content="Innovadis BV, Enschede">
41 @if (!string.IsNullOrWhiteSpace(pageDescription))
42 {
43
44 }
45 @if (!string.IsNullOrWhiteSpace(pageKeywords))
46 {
47
48 }
49 <link rel="dns-prefetch" href="@requestHost">
50 <link rel="icon" href="/Files/Templates/Designs/Warmtethuis/Images/favicon.ico" type="image/x-icon">
51 <link rel="shortcut icon" href="/Files/Templates/Designs/Warmtethuis/Images/favicon.ico" type="image/x-icon">
52 <!--Remote CSS-->
53 <link href="https://cdn.jsdelivr.net/npm/@mdi/font@2.0.46/css/materialdesignicons.min.css" rel="stylesheet">
54 <link href="https://fonts.googleapis.com/css?family=Open+Sans:200,200i,300,300i,400,700" rel="stylesheet">
55 <link href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.css" rel="stylesheet">
56 <link rel="stylesheet" href="https://use.typekit.net/znz2dkr.css">
57 <!--Local CSS-->
58 <link rel="stylesheet" type="text/css" href="@cssStyleguide">
59 <link rel="stylesheet" type="text/css" href="@cssWarmtethuis">
60 <!--Scripts-->
61 <script>
62 // Set global JavaScript variable with AreaID
63 var dwAreaID = @GetInteger("DwAreaID");
64 </script>
65 <script src="@vendorJs"></script>
66 <script src="@warmtethuisStyleguideJs"></script>
67 <script src="/Scripts/jquery.waypoints.min.js"></script>
68 <script src="/Scripts/sticky.min.js"></script>
69
70 @if (!string.IsNullOrWhiteSpace(reCaptchaSiteKey))
71 {
72 <script src="https://www.google.com/recaptcha/api.js?render=@reCaptchaSiteKey"></script>
73 }
74
75 @RenderSnippet("HeadContent")
76 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>>
77 @{
78 var googleTagmanagerCode = Warmgarant.Shop.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(Warmgarant.Shop.Models.Constants.StringConstants.WebsiteConfiguration.GoogleTagmanagerCode);
79 if (!string.IsNullOrWhiteSpace(googleTagmanagerCode))
80 {
81 <!-- Google Tag Manager -->
82 <script>
83 (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push(
84 {'gtm.start': new Date().getTime(),event:'gtm.js'}
85 );var f=d.getElementsByTagName(s)[0],
86 j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
87 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
88 })(window, document, 'script', 'dataLayer', '@googleTagmanagerCode');
89 </script>
90 <!-- End Google Tag Manager -->
91 }
92 }
93 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>>
94 @{
95 var googleTrackingCode = Warmgarant.Shop.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(Warmgarant.Shop.Models.Constants.StringConstants.WebsiteConfiguration.GoogleTrackingCode);
96 if (!string.IsNullOrWhiteSpace(googleTrackingCode))
97 {
98 var optInLevel = GetGlobalValue("Global:CookieOptInLevel");
99 // optInLevel can be:
100 // - None (0)
101 // - Functional (1)
102 // - All (2)
103
104 <script>
105 (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
106 (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
107 m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
108 })(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
109
110 var virtualPageviewHasBeenSent = false; // this variable will be set to true in innovadis-seo.js when a virtual pageview has been fired and used to prevent double analytics tracking
111
112 ga('create', '@googleTrackingCode', 'auto');
113 // NOTE: the analytics tracking event 'send' code, ga('send', 'pageview'), which is located here in the Google code samples is moved to innovadis-seo.js and called at the bottom of the master to be able to prevent double analytics tracking when a virtual pageview has already been fired.
114 // Anonymization based on CookieOptInLevel is done there.
115 </script>
116
117 if (optInLevel.Equals("None", StringComparison.InvariantCultureIgnoreCase))
118 {
119 <script>
120 // GA opt out
121 window['ga-disable-@googleTrackingCode'] = true;
122 </script>
123 }
124 }
125 }
126 @GetValue("Stylesheets")
127 @GetValue("Javascripts")
128 </head>
129 <body data-pageid='@GetGlobalValue("Global:Page.ID")' data-navtop='@NavigationHelper.GetActiveTopLevelPageId(GetGlobalValue("Global:Page.ID"))'>
130 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>>
131 @{
132 if (!string.IsNullOrWhiteSpace(googleTagmanagerCode))
133 {
134 var tagManagerUrl = string.Format("https://www.googletagmanager.com/ns.html?id={0}", googleTagmanagerCode);
135 <!-- Google Tag Manager (noscript) -->
136 <noscript>
137 <iframe src="@tagManagerUrl" height="0" width="0" style="display:none;visibility:hidden"></iframe>
138 </noscript>
139 <!-- End Google Tag Manager (noscript) -->
140 }
141 }
142 <header>
143 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>>
144 @{
145 var notificationText = Warmgarant.Shop.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(Warmgarant.Shop.Models.Constants.StringConstants.WebsiteConfiguration.NotificationText).Trim();
146 if (!string.IsNullOrWhiteSpace(notificationText))
147 {
148 <div class="content header-notification">
149 <div class="header-notification__spacer"></div>
150 <div class="header-notification__content">@notificationText</div>
151 <a href="/hide-notification" class="header-notification__button notification-hide">
152 <img src="/Files/Templates/Designs/Warmtethuis/images/icons/x-close-white.svg">
153 </a>
154 </div>
155
156 @SnippetStart("JavaScriptBottom")
157 <script>
158 $(document).ready(function () {
159
160 var sessionStorageId = "Warmtethuis_Hide_Notification";
161 var hideNotification = window.sessionStorage.getItem(sessionStorageId);
162 if (hideNotification == null || hideNotification !== 'true') {
163 $(".header-notification").addClass('active');
164 $("main").addClass('notification-active');
165 }
166
167 $(".notification-hide").off("click").on("click", function () {
168 window.sessionStorage.setItem(sessionStorageId, 'true');
169 $(".header-notification").removeClass('active');
170 $("main").removeClass('notification-active');
171 return false;
172 });
173 });
174 </script>
175 @SnippetEnd("JavaScriptBottom")
176 }
177 }
178 @if (hpId > 0)
179 {
180 @RenderParagraphContent(hpId)
181 }
182 </header>
183
184 <main>
185 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>>
186
187 <div class="container">
188 @NavigationHelper.GetBreadCrumb()
189 <section class="page-content row">
190 @(!string.IsNullOrEmpty(GetString("DwPageName")) ? "<h1>" + GetString("DwPageName") + "</h1>" : "")
191 <aside class="col s12 m12 l3" id="sidebar_left">@GetValue("DwContent(sidebarleft)")</aside>
192 <main class="col s12 m12 l6" id="main_content">@GetValue("DwContent(maincontent)")</main>
193 <aside class="col s12 m12 l3" id="sidebar_right">@GetValue("DwContent(sidebarright)")</aside>
194 </section>
195 <section class="page-content-fullwidth">
196 <div id="content_fullwidth">@GetValue("DwContent(contentfullwidth)")</div>
197 </section>
198 </div>
199 </main>
200
201 <footer>
202 @if (fpId > 0)
203 {
204 @RenderParagraphContent(fpId)
205 }
206 </footer>
207
208 <!--Scripts-->
209 <script src="@warmtethuisJs"></script>
210 @if (Dynamicweb.Frontend.PageView.Current().Page.NavigationTag.Equals(Warmgarant.Shop.Models.Constants.StringConstants.Navigation.ServiceContractInfo))
211 {
212 <text>
213 @using Warmgarant.Shop.Repository.Helpers
214 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>>
215 @{
216 // THIS CONTENT WILL BE ACTIVE WHEN THE CURRENT PAGE NAVIGATION TAG IS: ServiceContractInfo
217 // THE MODAL WIL OPEN ONCLICK OF AN ELEMENT WITH CLASSNAME: servicecontract-callback
218
219 var callMeBackParagraphId = AreaHelper.GetAreaItemIntValueBySystemName(Warmgarant.Shop.Models.Constants.StringConstants.WebsiteConfiguration.CallMeBackParagraphId);
220 if (callMeBackParagraphId > 0)
221 {
222 var modalId = $"ServiceContractCallMeBackModal";
223 var seoParagraphServiceContractCall = string.Format("{0}/{1}", System.Web.HttpContext.Current.Request.Url.Authority, Translate("SEO_VirtualPageviewServiceContractCallMeBackForm", "all-in-service-callmeback-form"));
224
225 <div id="@modalId" class="modal modal-large quotation-request-modal">
226 <div class="modal-header">
227 <h3>@Translate("ServiceContractCallMeBack_Modal_Header", "Call me back request")</h3>
228 <div class="modal-action modal-close">
229 <img src="/files/templates/designs/warmtethuis/images/icons/x-close.svg" title='@Translate("Close", "Close").JsEncode()' class="black-svg">
230 </div>
231 </div>
232 <div class="modal-content rich-text-editor-content">
233 @RenderParagraphContent(callMeBackParagraphId)
234 </div>
235 </div>
236
237 @SnippetStart("JavaScriptBottom")
238 <script>
239 var openServiceContractCallMeBackModal = function () {
240 $('#@modalId').innovadisModal().modal('open');
241 };
242 $(function () {
243 // Init modal call me back request
244 $('.servicecontract-callback').off("click").on("click", function (e) {
245 e.preventDefault();
246 openServiceContractCallMeBackModal();
247 SEO.trackPageView("@seoParagraphServiceContractCall", '@GetGlobalValue("Global:CookieOptInLevel").ToLower()' === 'functional');
248 return false;
249 });
250 $("label.checkbox", "#@modalId").innovadisCheckbox({});
251 });
252 </script>
253 @SnippetEnd("JavaScriptBottom")
254 }
255 }
256 </text>
257 }
258 @RenderSnippet("JavaScriptBottom")
259 <script>
260 function getParam(p) {
261 var match = RegExp('[?&]' + p + '=([^&]*)').exec(window.location.search);
262 return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
263 }
264
265 function getExpiryRecord(value) {
266 var expiryPeriod = 90 * 24 * 60 * 60 * 1000; // 90 day expiry in milliseconds
267 var expiryDate = new Date().getTime() + expiryPeriod;
268 return {
269 value: value,
270 expiryDate: expiryDate
271 };
272 }
273
274 function addGclid() {
275 var gclidParam = getParam('gclid');
276 var gclidFormFields = ['QuotationRequests_GCLID']; // all possible gclid form field ids here
277 var gclidRecord = null;
278 var currGclidFormField;
279 var gclsrcParam = getParam('gclsrc');
280 var isGclsrcValid = !gclsrcParam || gclsrcParam.indexOf('aw') !== -1;
281
282 gclidFormFields.forEach(function (field) {
283 if (document.getElementById(field)) {
284 currGclidFormField = document.getElementById(field);
285 }
286 });
287
288 if (gclidParam && isGclsrcValid) {
289 gclidRecord = getExpiryRecord(gclidParam);
290 localStorage.setItem('gclid', JSON.stringify(gclidRecord));
291 }
292
293 var gclid = gclidRecord || JSON.parse(localStorage.getItem('gclid'));
294 var isGclidValid = gclid && new Date().getTime() < gclid.expiryDate;
295
296 if (currGclidFormField && isGclidValid) {
297 currGclidFormField.value = gclid.value;
298 }
299 }
300
301 window.addEventListener('load', addGclid);
302 </script>
303 @using Warmgarant.Shop.Repository.Helpers
304 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>>
305 @{
306 if (IntercomHelper.IntercomIsActive())
307 {
308 var intercomAppId = Warmgarant.Shop.Models.Config.ExtraConfig.ExtraConfiguration.IntercomMessengerSettings.AppId;
309 if (!string.IsNullOrWhiteSpace(intercomAppId))
310 {
311 <script>
312
313 function setIntercomCookie(cname, cvalue, exdays) {
314 var d = new Date();
315 d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
316 var expires = "expires=" + d.toUTCString();
317 document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
318 }
319
320 function getIntercomCookie(cname) {
321 var name = cname + "=";
322 var decodedCookie = decodeURIComponent(document.cookie);
323 var ca = decodedCookie.split(';');
324 for (var i = 0; i < ca.length; i++) {
325 var c = ca[i];
326 while (c.charAt(0) == ' ') {
327 c = c.substring(1);
328 }
329 if (c.indexOf(name) == 0) {
330 return c.substring(name.length, c.length);
331 }
332 }
333 return "";
334 }
335
336 window.intercomSettings = {
337 app_id: "@intercomAppId", // app Id located in the web.config
338 custom_launcher_selector: '.openIntercom', // links with the '.openIntercom' class activate the intercom messenger
339 hide_default_launcher: true // hides the intercom icon in right bottom corner
340 };
341
342
343 (function() {
344 var w = window;
345 var ic = w.Intercom;
346 if (typeof ic === "function") {
347 ic('reattach_activator');
348 ic('update', intercomSettings);
349
350 } else {
351 var d = document;
352 var i = function() { i.c(arguments) };
353 i.q = [];
354 i.c = function(args) { i.q.push(args) };
355 w.Intercom = i;
356
357 function l() {
358 var s = d.createElement('script');
359 s.type = 'text/javascript';
360 s.async = true;
361 s.src = 'https://widget.intercom.io/widget/bz2i6o1f';
362 var x = d.getElementsByTagName('script')[0];
363 x.parentNode.insertBefore(s, x);
364 }
365
366 if (w.attachEvent) {
367 w.attachEvent('onload', l);
368 } else {
369 w.addEventListener('load', l, false);
370 }
371
372 // use cookie value to determine if the messenger should be shown on page.
373 // by default no messenger should be shown
374 // the messenger should open on trigger click
375 // the messenger should stay in focus despite changing pages as long as the cookie value is true
376 // when manually hiding the messenger by clicking the close/hide link the cookie value changes to false
377 var intercomCookieName = "WarmgarantIntercomIsOpen";
378 var currentCookieValue = getIntercomCookie(intercomCookieName);
379 if (currentCookieValue === "true") {
380 w.Intercom('show');
381 }
382 w.Intercom('onShow', function () {
383 setIntercomCookie(intercomCookieName, "true", 60);
384 });
385 w.Intercom('onHide', function () {
386 setIntercomCookie(intercomCookieName, "false", 60);
387 });
388 }
389 })()
390 </script>
391 }
392 }
393 }
394
395 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>>
396 <script type="text/javascript">
397 piAId = '867102';
398 piCId = '43215';
399 piHostname = 'pi.pardot.com';
400
401 @*var onlyFunctional = '@GetGlobalValue("Global:CookieOptInLevel").ToLower()' === 'functional';*@
402
403 (function() {
404 function async_load(){
405 var s = document.createElement('script'); s.type = 'text/javascript';
406 s.src = ('https:' == document.location.protocol ? 'https://pi' : 'http://cdn') + '.pardot.com/pd.js';
407 var c = document.getElementsByTagName('script')[0]; c.parentNode.insertBefore(s, c);
408 }
409 if(window.attachEvent) { window.attachEvent('onload', async_load); }
410 else { window.addEventListener('load', async_load, false); }
411 })();
412 </script>
413
414 <script>
415 $(function () {
416 // seo original pageview tracking
417 var anonymized = '@GetGlobalValue("Global:CookieOptInLevel").ToLower()' === 'functional';
418 SEO.trackOriginalView(anonymized);
419
420
421 console.log('Init recaptcha v3');
422 const RECAPTCHA_SITE_KEY = "@reCaptchaSiteKey";
423 const TOKEN_TTL_MS = 90 * 1000; // refresh every 90 seconds
424
425 function updateRecaptchaToken() {
426 const elements = document.getElementsByClassName("g-recaptcha-response");
427 const textarea = elements[0];
428 if (!textarea) return false; // element not yet available
429
430 grecaptcha.ready(() => {
431 grecaptcha.execute(RECAPTCHA_SITE_KEY, { action: "submit" })
432 .then((token) => {
433 textarea.value = token;
434 });
435 });
436 return true;
437 }
438
439 // Wait until the textarea is rendered, then start token refresh
440 const waitForTextarea = setInterval(() => {
441 if (updateRecaptchaToken()) {
442 clearInterval(waitForTextarea);
443 setInterval(updateRecaptchaToken, TOKEN_TTL_MS);
444 }
445 }, 200);
446
447 @RenderSnippet("JavaScriptDocReady")
448 });
449 </script>
450
451
452 </body>
453 </html>
454