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