Error executing template "Designs/Pluggerz/_parsed/DefaultPage.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 Comfoor.Repository.Helpers.NavigationHelper.GetBreadCrumb(String culture) in D:\a\1\s\Comfoor.Repository\Helpers\NavigationHelper.cs:line 260
at CompiledRazorTemplates.Dynamic.RazorEngine_52f467a614af4a908fdf488055680f7d.Execute() in D:\inetpub\wwwroot\www.comfoor.nl\Files\Templates\Designs\Pluggerz\_parsed\DefaultPage.parsed.cshtml:line 167
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>
2 @using Dynamicweb.Content
3 @using Comfoor.Repository.Helpers
4 @using Comfoor.Models.Constants
5 @{
6 var homepageId = Dynamicweb.Extensibility.ServiceLocator.Current.GetPageService().GetFirstPageForArea(Dynamicweb.Frontend.PageView.Current().AreaID).ID;
7 var homepageUrl = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(homepageId);
8 var openGraph = Comfoor.Repository.Helpers.StringHelper.GetOpenGraph(Dynamicweb.Frontend.PageView.Current(), Model);
9 var areaId = Dynamicweb.Frontend.PageView.Current().Area.ID;
10
11 var pageTitle = Model.Title;
12 if (openGraph != null && !string.IsNullOrWhiteSpace(openGraph.Title))
13 {
14 pageTitle = openGraph.Title;
15 }
16
17 var metaDescription = Model.Description;
18 if (openGraph != null && !string.IsNullOrWhiteSpace(openGraph.Description))
19 {
20 metaDescription = openGraph.Description;
21 }
22
23 var metaKeywords = Model.Keywords;
24 if (openGraph != null && !string.IsNullOrWhiteSpace(openGraph.Keywords))
25 {
26 metaKeywords = openGraph.Keywords;
27 }
28
29 var hideNewsletterSubscription = true; // CCW-138: Pluggerz has no newsletter subscription
30 var hideSocialShare = Model.PropertyItem != null ? Model.PropertyItem.GetBoolean(Comfoor.Models.Constants.StringConstants.PageProperties.HideSocialShareButtons) : true;
31 var bodyClass = hideNewsletterSubscription ? "no-newsletter" : "";
32 var logo = "/Files/Templates/Designs/Pluggerz/Images/Logos/Pluggerz.png";
33
34
35 var ogUrl = Dynamicweb.Frontend.PageView.Current().SearchFriendlyUrl;
36 if (!ogUrl.StartsWith("http", StringComparison.InvariantCultureIgnoreCase))
37 {
38 ogUrl = $"{Dynamicweb.Frontend.PageView.Current().GlobalTags.GetTagByName("Global:Request.Scheme")?.Value ?? ""}://{Dynamicweb.Frontend.PageView.Current().GlobalTags.GetTagByName("Global:Request.Host")?.Value ?? ""}{ogUrl}";
39 }
40 }
41 <!DOCTYPE html>
42 <html>
43 <head>
44 <meta charset="utf-8" />
45 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
46 <title>@pageTitle</title>
47 @if (!string.IsNullOrWhiteSpace(metaDescription))
48 {
49 <meta name="description" content="@metaDescription" />
50 }
51 @if (!string.IsNullOrWhiteSpace(metaKeywords))
52 {
53 <meta name="keywords" content="@metaKeywords" />
54 }
55 <meta property="og:title" content="@pageTitle" />
56 <meta property="og:type" content="website" />
57 <meta property="og:url" content="@ogUrl" />
58 @if (openGraph != null && !string.IsNullOrWhiteSpace(openGraph.Image))
59 {
60 <meta property="og:image" content="@openGraph.Image" />
61 }
62 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
63 @{
64 var googleTrackingCode = System.Text.Encoding.ASCII.GetString(System.Text.Encoding.ASCII.GetBytes(Comfoor.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(Comfoor.Models.Constants.StringConstants.ThirdPartyConfiguration.GoogleTagManagerKey))).Replace("?", "");
65 if (!string.IsNullOrWhiteSpace(googleTrackingCode))
66 {
67 <script>
68 (function(w, d, s, l, i) {
69 w[l] = w[l] || [];
70 w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' });
71 var f = d.getElementsByTagName(s)[0],
72 j = d.createElement(s),
73 dl = l != 'dataLayer' ? '&l=' + l : '';
74 j.async = true;
75 j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
76 f.parentNode.insertBefore(j, f);
77 })(window, document, 'script', 'dataLayer', '@googleTrackingCode');
78 </script>
79 <!-- End Google Tag Manager -->
80 }
81 }
82 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
83 @{
84 var headSectionScheme = Dynamicweb.Frontend.PageView.Current().GlobalTags.GetTagByName("Global:Request.Scheme").Value;
85 var headSectionHost = Dynamicweb.Frontend.PageView.Current().GlobalTags.GetTagByName("Global:Request.Host").Value;
86 var headSectionDnaPrefetch = string.Format("{0}://{1}", headSectionScheme, headSectionHost);
87 var headSectionLanguage = Dynamicweb.Frontend.PageView.Current().GlobalTags.GetTagByName("Global:Area.Lang").Value;
88 var headSectionApplicationName = Comfoor.Models.Constants.StringConstants.ApplicationSettings.ApplicationName;
89 }
90
91 @*META DATA*@
92 <meta http-equiv="content-language" content='@headSectionLanguage' />
93 <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
94 <meta http-equiv="imagetoolbar" content="no" />
95 <meta http-equiv="x-dns-prefetch-control" content="on" />
96 <meta http-equiv="x-ua-compatible" content="ie=edge" />
97 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
98 <meta name="application-name" content='@headSectionApplicationName' />
99 <meta name="author" content="Innovadis BV, Enschede" />
100 <meta name="copyright" content='Innovadis BV, Enschede, @DateTime.Now.Year' />
101 <meta name="web_author" content="Innovadis BV, Enschede" />
102 <meta name="facebook-domain-verification" content="8vsnw5yp0bsc7yoceg3oipxl6g0auo" />
103 <meta name="google-site-verification" content="google-site-verification=fJVsk8Q6vJHdfdz9djzicsLJmoSmEmuJ4BTNj41i67s" />
104
105 <link rel="apple-touch-icon" sizes="57x57" href="/Files/templates/Designs/Pluggerz/Images/Favicon/apple-icon-57x57.png">
106 <link rel="apple-touch-icon" sizes="60x60" href="/Files/templates/Designs/Pluggerz/Images/Favicon/apple-icon-60x60.png">
107 <link rel="apple-touch-icon" sizes="72x72" href="/Files/templates/Designs/Pluggerz/Images/Favicon/apple-icon-72x72.png">
108 <link rel="apple-touch-icon" sizes="76x76" href="/Files/templates/Designs/Pluggerz/Images/Favicon/apple-icon-76x76.png">
109 <link rel="apple-touch-icon" sizes="114x114" href="/Files/templates/Designs/Pluggerz/Images/Favicon/apple-icon-114x114.png">
110 <link rel="apple-touch-icon" sizes="120x120" href="/Files/templates/Designs/Pluggerz/Images/Favicon/apple-icon-120x120.png">
111 <link rel="apple-touch-icon" sizes="144x144" href="/Files/templates/Designs/Pluggerz/Images/Favicon/apple-icon-144x144.png">
112 <link rel="apple-touch-icon" sizes="152x152" href="/Files/templates/Designs/Pluggerz/Images/Favicon/apple-icon-152x152.png">
113 <link rel="apple-touch-icon" sizes="180x180" href="/Files/templates/Designs/Pluggerz/Images/Favicon/apple-icon-180x180.png">
114 <link rel="icon" type="image/png" sizes="192x192" href="/Files/templates/Designs/Pluggerz/Images/Favicon/android-icon-192x192.png">
115 <link rel="icon" type="image/png" sizes="32x32" href="/Files/templates/Designs/Pluggerz/Images/Favicon/favicon-32x32.png">
116 <link rel="icon" type="image/png" sizes="96x96" href="/Files/templates/Designs/Pluggerz/Images/Favicon/favicon-96x96.png">
117 <link rel="icon" type="image/png" sizes="16x16" href="/Files/templates/Designs/Pluggerz/Images/Favicon/favicon-16x16.png">
118 <link rel="manifest" href="/Files/templates/Designs/Pluggerz/Images/Favicon/manifest.json">
119 <meta name="msapplication-TileColor" content="#ffffff">
120 <meta name="msapplication-TileImage" content="/Files/templates/Designs/Pluggerz/Images/Favicon/ms-icon-144x144.png">
121 <meta name="theme-color" content="#ffffff">
122
123 @*LINKS*@
124 <link rel="dns-prefetch" href="@headSectionDnaPrefetch" />
125 <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" />
126 <link rel="stylesheet" href="/Files/templates/Designs/Pluggerz/Css/Pluggerz.min.css?ticks=@Model.Area.UpdatedDate.Ticks" />
127 @RenderSnippet("StyleSheet")
128 @RenderSnippet("JavaScript")
129 </head>
130 <body class="@bodyClass">
131 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
132 @{
133 // var googleTrackingCode = Defined in GoogleTagManagerCode.csthml
134 if (!string.IsNullOrWhiteSpace(googleTrackingCode))
135 {
136 var googleSrcUrl = $"https://www.googletagmanager.com/ns.html?id={googleTrackingCode}";
137 <!-- Google Tag Manager (noscript) -->
138 <noscript>
139 <iframe src="@googleSrcUrl" height="0" width="0" style="display: none; visibility: hidden"></iframe>
140 </noscript>
141 <!-- End Google Tag Manager (noscript) -->
142 }
143 }
144 <div class="wrapper" data-cookieoptinlevel='@Pageview.GlobalTags.GetTagByName("Global:CookieOptInLevel").Value.ToLower()'>
145 <header class="navbar navbar-default" role="navigation">
146 <div id="top-header-desktop">
147 @RenderSnippet("Topper")
148 </div>
149 <div class="container">
150 <div class="navbar-header">
151 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
152 <span class="sr-only">@Translate("Toggle_navigation", "Toggle navigation")</span>
153 <span class="icon-bar"></span>
154 <span class="icon-bar"></span>
155 <span class="icon-bar"></span>
156 </button>
157 <a class="navbar-brand" href='@homepageUrl'><img src="@logo" alt="@Pageview.Area.Name.JsEncode()" class="svg"/></a>
158 </div>
159 <div class="collapse navbar-collapse">
160 @Comfoor.Repository.Helpers.NavigationHelper.GetNavigationItemsByNavigationTag(StringConstants.NavigationTags.HeaderNavigation, Dynamicweb.Frontend.PageView.Current(), "navbar", "nav navbar-nav", 1, null, true)
161 <div id="top-header-mobile">
162 @RenderSnippet("Topper")
163 </div>
164 </div>
165 </div>
166 </header>
167 @Comfoor.Repository.Helpers.NavigationHelper.GetBreadCrumb(Dynamicweb.Frontend.PageView.Current().Area.Culture)
168 <article>
169 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
170
171 @Model.Placeholder("dwcontent", "content", "default:true;sort:1")
172 </article>
173 </div>
174 <footer>
175 @if (!hideNewsletterSubscription)
176 {
177 <div>@using Comfoor.Repository.Helpers
178 @using Comfoor.Models.Constants
179 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
180 @{
181 var newsletterSubscriptionParagraphId = 0;
182 int.TryParse(AreaHelper.GetAreaItemStringValueBySystemName(StringConstants.ParagraphIds.NewsletterSubscription), out newsletterSubscriptionParagraphId);
183 if (newsletterSubscriptionParagraphId > 0)
184 {
185 <div class="newsletter-subscription-container">
186 <div class="container">
187 <div class="row">
188 <div class="col-xs-12">
189 @RenderParagraphContent(newsletterSubscriptionParagraphId)
190 </div>
191 </div>
192 </div>
193 </div>
194 }
195 }</div>
196 }
197 @using Comfoor.Repository.Helpers
198 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
199 @{
200 var footerPageService = new Dynamicweb.Content.PageService();
201 var footerColumns = NavigationHelper.GetFooterNavigationColumns(Dynamicweb.Frontend.PageView.Current(), footerPageService);
202 if (footerColumns != null && footerColumns.Count > 0)
203 {
204 var columnClass = "col-xs-12 col-md-3";
205 var contactColumnClass = "col-xs-12 col-md-3";
206 switch (footerColumns.Count) {
207 case 1:
208 columnClass = "col-xs-12 col-md-6";
209 contactColumnClass = "col-xs-12 col-md-6";
210 break;
211 case 2:
212 columnClass = "col-xs-12 col-md-4";
213 contactColumnClass = "col-xs-12 col-md-4";
214 break;
215 case 3:
216 columnClass = "col-xs-12 col-sm-6 col-md-3";
217 contactColumnClass = "col-xs-12 col-sm-6 col-md-3";
218 break;
219 case 4:
220 columnClass = "col-xs-12 col-md-2";
221 contactColumnClass = "col-xs-12 col-md-4";
222 break;
223 }
224 <div class="container footer-content">
225 <div class="row">
226 @foreach (var footerColumnPage in footerColumns)
227 {
228 <div class="@columnClass">
229 @NavigationHelper.CreateFooterNavigationColumn(Dynamicweb.Frontend.PageView.Current(), footerColumnPage, "h2")
230 </div>
231 }
232 <div class="contact @contactColumnClass">
233 <h2>@Translate("Contact", "Contact")</h2>
234 @AreaHelper.GetContactInfo()
235 </div>
236 </div>
237 </div>
238 }
239 }
240 @using Comfoor.Repository.Helpers
241 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
242 @{
243 var bottomPageService = new Dynamicweb.Content.PageService();
244 var bottomNavigation = NavigationHelper.GetNavigationItemsByNavigationTag(Comfoor.Models.Constants.StringConstants.NavigationTags.BottomNavigation,
245 Dynamicweb.Frontend.PageView.Current(), "bottom-nav", "", 0, bottomPageService);
246 var copyright = Translate("Copyright", "Copyright {year} © Comfoor B.V.").Replace("{year}", DateTime.Today.Year.ToString());
247 if (!string.IsNullOrWhiteSpace(bottomNavigation))
248 {
249 <div class="bottom-navigation">
250 <div class="background-white"></div>
251 <div class="container">
252 <div class="row">
253 <div class="col-xs-12 col-md-9 col-lg-8 navigation">
254 @bottomNavigation
255 </div>
256 <div class="hidden-xs hidden-sm col-md-3 col-lg-4 logo"></div>
257 </div>
258 </div>
259 </div>
260 @SnippetStart("JavaScriptBottom")
261 <script>
262 $(document).ready(function () {
263 $("#bottom-nav").append("<li class='copyright'>@copyright</li>");
264 });
265 </script>
266 @SnippetEnd("JavaScriptBottom")
267 }
268 }
269 </footer>
270
271 @using Comfoor.Repository.Helpers
272 @using Dynamicweb.Content
273 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
274
275 @{
276 var searchResultsPage = Dynamicweb.Extensibility.ServiceLocator.Current.GetPageService().GetPageByNavigationTag(Dynamicweb.Frontend.PageView.Current().AreaID, Comfoor.Models.Constants.StringConstants.NavigationTags.SearchResults);
277 var myPluggerzUrl = Comfoor.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(Comfoor.Models.Constants.StringConstants.ExternalLinks.MyComfoor);
278 var pluggerzWebshopUrl = Comfoor.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(Comfoor.Models.Constants.StringConstants.ExternalLinks.PluggerzWebshop);
279 var showActionLinks = !string.IsNullOrWhiteSpace(myPluggerzUrl); // || !string.IsNullOrWhiteSpace(pluggerzWebshopUrl);
280 var countryCode = Comfoor.Repository.Helpers.AreaHelper.GetAreaCountryCodeByPageView(Dynamicweb.Frontend.PageView.Current());
281 var languages = Model.Languages.Where(l => !l.IsCurrent).ToList();
282 var headerLogo = "/Files/Templates/Designs/Pluggerz/Images/Logos/Pluggerz.png";
283 }
284
285 @SnippetStart("Topper")
286 <a class="navbar-brand" href='@homepageUrl'><img src="@headerLogo" alt="@Pageview.Area.Name.JsEncode()" class="svg" /></a>
287
288 @if (searchResultsPage != null)
289 {
290 var searchUrl = string.Format("/Default.aspx?ID={0}", searchResultsPage.ID);
291 <div id="site-search">
292 <form id="site-search-form" method="POST" action="@searchUrl">
293 <input type="text" id="q" name="q" placeholder="@Translate("Search-placeholder", "Search through our site")" />
294 <button id="search-button" name="search-button" type="button"><i class="glyphicon glyphicon-search"></i></button>
295 </form>
296 </div>
297 }
298 @if (languages.Count > 0)
299 {
300 var cultureInfo = Pageview.Area.CultureInfo;
301 var pageService = new Dynamicweb.Content.PageService();
302 var languagePages = pageService.GetLanguagePages(Model.ID);
303 <div class="language-selector btn-group">
304 <button type="button" class="btn dropdown-toggle" data-toggle="dropdown">
305 <span class="flag-icon flag-icon-@countryCode"></span>
306 <span class="caret"></span>
307 </button>
308 <ul class="dropdown-menu" role="menu">
309 @foreach (var lang in languages)
310 {
311 var languageArea = Dynamicweb.Services.Areas.GetArea(lang.ID);
312 if (languageArea != null)
313 {
314 var languageCountryCode = languageArea.Culture.Split('-')[1];
315 var languagePageLink = Comfoor.Repository.Helpers.PageHelper.GetLanguagePageLink(lang, languagePages, "", pageService);
316 string langInfo = string.Format("<span class=\"flag-icon flag-icon-{0}\"></span>", languageCountryCode.ToLower());
317 <li>
318 <a href='@languagePageLink'>@langInfo</a>
319 </li>
320 }
321 }
322 </ul>
323 </div>
324 }
325
326 @if (showActionLinks)
327 {
328 var portalLogo = string.Format("/Files/Templates/Designs/Pluggerz/Images/Logos/{0}/Pluggerz_Portal.svg", countryCode);
329 var pluggerzLogo = "/Files/Templates/Designs/Pluggerz/Images/Logos/Pluggerz.png";
330 <div class="action-links">
331 @if (!string.IsNullOrWhiteSpace(myPluggerzUrl))
332 {
333 <a href="@myPluggerzUrl" target="_blank" class="portal" title="@Translate("MyPluggerz", "My Pluggerz").JsEncode()"><img src="@portalLogo" /></a>
334 }
335 @*@if (!string.IsNullOrWhiteSpace(pluggerzWebshopUrl))
336 {
337 <a href="@pluggerzWebshopUrl" target="_blank" class="pluggerz" title="@Translate("Pluggerz", "Pluggerz").JsEncode()"><img src="@pluggerzLogo" /></a>
338 }*@
339 </div>
340 }
341 @SnippetEnd("Topper")
342
343 <script src="//code.jquery.com/jquery.js"></script>
344 <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
345 <script src="//cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick.js"></script>
346 <script src="/Files/Templates/Designs/Pluggerz/Js/custom-rendered.js"></script>
347 <script type="text/javascript">
348 var areaId = '@areaId';
349 </script>
350 @RenderSnippet("JavaScriptBottom")
351
352 @if (!hideSocialShare)
353 {
354 <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5ced203db91decc9"></script>
355 }
356
357 @*@foreach (var tag in Pageview.GlobalTags)
358 {
359 var value = tag.Name + " : " + tag.Value + "<br />";
360 @value;
361 }*@
362
363 </body>
364 </html>