Error executing template "Designs/Swift/_parsed/Swift_Page.parsed.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_897ac0927b2244268ffe253dbc1c56dc.Execute() in C:\inetpub\wwwroot\DWShop2023\Solutions\Swift_v1.21.0\Files\Templates\Designs\Swift\_parsed\Swift_Page.parsed.cshtml:line 399
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 System
3 @using Dynamicweb
4 @using Dynamicweb.Environment
5 @using Dynamicweb.Frontend
6
7 @{
8 string pageDomain = Pageview.Area.UrlName;
9 var basePageUrl = "";
10 var pageURL = "";
11
12 var alternatePageAddress = Dynamicweb.Context.Current.Request.RawUrl.Split('?')[0].Replace("/products/","/proizvodi/").Replace("/"+pageDomain+"/","").Replace("/"+pageDomain,"");
13 alternatePageAddress = alternatePageAddress.Length > 1 ? alternatePageAddress : "";
14
15 string swiftVersion = ReadFile("/Files/Templates/Designs/Swift/swift_version.txt");
16 bool renderAsResponsive = Model.Area.Item.GetString("DeviceRendering", "responsive").Equals("responsive", StringComparison.OrdinalIgnoreCase);
17 bool renderMobile = Pageview.Device == Dynamicweb.Frontend.Devices.DeviceType.Mobile || Pageview.Device == Dynamicweb.Frontend.Devices.DeviceType.Tablet;
18 string responsiveClassDesktop = string.Empty;
19 string responsiveClassMobile = string.Empty;
20 if (renderAsResponsive)
21 {
22 responsiveClassDesktop = " d-none d-xl-block";
23 responsiveClassMobile = " d-block d-xl-none";
24 }
25
26 var disableWideBreakpoints = Model.Area?.Item?.GetRawValueString("DisableWideBreakpoints", "default");
27
28 var brandingPageId = Model.Area.Item.GetLink("BrandingPage") != null ? Model.Area.Item.GetLink("BrandingPage").PageId : 0;
29 var themePageId = Model.Area.Item.GetLink("ThemesPage") != null ? Model.Area.Item.GetLink("ThemesPage").PageId : 0;
30 string customHeaderInclude = Model.Area.Item.GetFile("CustomHeaderInclude") != null ? Model.Area.Item.GetFile("CustomHeaderInclude").Name : string.Empty;
31
32 var brandingPage = Dynamicweb.Content.Services.Pages?.GetPage(brandingPageId) ?? null;
33 var themesParagraphLastChanged = Dynamicweb.Content.Services.Paragraphs.GetParagraphsByPageId(themePageId).OrderByDescending(p => p.Audit.LastModifiedAt).FirstOrDefault();
34
35 var cssLastModified = brandingPage.Audit.LastModifiedAt > themesParagraphLastChanged.Audit.LastModifiedAt ? brandingPage.Audit.LastModifiedAt : themesParagraphLastChanged.Audit.LastModifiedAt;
36 var cssThemeAndBrandingStyleFileInfo = new System.IO.FileInfo(Dynamicweb.Core.SystemInformation.MapPath($"/Files/Templates/Designs/Swift/_parsed/Swift_css/Swift_styles_{Model.Area.ID}.min.css"));
37
38 // Schema.org details for PDP
39 string productId = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString.Get("ProductID")) ? Dynamicweb.Context.Current.Request.QueryString.Get("ProductID") : "";
40 bool isProductDetailsPage = !string.IsNullOrEmpty(productId);
41 bool isArticlePage = Model.ItemType == "Swift_Article";
42 string schemaOrgType = string.Empty;
43
44 char[] MyChar = {'/'};
45 var urlCro = Dynamicweb.Context.Current.Request.RawUrl.Split('?')[0].Replace("/products/","/proizvodi/").Replace("/"+pageDomain+"/","").Replace("/"+pageDomain,"").Replace("Default.aspx","").TrimStart(MyChar);
46 var urlEng = Dynamicweb.Context.Current.Request.RawUrl.Split('?')[0].Replace("/"+pageDomain+"/","").Replace("/"+pageDomain,"").Replace("Default.aspx","").TrimStart(MyChar);
47
48 if (isProductDetailsPage)
49 {
50 schemaOrgType = "itemscope=\"\" itemtype=\"https://schema.org/Product\"";
51 }
52
53 if (isArticlePage)
54 {
55 schemaOrgType = "itemscope=\"\" itemtype=\"https://schema.org/Article\"";
56 }
57
58 if (!cssThemeAndBrandingStyleFileInfo.Exists || cssThemeAndBrandingStyleFileInfo.LastWriteTime < brandingPage.Audit.LastModifiedAt)
59 {
60 //Branding page has been saved or the file is missing. Rewrite the file to disc.
61 if (brandingPageId > 0)
62 {
63 var brandingPageview = Dynamicweb.Frontend.PageView.GetPageviewByPageID(brandingPageId);
64 brandingPageview.Redirect = false;
65 brandingPageview.Output();
66 }
67 }
68
69 if (!cssThemeAndBrandingStyleFileInfo.Exists || cssThemeAndBrandingStyleFileInfo.LastWriteTime < themesParagraphLastChanged.Audit.LastModifiedAt)
70 {
71 //Branding page has been saved or the file is missing. Rewrite the file to disc.
72 if (themePageId > 0)
73 {
74 var themePageview = Dynamicweb.Frontend.PageView.GetPageviewByPageID(themePageId);
75 themePageview.Redirect = false;
76 themePageview.Output();
77 }
78 }
79
80 var cssStyleFileInfo = new System.IO.FileInfo(Dynamicweb.Core.SystemInformation.MapPath("/Files/Templates/Designs/Swift/Assets/css/styles.css"));
81 var jsFileInfo = new System.IO.FileInfo(Dynamicweb.Core.SystemInformation.MapPath("/Files/Templates/Designs/Swift/Assets/js/scripts.js"));
82
83 string masterTheme = !string.IsNullOrWhiteSpace(Model.Area.Item.GetRawValueString("Theme")) ? " theme " + Model.Area.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : "";
84
85 string favicon = Model.Area.Item.GetFile("Favicon") != null ? Model.Area.Item.GetFile("Favicon").Path : "/Files/Templates/Designs/Swift/Assets/Images/favicon.png";
86
87 string headerCssClass = "sticky-top";
88 bool movePageBehind = false;
89
90 if (Pageview.Page.PropertyItem != null)
91 {
92 headerCssClass = Pageview.Page.PropertyItem["MoveThisPageBehindTheHeader"] != null ? Pageview.Page.PropertyItem["MoveThisPageBehindTheHeader"].ToString() : "sticky-top";
93 movePageBehind = headerCssClass == "fixed-top" && !Pageview.IsVisualEditorMode ? true : false;
94 }
95
96 headerCssClass = headerCssClass == "" ? "sticky-top" : headerCssClass;
97 headerCssClass = Pageview.IsVisualEditorMode ? "" : headerCssClass;
98
99 string googleTagManagerID = Model.Area.Item.GetString("GoogleTagManagerID");
100 string googleAnalyticsMeasurementID = Model.Area.Item.GetString("GoogleAnalyticsMeasurementID");
101 var cookieOptInLevel = CookieManager.GetCookieOptInLevel();
102 bool allowTracking = cookieOptInLevel == CookieOptInLevel.All || (cookieOptInLevel == CookieOptInLevel.Functional && CookieManager.GetCookieOptInCategories().Contains("Statistical"));
103
104 Dynamicweb.Context.Current.Response.AddHeader("link", $"</Files/Templates/Designs/Swift/Assets/css/styles.css?{cssStyleFileInfo.LastWriteTime.Ticks}>; rel=preload; as=style;");
105 Dynamicweb.Context.Current.Response.AddHeader("link", $"</Files/Templates/Designs/Swift/_parsed/Swift_css/Swift_styles_{Model.Area.ID}.min.css?{cssLastModified.Ticks}; rel=preload; as=style;");
106 Dynamicweb.Context.Current.Response.AddHeader("link", $"</Files/Templates/Designs/Swift/Assets/js/aos.js?{jsFileInfo.LastWriteTime.Ticks}; rel=preload; as=script;");
107 Dynamicweb.Context.Current.Response.AddHeader("link", $"</Files/Templates/Designs/Swift/Assets/js/scripts.js?{jsFileInfo.LastWriteTime.Ticks}; rel=preload; as=script;");
108 //Dynamicweb.Context.Current.Response.Flush(); //This sends the headers where we are now in the rendering making the TTFB faster
109
110 SetMetaTags();
111
112 List<Dynamicweb.Content.Page> languages = new List<Dynamicweb.Content.Page>();
113
114 if (Pageview.Area.IsMaster)
115 {
116 languages.Add(Pageview.Page);
117 if (Pageview.Page.Languages != null)
118 {
119 foreach (var language in Pageview.Page.Languages)
120 {
121 languages.Add(language);
122 }
123 }
124 }
125 else
126 {
127 languages.Add(Pageview.Page.MasterPage);
128 if (Pageview.Page.MasterPage != null)
129 {
130 if (Pageview.Page.MasterPage.Languages != null)
131 {
132 foreach (var language in Pageview.Page.MasterPage.Languages)
133 {
134 languages.Add(language);
135 }
136 }
137 }
138 }
139
140 string siteLanguage = Pageview.Area.CultureInfo.Name;
141 Uri url = Dynamicweb.Context.Current.Request.Url;
142 string hostName = url.Host; // domain.com/da-dk or domain.com/en-us
143
144 var ecomCountries = Dynamicweb.Ecommerce.Services.Countries.GetCountries();
145 var ecomCurrencies = Dynamicweb.Ecommerce.Services.Currencies.GetAllCurrencies();
146
147 }
148 <!doctype html>
149 <html lang="@Pageview.Area.CultureInfo.TwoLetterISOLanguageName">
150 <head>
151
152 <script>
153 window.dataLayer = window.dataLayer || [];
154 function gtag(){dataLayer.push(arguments);}
155
156 gtag('consent', 'default', {
157 'ad_storage': 'denied',
158 'analytics_storage': 'denied',
159 'ad_user_data': 'denied',
160 'ad_personalization': 'denied',
161 'personalization_storage': 'denied',
162 'functionality_storage': 'denied',
163 'security_storage': 'denied'
164 });
165
166 </script>
167
168 <!-- Google Tag Manager -->
169 <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);j.async=true;j.src="https://sst.croata.hr/80e4gozndukc.js?"+i;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','2d3=Cg9IIzo3QjAyOEcgVjI8QRVWR0pfXAsJXggHCw8ODkkLGQ%3D%3D');</script>
170 <!-- End Google Tag Manager -->
171
172 <script type="application/ld+json">
173 {
174 "@@context": "https://schema.org/",
175 "@@type": "Organization",
176 "name": "Potomac grupa d.o.o.",
177 "url": "https://www.croata.hr/",
178 "logo": "https://www.croata.hr/Files/Images/Logos/Croata_Logo.jpg",
179 "sameAs": ["https://www.facebook.com/CROATAlife/", "https://www.instagram.com/croatalife/", "https://www.pinterest.com/croatalife/", "https://www.linkedin.com/showcase/croata", "https://www.youtube.com/channel/UC6UKVh1GFpwBX74ve2obh4Q" ],
180 "contactPoint" : [
181 { "@@type" : "ContactPoint",
182 "telephone" : "+385 1 645 7010",
183 "email": "info@croata.hr",
184 "availableLanguage" : @Translate("schema_languages"),
185 "contactType" : @Translate("schema_customerservice")
186 }]
187 }
188 </script>
189 <!-- @swiftVersion -->
190 @* Required meta tags *@
191 <meta charset="utf-8">
192 <meta name="viewport" content="height=device-height, width=device-width, initial-scale=1.0">
193 <link rel="shortcut icon" href="@favicon">
194 <link rel="apple-touch-icon" href="/Files/Templates/Designs/Swift/Assets/Images/logo_transparent.png">
195
196 @* Preventing page from caching because of not loading cart content
197 Dignet 28.07.2023.
198 *@
199 <meta http-equiv="cache-control" content="max-age=0">
200 <meta http-equiv="cache-control" content="no-cache">
201 <meta http-equiv="expires" content="-1">
202 <meta http-equiv="expires" content="Tue, 01 Jan 1980 11:00:00 GMT">
203 <meta http-equiv="pragma" content="no-cache">
204 @*------- end Dignet 28.07.2023. *@
205
206 @Model.MetaTags
207
208 <title>@Model.Title</title>
209 @* Bootstrap + Swift stylesheet *@
210 <link href="/Files/Templates/Designs/Swift/Assets/css/styles.css?@cssStyleFileInfo.LastWriteTime.Ticks" rel="stylesheet" media="all" type="text/css">
211
212 @{
213 basePageUrl = url.Host;
214 pageURL = (basePageUrl.Substring(basePageUrl.Length - 3, 3) == "com" ? "/in-en" : "/hr-hr") + pageURL;
215 }
216 <link rel="canonical" href="https://@basePageUrl@pageURL" />
217 <link rel="alternate" href="https://@basePageUrl/hr-hr/@alternatePageAddress" hreflang="hr-hr" />
218
219 @{
220 basePageUrl = basePageUrl.Replace(".hr", ".com");
221 alternatePageAddress = Dynamicweb.Context.Current.Request.RawUrl.Split('?')[0].Replace("/proizvodi/","/products/").Replace("/"+pageDomain+"/","").Replace("/"+pageDomain,"");
222 alternatePageAddress = alternatePageAddress.Length > 1 ? alternatePageAddress : "";
223 }
224
225 <link rel="alternate" href="https://@basePageUrl/eu-en/@alternatePageAddress" hreflang="en-eu" />
226 <link rel="alternate" href="https://@basePageUrl/na-en/@alternatePageAddress" hreflang="en-ca" />
227 <link rel="alternate" href="https://@basePageUrl/na-en/@alternatePageAddress" hreflang="en-us" />
228 <link rel="alternate" href="https://@basePageUrl/ch-en/@alternatePageAddress" hreflang="en-cn" />
229 <link rel="alternate" href="https://@basePageUrl/jp-en/@alternatePageAddress" hreflang="en-jp" />
230 <link rel="alternate" href="https://@basePageUrl/sa-en/@alternatePageAddress" hreflang="es-xl" />
231 <link rel="alternate" href="https://@basePageUrl/uk-en/@alternatePageAddress" hreflang="en-gb" />
232 <link rel="alternate" href="https://@basePageUrl/au-en/@alternatePageAddress" hreflang="en-au" />
233 <link rel="alternate" href="https://@basePageUrl/in-en/@alternatePageAddress" hreflang="en" />
234 <link rel="alternate" href="https://@basePageUrl/in-en/@alternatePageAddress" hreflang="x-default" />
235
236
237 @if (disableWideBreakpoints != "disableBoth")
238 {
239 <style>
240 @@media ( min-width: 1600px ) {
241 .container-xxl,
242 .container-xl,
243 .container-lg,
244 .container-md,
245 .container-sm,
246 .container {
247 max-width: 1520px;
248 }
249 }
250 </style>
251
252
253
254 if (disableWideBreakpoints != "disableUltraWideOnly")
255 {
256 <style>
257 @@media ( min-width: 1920px ) {
258 .container-xxl,
259 .container-xl,
260 .container-lg,
261 .container-md,
262 .container-sm,
263 .container {
264 max-width: 1820px;
265 }
266 }
267 </style>
268 }
269 }
270
271 @* Branding and Themes min stylesheet *@
272 <link href="/Files/Templates/Designs/Swift/_parsed/Swift_css/Swift_styles_@(Model.Area.ID).min.css?@cssLastModified.Ticks" rel="stylesheet" media="all" type="text/css" data-last-modified-content="@cssLastModified">
273 <script src="/Files/Templates/Designs/Swift/Assets/js/aos.js?@jsFileInfo.LastWriteTime.Ticks" defer></script>
274 <script src="/Files/Templates/Designs/Swift/Assets/js/scripts.js?@jsFileInfo.LastWriteTime.Ticks" defer></script>
275
276 <script type="module">
277 AOS.init({ duration: 400, delay: 100, easing: 'ease-in-out', mirror: false, disable: window.matchMedia('(prefers-reduced-motion: reduce)') });
278 swift.Scroll.hideHeadersOnScroll();
279 swift.Scroll.handleAlternativeTheme();
280 </script>
281
282 @* Google tag manager *@
283 @if (!string.IsNullOrWhiteSpace(googleTagManagerID) && allowTracking)
284 {
285
286 @*
287 <script>
288 (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
289 new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
290 j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
291 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
292 })(window, document, 'script', 'dataLayer', '@(googleTagManagerID)');
293 function gtag() { dataLayer.push(arguments); }
294 </script>
295 *@
296 }
297
298 @if (!string.IsNullOrWhiteSpace(googleAnalyticsMeasurementID) && allowTracking)
299 {
300 var GoogleAnalyticsDebugMode = "";
301 bool isLoggedInBackendUser = false;
302
303 if (Dynamicweb.Security.UserManagement.User.GetCurrentBackendUser() != null)
304 {
305 isLoggedInBackendUser = true;
306 }
307
308 if (Model.Area.Item.GetBoolean("EnableGoogleAnalyticsDebugMode") && isLoggedInBackendUser)
309 {
310 GoogleAnalyticsDebugMode = ", {'debug_mode': true}";
311 }
312
313 <script async src="https://www.googletagmanager.com/gtag/js?id=@googleAnalyticsMeasurementID"></script>
314 <script>
315 window.dataLayer = window.dataLayer || [];
316 function gtag() { dataLayer.push(arguments); }
317 gtag('js', new Date());
318 gtag('config', '@googleAnalyticsMeasurementID'@GoogleAnalyticsDebugMode);
319 </script>
320 }
321
322 @if (!string.IsNullOrWhiteSpace(customHeaderInclude))
323 {
324 @RenderPartial($"Components/Custom/{customHeaderInclude}")
325 }
326
327 </head>
328 <body class="brand @(masterTheme)" id="page@(Model.ID)" onload="checkCookie()">
329
330 <!-- Google Tag Manager (noscript) -->
331 <noscript><iframe src="https://sst.croata.hr/ns.html?id=GTM-WQS2D8HS" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
332 <!-- End Google Tag Manager (noscript) -->
333
334 @* Google tag manager *@
335 @if (!string.IsNullOrWhiteSpace(googleTagManagerID) && allowTracking)
336 {
337 <noscript>
338 <iframe src="https://www.googletagmanager.com/ns.html?id=@(googleTagManagerID)"
339 height="0" width="0" style="display:none;visibility:hidden"></iframe>
340 </noscript>
341 }
342
343 @if (renderAsResponsive || !renderMobile)
344 {
345 <header class="page-header @headerCssClass top-0@(responsiveClassDesktop)" id="page-header-desktop">
346 @if (@Model.Area.Item.GetLink("HeaderDesktop") != null)
347 {
348 @RenderGrid(@Model.Area.Item.GetLink("HeaderDesktop").PageId)
349 }
350 </header>
351 }
352
353 @if ((renderAsResponsive || renderMobile))
354 {
355 <header class="page-header @headerCssClass top-0@(responsiveClassMobile)" id="page-header-mobile">
356 @if (@Model.Area.Item.GetLink("HeaderMobile") != null)
357 {
358 @RenderGrid(@Model.Area.Item.GetLink("HeaderMobile").PageId)
359 }
360 </header>
361 }
362
363 <main id="content" @(schemaOrgType)>
364 <div data-intersect></div>
365 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
366 @using System
367 @using Dynamicweb.Ecommerce.ProductCatalog
368
369
370 @{
371 string productIdFromUrl = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString.Get("ProductID")) ? Dynamicweb.Context.Current.Request.QueryString.Get("ProductID") : string.Empty;
372 bool isProductDetail = !string.IsNullOrEmpty(productIdFromUrl) && Pageview.Page.NavigationTag.ToLower() == "shop";
373
374 bool isArticlePagePage = Model.ItemType == "Swift_Article";
375 bool isArticleListPage = Model.ItemType == "Swift_ArticleListPage";
376 string schemaOrgProp = string.Empty;
377 if(isArticlePagePage)
378 {
379 schemaOrgProp = "itemprop=\"articleBody\"";
380 }
381
382 string theme = "";
383 string gridContent = "";
384
385 if (Model.PropertyItem != null)
386 {
387 theme = !string.IsNullOrWhiteSpace(Model.PropertyItem.GetRawValueString("Theme")) ? "theme " + Model.PropertyItem.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : "";
388 }
389
390 if (Model.Item != null || Pageview.IsVisualEditorMode)
391 {
392 if (!isProductDetail)
393 {
394 gridContent = Model.Grid("Grid", "Grid", "default:true;sort:1", "Page");
395 }
396 else
397 {
398 var productObject = Dynamicweb.Ecommerce.Services.Products.GetProductById(productIdFromUrl, "", Pageview.Area.EcomLanguageId);
399 var detailPage = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(productObject.PrimaryGroupId)?.Meta.PrimaryPage ?? string.Empty;
400 var detailPageId = detailPage != string.Empty ? Convert.ToInt16(detailPage.Substring(detailPage.LastIndexOf('=') + 1)) : GetPageIdByNavigationTag("ProductDetailPage");
401
402 @RenderGrid(detailPageId)
403 }
404 }
405
406 bool doNotRenderPage = false;
407
408 //Check if we are on the poduct detail page, and if there is data to render
409 ProductViewModel product = new ProductViewModel();
410 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails"))
411 {
412 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"];
413 if (string.IsNullOrEmpty(product.Id)) {
414 doNotRenderPage = true;
415 }
416 }
417
418 //Render the page
419 if (!doNotRenderPage) {
420 string itemIdentifier = Model?.Item?.SystemName != null ? "item_" + Model.Item.SystemName.ToLower() : "item_Swift_Page";
421
422
423 <div class="@theme @itemIdentifier" @schemaOrgProp>
424 @if (isArticleListPage)
425 {
426 var hx = $"hx-get=\"{Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(Model.ID)}\" hx-select=\"#content\" hx-target=\"#content\" hx-swap=\"outerHTML\" hx-trigger=\"change\" hx-headers='{{\"feed\": \"true\"}}' hx-push-url=\"true\" hx-indicator=\"#ArticleFacetForm\"";
427
428 <form @hx id="ArticleFacetForm">
429 @gridContent
430 </form>
431 <script type="module" src="/Files/Templates/Designs/Swift/Assets/js/htmx.js"></script>
432 <script type="module">
433 document.addEventListener('htmx:confirm', (event) => {
434 let filters = event.detail.elt.querySelectorAll('select');
435 for (var i = 0; i < filters.length; i++) {
436 let input = filters[i];
437 if (input.name && !input.value) {
438 input.name = '';
439 }
440 }
441 });
442
443 document.addEventListener('htmx:beforeOnLoad', (event) => {
444 swift.Scroll.stopIntersectionObserver();
445 });
446
447 document.addEventListener('htmx:afterOnLoad', () => {
448 swift.Scroll.hideHeadersOnScroll();
449 swift.Scroll.handleAlternativeTheme();
450 });
451 </script>
452 }
453 else
454 {
455 @gridContent
456 }
457 </div>
458
459 } else {
460 <div class="container">
461 <div class="alert alert-info" role="alert">@Translate("Sorry. There is nothing to view here")</div>
462 </div>
463 }
464
465 if (!Model.IsCurrentUserAllowed)
466 {
467 int signInPage = GetPageIdByNavigationTag("SignInPage");
468 int dashboardPage = GetPageIdByNavigationTag("MyAccountDashboardPage");
469
470 if (!Pageview.IsVisualEditorMode)
471 {
472 if (signInPage != 0)
473 {
474 if (signInPage != Model.ID) {
475 Dynamicweb.Context.Current.Response.Redirect("/Default.aspx?ID=" + signInPage);
476 } else {
477 if (dashboardPage != 0) {
478 Dynamicweb.Context.Current.Response.Redirect("/Default.aspx?ID=" + dashboardPage);
479 } else {
480 Dynamicweb.Context.Current.Response.Redirect("/");
481 }
482 }
483 }
484 else
485 {
486 <div class="alert alert-dark m-0" role="alert">
487 <span>@Translate("You do not have access to this page")</span>
488 </div>
489 }
490 }
491 else
492 {
493 <div class="alert alert-dark m-0" role="alert">
494 <span>@Translate("To work on this page, you must be signed in, in the frontend")</span>
495 </div>
496 }
497 }
498 }
499
500 </main>
501
502 @if (renderAsResponsive || !renderMobile)
503 {
504 <footer class="page-footer@(responsiveClassDesktop)" id="page-footer-desktop">
505 @if (@Model.Area.Item.GetLink("FooterDesktop") != null)
506 {
507 @RenderGrid(@Model.Area.Item.GetLink("FooterDesktop").PageId)
508 }
509 </footer>
510 }
511
512 @if (renderAsResponsive || renderMobile)
513 {
514 <footer class="page-footer@(responsiveClassMobile)" id="page-footer-mobile">
515 @if (@Model.Area.Item.GetLink("FooterMobile") != null)
516 {
517 @RenderGrid(@Model.Area.Item.GetLink("FooterMobile").PageId)
518 }
519 </footer>
520 }
521
522 @* Render any offcanvas menu here *@
523 @RenderSnippet("offcanvas")
524
525 @{
526 bool isErpConnectionDown = !Dynamicweb.Core.Converter.ToBoolean(Context.Current.Items["IsWebServiceConnectionAvailable"]);
527 }
528
529 @* Language selector modal *@
530 @if (languages.Count > 1 || ecomCountries.Count > 1 || ecomCurrencies.Count() > 1)
531 {
532 <div class="modal fade" id="PreferencesModal" tabindex="-1" aria-hidden="true">
533 <div class="modal-dialog modal-dialog-centered modal-sm" id="PreferencesModalContent">
534 @* The content here comes from an external request *@
535 </div>
536 </div>
537 }
538
539 @* Favorite toast *@
540 <div aria-live="polite" aria-atomic="true">
541 <div class="position-fixed bottom-0 end-0 p-3" style="z-index: 11">
542 <div id="favoriteNotificationToast" class="toast" role="alert" aria-live="assertive" aria-atomic="true">
543 <div class="toast-header">
544 <strong class="me-auto">@Translate("Favorite list updated")</strong>
545 <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
546 </div>
547 <div class="toast-body d-flex gap-3">
548 <div id="favoriteNotificationToast_Image"></div>
549 <div id="favoriteNotificationToast_Text"></div>
550 </div>
551 </div>
552 </div>
553 </div>
554
555 @* Modal for dynamic content *@
556 <div class="modal fade js-product" id="DynamicModal" tabindex="-1" aria-hidden="true">
557 <div class="modal-dialog modal-dialog-centered modal-md">
558 <div class="modal-content theme light" id="DynamicModalContent">
559 @* The content here comes from an external request *@
560 </div>
561 </div>
562 </div>
563
564 @* Offcanvas for dynamic content *@
565 <div class="offcanvas offcanvas-end theme light" tabindex="-1" id="DynamicOffcanvas" style="width: 30rem">
566 @* The content here comes from an external request *@
567 </div>
568
569 @if (isErpConnectionDown && Model.Area.Item.GetBoolean("ShowErpDownMessage"))
570 {
571 string erpDownMessageTheme = !string.IsNullOrWhiteSpace(Model.Area.Item.GetRawValueString("ErpDownMessageTheme")) ? " theme " + Model.Area.Item.GetRawValueString("ErpDownMessageTheme").Replace(" ", "").Trim().ToLower() : "theme light";
572
573 <div class="position-fixed bottom-0 end-0 p-3" style="z-index: 1040">
574 <div class="toast fade show border-0 @erpDownMessageTheme" role="alert" aria-live="assertive" aria-atomic="true">
575 <div class="toast-header">
576 <strong class="me-auto">@Translate("Connection down")</strong>
577 <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
578 </div>
579 <div class="toast-body">
580 @Translate("We are experiencing some connectivity issues. Not all features may be available to you.")
581 </div>
582 </div>
583 </div>
584 }
585
586 </body>
587 </html>
588 @functions {
589 void SetMetaTags()
590 {
591 //Verification Tokens
592 string siteVerificationGoogle = Model.Area.Item.GetString("Google_Site_Verification") != null ? Model.Area.Item.GetString("Google_Site_Verification") : "";
593 //string siteVerificationYandex = Model.Area.Item.GetString("Yandex_Verification") != null ? Model.Area.Item.GetString("Yandex_Verification") : "";
594 //string siteVerificationMS = Model.Area.Item.GetString("Msvalidate_01") != null ? Model.Area.Item.GetString("Msvalidate_01") : "";
595 //string siteVerificationAlexa = Model.Area.Item.GetString("AlexaVerifyID") != null ? Model.Area.Item.GetString("AlexaVerifyID") : "";
596 //string siteVerificationPinterest = Model.Area.Item.GetString("P_domain_verify") != null ? Model.Area.Item.GetString("P_domain_verify") : "";
597 //string siteVerificationNorton = Model.Area.Item.GetString("Norton_safeweb_site_verification") != null ? Model.Area.Item.GetString("Norton_safeweb_site_verification") : "";
598
599 //Generic Site Values
600 string openGraphFacebookAppID = Model.Area.Item.GetString("Fb_app_id") != null ? Model.Area.Item.GetString("Fb_app_id") : "";
601 string openGraphType = Model.Area.Item.GetString("Open_Graph_Type") != null ? Model.Area.Item.GetString("Open_Graph_Type") : "";
602 string openGraphSiteName = Model.Area.Item.GetString("Open_Graph_Site_Name") != null ? Model.Area.Item.GetString("Open_Graph_Site_Name") : "";
603
604 string twitterCardSite = Model.Area.Item.GetString("Twitter_Site") != null ? Model.Area.Item.GetString("Twitter_Site") : "";
605
606 //Page specific values
607 string openGraphSiteTitle = Model.Area.Item.GetString("Open_Graph_Title") != null ? Model.Area.Item.GetString("Open_Graph_Title") : "";
608 FileViewModel openGraphImage = Model.Area.Item.GetFile("Open_Graph_Image");
609 string openGraphImageALT = Model.Area.Item.GetString("Open_Graph_Image_ALT") != null ? Model.Area.Item.GetString("Open_Graph_Image_ALT") : "";
610 string openGraphDescription = Model.Area.Item.GetString("Open_Graph_Description") != null ? Model.Area.Item.GetString("Open_Graph_Description") : "";
611
612 string twitterCardURL = Model.Area.Item.GetString("Twitter_URL") != null ? Model.Area.Item.GetString("Twitter_URL") : "";
613 string twitterCardTitle = Model.Area.Item.GetString("Twitter_Title") != null ? Model.Area.Item.GetString("Twitter_Title") : "";
614 string twitterCardDescription = Model.Area.Item.GetString("Twitter_Description") != null ? Model.Area.Item.GetString("Twitter_Description") : "";
615 FileViewModel twitterCardImage = Model.Area.Item.GetFile("Twitter_Image");
616 string twitterCardImageALT = Model.Area.Item.GetString("Twitter_Image_ALT") != null ? Model.Area.Item.GetString("Twitter_Image_ALT") : "";
617
618 if (string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString["ProductID"]))
619 {
620 if (!string.IsNullOrEmpty(Model.Description))
621 {
622 Pageview.Meta.AddTag($"<meta property=\"og:description\" content=\"{Model.Description}\" />");
623 }
624 else
625 {
626 Pageview.Meta.AddTag($"<meta property=\"og:description\" content=\"{openGraphDescription}\" />");
627 }
628
629 if (!string.IsNullOrEmpty(Pageview.Page.TopImage))
630 {
631 Pageview.Meta.AddTag($"<meta property=\"og:image\" content=\"{Dynamicweb.Context.Current.Request.Url.Scheme}://{Dynamicweb.Context.Current.Request.Url.Host}/Files{Pageview.Page.TopImage}\" />");
632 Pageview.Meta.AddTag($"<meta property=\"og:image:secure_url\" content=\"{Dynamicweb.Context.Current.Request.Url.Scheme}://{Dynamicweb.Context.Current.Request.Url.Host}/Files{Pageview.Page.TopImage}\" />");
633 }
634 else if (openGraphImage != null)
635 {
636 Pageview.Meta.AddTag($"<meta property=\"og:image\" content=\"{Dynamicweb.Context.Current.Request.Url.Scheme}://{Dynamicweb.Context.Current.Request.Url.Host}{openGraphImage.Path}\" />");
637 Pageview.Meta.AddTag($"<meta property=\"og:image:secure_url\" content=\"{Dynamicweb.Context.Current.Request.Url.Scheme}://{Dynamicweb.Context.Current.Request.Url.Host}{openGraphImage.Path}\" />");
638 }
639
640 if (!string.IsNullOrEmpty(openGraphImageALT))
641 {
642 Pageview.Meta.AddTag($"<meta property=\"og:image:alt\" content=\"{openGraphImageALT}\" />");
643 }
644 if (!string.IsNullOrEmpty(twitterCardDescription))
645 {
646 Pageview.Meta.AddTag("twitter:description", twitterCardDescription);
647 }
648
649 if (!string.IsNullOrEmpty(Pageview.Page.TopImage))
650 {
651 Pageview.Meta.AddTag("twitter:image", $"{Dynamicweb.Context.Current.Request.Url.Scheme}://{Dynamicweb.Context.Current.Request.Url.Host}/Files{Pageview.Page.TopImage}");
652 }
653 else if (twitterCardImage != null)
654 {
655 Pageview.Meta.AddTag("twitter:image", $"{Dynamicweb.Context.Current.Request.Url.Scheme}://{Dynamicweb.Context.Current.Request.Url.Host}{openGraphImage.Path}");
656 }
657
658 if (!string.IsNullOrEmpty(twitterCardImageALT))
659 {
660 Pageview.Meta.AddTag("twitter:image:alt", twitterCardImageALT);
661 }
662 }
663
664 if (!string.IsNullOrEmpty(siteVerificationGoogle))
665 {
666 Pageview.Meta.AddTag("google-site-verification", siteVerificationGoogle);
667 }
668
669 if (!string.IsNullOrEmpty(openGraphFacebookAppID))
670 {
671 Pageview.Meta.AddTag($"<meta property=\"fb:app_id\" content=\"{openGraphFacebookAppID}\" />");
672 }
673
674 if (!string.IsNullOrEmpty(openGraphType))
675 {
676 Pageview.Meta.AddTag($"<meta property=\"og:type\" content=\"{openGraphType}\" />");
677 }
678
679 if (!string.IsNullOrEmpty(openGraphSiteName))
680 {
681 Pageview.Meta.AddTag($"<meta property=\"og:url\" content=\"{Dynamicweb.Context.Current.Request.Url.Scheme}://{Dynamicweb.Context.Current.Request.Url.Host}{Pageview.SearchFriendlyUrl}\" />");
682 }
683
684 if (!string.IsNullOrEmpty(openGraphSiteName))
685 {
686 Pageview.Meta.AddTag($"<meta property=\"og:site_name\" content=\"{openGraphSiteName}\" />");
687 }
688
689 if (!string.IsNullOrEmpty(Model.Title))
690 {
691 Pageview.Meta.AddTag($"<meta property=\"og:title\" content=\"{Model.Title}\" />");
692 }
693 else
694 {
695 Pageview.Meta.AddTag($"<meta property=\"og:title\" content=\"{openGraphSiteTitle}\" />");
696 }
697
698 if (!string.IsNullOrEmpty(twitterCardSite))
699 {
700 Pageview.Meta.AddTag("twitter:site", twitterCardSite);
701 }
702
703 if (!string.IsNullOrEmpty(twitterCardURL))
704 {
705 Pageview.Meta.AddTag("twitter:url", twitterCardURL);
706 }
707
708 if (!string.IsNullOrEmpty(twitterCardTitle))
709 {
710 Pageview.Meta.AddTag("twitter:title", twitterCardTitle);
711 }
712 }
713 }
714 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
715
716 @using System
717 @using Dynamicweb
718 @using Dynamicweb.Environment
719 @using Dynamicweb.Frontend
720 @using System.Web
721 @using System.Web.SessionState
722
723 @{
724 var sessionRegion =(string)Dynamicweb.Context.Current.Session["selectedregion"];
725 var hostNameForRedirect = Dynamicweb.Context.Current.Request.Url.Host.Replace(".hr", ".com");
726 string HostPageLink = @Dynamicweb.Context.Current.Request.Url.Host;
727 }
728
729 <div id="regionSelector" class="changeLocationDiv" style="display: none;">
730 <div class="chooseLangMain">
731 <div>@Translate("Please select your region to proceed"):</div>
732 @if (pageDomain == "hr-hr") {
733 <div class="languages">
734 <div class="firstRowLang langColumn">
735 <p><a href="https://@hostNameForRedirect/eu-en/?CurrencyCode=EUR&region=EU&cartcmd=emptycart" onclick="createCookie2()">Europe (EUR)</a></p>
736 <p><a href="https://@hostNameForRedirect/na-en/?CurrencyCode=USD&region=NA&cartcmd=emptycart" onclick="createCookie2()">US & Canada (USD)</a></p>
737 <p><a href="https://@hostNameForRedirect/ch-en/?CurrencyCode=CNY&region=CH&cartcmd=emptycart" onclick="createCookie2()">China (CNY)</a></p>
738 <p><a href="https://@hostNameForRedirect.Replace(".com", ".hr")/hr-hr/@urlCro?CurrencyCode=EUR&region=HR&cartcmd=emptycart" onclick="createCookie2()">Croatia (Hrvatska) (EUR)</a></p>
739 </div>
740 <div class="secondRowLang langColumn">
741 <p><a href="https://@hostNameForRedirect/jp-en/?CurrencyCode=JPY&region=JP&cartcmd=emptycart" onclick="createCookie2()">Japan (JPY)</a></p>
742 <p><a href="https://@hostNameForRedirect/sa-en/?CurrencyCode=USD&region=LA&cartcmd=emptycart" onclick="createCookie2()">Latin America (USD)</a></p>
743 <p style="display:none;"><a href="https://@hostNameForRedirect/uk-en/?CurrencyCode=GBP&region=GB&cartcmd=emptycart" onclick="createCookie2()">United Kingdom (GBP)</a></p>
744 <p style="display:none;"><a href="https://@hostNameForRedirect/au-en/?CurrencyCode=AUD&region=AU&cartcmd=emptycart" onclick="createCookie2()">Australia (AUD)</a></p>
745 <p><a href="https://@hostNameForRedirect/in-en/?CurrencyCode=USD&region=IN&cartcmd=emptycart" onclick="createCookie2()">All Other Countries (USD)</a></p>
746 </div>
747 </div>
748 } else if (pageDomain == "b2ball-hr") {
749 <div class="languages">
750 <div class="firstRowLang langColumn">
751 <p><a href="https://@hostNameForRedirect/eu-en/?CurrencyCode=EUR&region=EU&cartcmd=emptycart" onclick="createCookie2()">Europe (EUR)</a></p>
752 <p><a href="https://@hostNameForRedirect/na-en/?CurrencyCode=USD&region=NA&cartcmd=emptycart" onclick="createCookie2()">US & Canada (USD)</a></p>
753 <p><a href="https://@hostNameForRedirect/ch-en/?CurrencyCode=CNY&region=CH&cartcmd=emptycart" onclick="createCookie2()">China (CNY)</a></p>
754 <p><a href="https://@hostNameForRedirect.Replace(".com", ".hr")/b2ball-hr/@urlCro?CurrencyCode=EUR&region=HR&cartcmd=emptycart" onclick="createCookie2()">Croatia (Hrvatska) (EUR)</a></p>
755 </div>
756 <div class="secondRowLang langColumn">
757 <p><a href="https://@hostNameForRedirect/jp-en/?CurrencyCode=JPY&region=JP&cartcmd=emptycart" onclick="createCookie2()">Japan (JPY)</a></p>
758 <p><a href="https://@hostNameForRedirect/sa-en/?CurrencyCode=USD&region=LA&cartcmd=emptycart" onclick="createCookie2()">Latin America (USD)</a></p>
759 <p style="display:none;"><a href="https://@hostNameForRedirect/uk-en/?CurrencyCode=GBP&region=GB&cartcmd=emptycart" onclick="createCookie2()">United Kingdom (GBP)</a></p>
760 <p style="display:none;"><a href="https://@hostNameForRedirect/au-en/?CurrencyCode=AUD&region=AU&cartcmd=emptycart" onclick="createCookie2()">Australia (AUD)</a></p>
761 <p><a href="https://@hostNameForRedirect/in-en/?CurrencyCode=USD&region=IN&cartcmd=emptycart" onclick="createCookie2()">All Other Countries (USD)</a></p>
762 </div>
763 </div>
764 } else if (pageDomain == "b2b-hr") {
765 <div class="languages">
766 <div class="firstRowLang langColumn">
767 <p><a href="https://@hostNameForRedirect/eu-en/?CurrencyCode=EUR&region=EU&cartcmd=emptycart" onclick="createCookie2()">Europe (EUR)</a></p>
768 <p><a href="https://@hostNameForRedirect/na-en/?CurrencyCode=USD&region=NA&cartcmd=emptycart" onclick="createCookie2()">US & Canada (USD)</a></p>
769 <p><a href="https://@hostNameForRedirect/ch-en/?CurrencyCode=CNY&region=CH&cartcmd=emptycart" onclick="createCookie2()">China (CNY)</a></p>
770 <p><a href="https://@hostNameForRedirect.Replace(".com", ".hr")/b2b-hr/@urlCro?CurrencyCode=EUR&region=HR&cartcmd=emptycart" onclick="createCookie2()">Croatia (Hrvatska) (EUR)</a></p>
771 </div>
772 <div class="secondRowLang langColumn">
773 <p><a href="https://@hostNameForRedirect/jp-en/?CurrencyCode=JPY&region=JP&cartcmd=emptycart" onclick="createCookie2()">Japan (JPY)</a></p>
774 <p><a href="https://@hostNameForRedirect/sa-en/?CurrencyCode=USD&region=LA&cartcmd=emptycart" onclick="createCookie2()">Latin America (USD)</a></p>
775 <p style="display:none;"><a href="https://@hostNameForRedirect/uk-en/?CurrencyCode=GBP&region=GB&cartcmd=emptycart" onclick="createCookie2()">United Kingdom (GBP)</a></p>
776 <p style="display:none;"><a href="https://@hostNameForRedirect/au-en/?CurrencyCode=AUD&region=AU&cartcmd=emptycart" onclick="createCookie2()">Australia (AUD)</a></p>
777 <p><a href="https://@hostNameForRedirect/in-en/?CurrencyCode=USD&region=IN&cartcmd=emptycart" onclick="createCookie2()">All Other Countries (USD)</a></p>
778 </div>
779 </div>
780 } else if (pageDomain == "b2i-hr") {
781 <div class="languages">
782 <div class="firstRowLang langColumn">
783 <p><a href="https://@hostNameForRedirect/eu-en/?CurrencyCode=EUR&region=EU&cartcmd=emptycart" onclick="createCookie2()">Europe (EUR)</a></p>
784 <p><a href="https://@hostNameForRedirect/na-en/?CurrencyCode=USD&region=NA&cartcmd=emptycart" onclick="createCookie2()">US & Canada (USD)</a></p>
785 <p><a href="https://@hostNameForRedirect/ch-en/?CurrencyCode=CNY&region=CH&cartcmd=emptycart" onclick="createCookie2()">China (CNY)</a></p>
786 <p><a href="https://@hostNameForRedirect.Replace(".com", ".hr")/b2i-hr/@urlCro?CurrencyCode=EUR&region=HR&cartcmd=emptycart" onclick="createCookie2()">Croatia (Hrvatska) (EUR)</a></p>
787 </div>
788 <div class="secondRowLang langColumn">
789 <p><a href="https://@hostNameForRedirect/jp-en/?CurrencyCode=JPY&region=JP&cartcmd=emptycart" onclick="createCookie2()">Japan (JPY)</a></p>
790 <p><a href="https://@hostNameForRedirect/sa-en/?CurrencyCode=USD&region=LA&cartcmd=emptycart" onclick="createCookie2()">Latin America (USD)</a></p>
791 <p style="display:none;"><a href="https://@hostNameForRedirect/uk-en/?CurrencyCode=GBP&region=GB&cartcmd=emptycart" onclick="createCookie2()">United Kingdom (GBP)</a></p>
792 <p style="display:none;"><a href="https://@hostNameForRedirect/au-en/?CurrencyCode=AUD&region=AU&cartcmd=emptycart" onclick="createCookie2()">Australia (AUD)</a></p>
793 <p><a href="https://@hostNameForRedirect/in-en/?CurrencyCode=USD&region=IN&cartcmd=emptycart" onclick="createCookie2()">All Other Countries (USD)</a></p>
794 </div>
795 </div>
796 } else {
797 <div class="languages">
798 <div class="firstRowLang langColumn">
799 <p><a href="https://@hostNameForRedirect/eu-en/@urlEng?CurrencyCode=EUR&region=EU&cartcmd=emptycart" onclick="createCookie2()">Europe (EUR)</a></p>
800 <p><a href="https://@hostNameForRedirect/na-en/@urlEng?CurrencyCode=USD&region=NA&cartcmd=emptycart" onclick="createCookie2()">US & Canada (USD)</a></p>
801 <p><a href="https://@hostNameForRedirect/ch-en/@urlEng?CurrencyCode=CNY&region=CH&cartcmd=emptycart" onclick="createCookie2()">China (CNY)</a></p>
802 <p><a href="https://@hostNameForRedirect.Replace(".com", ".hr")/hr-hr?CurrencyCode=EUR&region=HR&cartcmd=emptycart" onclick="createCookie2()">Croatia (Hrvatska) (EUR)</a></p>
803 </div>
804 <div class="secondRowLang langColumn">
805 <p><a href="https://@hostNameForRedirect/jp-en/@urlEng?CurrencyCode=JPY&region=JP&cartcmd=emptycart" onclick="createCookie2()">Japan (JPY)</a></p>
806 <p><a href="https://@hostNameForRedirect/sa-en/@urlEng?CurrencyCode=USD&region=LA&cartcmd=emptycart" onclick="createCookie2()">Latin America (USD)</a></p>
807 <p style="display:none;"><a href="https://@hostNameForRedirect/uk-en/@urlEng?CurrencyCode=GBP&region=GB&cartcmd=emptycart" onclick="createCookie2()">United Kingdom (GBP)</a></p>
808 <p style="display:none;"><a href="https://@hostNameForRedirect/au-en/@urlEng?CurrencyCode=AUD&region=AU&cartcmd=emptycart" onclick="createCookie2()">Australia (AUD)</a></p>
809 <p><a href="https://@hostNameForRedirect/in-en/@urlEng?CurrencyCode=USD&region=IN&cartcmd=emptycart" onclick="createCookie2()">All Other Countries (USD)</a></p>
810 </div>
811 </div>
812 }
813 </div>
814 <div id="toggleregionSelector" class="u-pull--right" style="position: absolute;right: 10px;top: 0;" onclick="document.getElementById('regionSelector').style.display = 'none';">
815 <img class="grid--external-bleed-y" src="/Files/Images/icons8-multiply-50.png" width="24" height="24" alt="Multiply icon" style="float: right;cursor: pointer;">
816 </div>
817 </div>
818
819
820
821
822 <div id="warningModal" class="" style="display:none">
823 <div class="">
824 <h2>@Translate("Changing language")</h2>
825 </div>
826 <div class="">
827 <p class="u-no-margin" id="">@Translate("You are changing language. If you continue, basket will be cleared. Do you wish to continue?")</p>
828 <div class="product-list__grid-item__footer dw-mod" style="border:0;">
829 <label id="backToPage" class="btn u-margin-left--lg btn--secondary btn--condensed u-no-margin u-pull--right dw-mod">@Translate("No")</label>
830 <button class="btn btn--primary btn--condensed u-no-margin u-pull--right dw-mod" onclick="" id="ChangeLanguageButton">@Translate("Yes")</button>
831 </div>
832 </div>
833 </div>
834
835 <style>
836 .regionSelectorShow {
837 diplay: flex !important
838 }
839 </style>
840
841 <script>
842
843 function setCookie(cname, cvalue, exdays) {
844 const d = new Date();
845 d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
846 let expires = "expires=" + d.toUTCString();
847 document.cookie = cname + "=" + cvalue + ";" + expires;
848 }
849
850 function getCookie(cname) {
851 let name = cname + "=";
852 let decodedCookie = decodeURIComponent(document.cookie);
853 let ca = decodedCookie.split(';');
854 for (let i = 0; i < ca.length; i++) {
855 let c = ca[i];
856 while (c.charAt(0) == ' ') {
857 c = c.substring(1);
858 }
859 if (c.indexOf(name) == 0) {
860 return c.substring(name.length, c.length);
861 }
862 }
863 return "";
864 }
865 </script>
866
867
868 <style type="text/css">
869 .FormButton {
870 position: absolute;
871 top: 10%;
872 right: 20px;
873 border-radius: 48%;
874 color: red;
875 background-color: white;
876 width: 30px;
877 height: 30px;
878 }
879
880 .FormMain {
881 height: auto;
882 display: flex;
883 align-items: flex-start;
884 justify-content: center;
885 flex-direction: column;
886 font-family: "Montserrat";
887 font-size: 1.2em;
888 color: black;
889 font-weight: 500;
890 }
891
892 .FormCookie {
893 position: fixed;
894 left: 0;
895 top: 10%;
896 right: 0;
897 margin: auto;
898 display: flex;
899 width: 100vw;
900 height: auto;
901 justify-content: center;
902 align-items: center;
903 z-index: 90;
904 max-width: 500px;
905 padding: 20px;
906 }
907
908 .FormShow {
909 display: flex !important
910 }
911 </style>
912
913 <div class="FormCookie" id="FormCookie" style="display:none">
914 <div class="FormMain">
915 <div id="regionSelector" class="changeLocationDiv">
916 <div class="chooseLangMain">
917 <div>@Translate("Please select your region to proceed"):</div>
918 @if (pageDomain == "hr-hr") {
919 <div class="languages">
920 <div class="firstRowLang langColumn">
921 <p><a href="https://@hostNameForRedirect/eu-en/?CurrencyCode=EUR&region=EU&cartcmd=emptycart">Europe (EUR)</a></p>
922 <p><a href="https://@hostNameForRedirect/na-en/?CurrencyCode=USD&region=NA&cartcmd=emptycart">US & Canada (USD)</a></p>
923 <p><a href="https://@hostNameForRedirect/ch-en/?CurrencyCode=CNY&region=CH&cartcmd=emptycart">China (CNY)</a></p>
924 <p><a href="https://@hostNameForRedirect.Replace(".com", ".hr")/hr-hr/@urlCro?CurrencyCode=EUR&region=HR&cartcmd=emptycart">Croatia (Hrvatska) (EUR)</a></p>
925 </div>
926 <div class="secondRowLang langColumn">
927 <p><a href="https://@hostNameForRedirect/jp-en/?CurrencyCode=JPY&region=JP&cartcmd=emptycart">Japan (JPY)</a></p>
928 <p><a href="https://@hostNameForRedirect/sa-en/?CurrencyCode=USD&region=LA&cartcmd=emptycart">Latin America (USD)</a></p>
929 <p style="display:none;"><a href="https://@hostNameForRedirect/uk-en/?CurrencyCode=GBP&region=GB&cartcmd=emptycart">United Kingdom (GBP)</a></p>
930 <p style="display:none;"><a href="https://@hostNameForRedirect/au-en/?CurrencyCode=AUD&region=AU&cartcmd=emptycart">Australia (AUD)</a></p>
931 <p><a href="https://@hostNameForRedirect/in-en/?CurrencyCode=USD&region=IN&cartcmd=emptycart">All Other Countries (USD)</a></p>
932 </div>
933 </div>
934 } else if (pageDomain == "b2ball-hr") {
935 <div class="languages">
936 <div class="firstRowLang langColumn">
937 <p><a href="https://@hostNameForRedirect/eu-en/?CurrencyCode=EUR&region=EU&cartcmd=emptycart">Europe (EUR)</a></p>
938 <p><a href="https://@hostNameForRedirect/na-en/?CurrencyCode=USD&region=NA&cartcmd=emptycart">US & Canada (USD)</a></p>
939 <p><a href="https://@hostNameForRedirect/ch-en/?CurrencyCode=CNY&region=CH&cartcmd=emptycart">China (CNY)</a></p>
940 <p><a href="https://@hostNameForRedirect.Replace(".com", ".hr")/b2ball-hr/@urlCro?CurrencyCode=EUR&region=HR&cartcmd=emptycart">Croatia (Hrvatska) (EUR)</a></p>
941 </div>
942 <div class="secondRowLang langColumn">
943 <p><a href="https://@hostNameForRedirect/jp-en/?CurrencyCode=JPY&region=JP&cartcmd=emptycart">Japan (JPY)</a></p>
944 <p><a href="https://@hostNameForRedirect/sa-en/?CurrencyCode=USD&region=LA&cartcmd=emptycart">Latin America (USD)</a></p>
945 <p style="display:none;"><a href="https://@hostNameForRedirect/uk-en/?CurrencyCode=GBP&region=GB&cartcmd=emptycart">United Kingdom (GBP)</a></p>
946 <p style="display:none;"><a href="https://@hostNameForRedirect/au-en/?CurrencyCode=AUD&region=AU&cartcmd=emptycart">Australia (AUD)</a></p>
947 <p><a href="https://@hostNameForRedirect/in-en/?CurrencyCode=USD&region=IN&cartcmd=emptycart">All Other Countries (USD)</a></p>
948 </div>
949 </div>
950 } else if (pageDomain == "b2b-hr") {
951 <div class="languages">
952 <div class="firstRowLang langColumn">
953 <p><a href="https://@hostNameForRedirect/eu-en/?CurrencyCode=EUR&region=EU&cartcmd=emptycart">Europe (EUR)</a></p>
954 <p><a href="https://@hostNameForRedirect/na-en/?CurrencyCode=USD&region=NA&cartcmd=emptycart">US & Canada (USD)</a></p>
955 <p><a href="https://@hostNameForRedirect/ch-en/?CurrencyCode=CNY&region=CH&cartcmd=emptycart">China (CNY)</a></p>
956 <p><a href="https://@hostNameForRedirect.Replace(".com", ".hr")/b2b-hr/@urlCro?CurrencyCode=EUR&region=HR&cartcmd=emptycart">Croatia (Hrvatska) (EUR)</a></p>
957 </div>
958 <div class="secondRowLang langColumn">
959 <p><a href="https://@hostNameForRedirect/jp-en/?CurrencyCode=JPY&region=JP&cartcmd=emptycart">Japan (JPY)</a></p>
960 <p><a href="https://@hostNameForRedirect/sa-en/?CurrencyCode=USD&region=LA&cartcmd=emptycart">Latin America (USD)</a></p>
961 <p style="display:none;"><a href="https://@hostNameForRedirect/uk-en/?CurrencyCode=GBP&region=GB&cartcmd=emptycart">United Kingdom (GBP)</a></p>
962 <p style="display:none;"><a href="https://@hostNameForRedirect/au-en/?CurrencyCode=AUD&region=AU&cartcmd=emptycart">Australia (AUD)</a></p>
963 <p><a href="https://@hostNameForRedirect/in-en/?CurrencyCode=USD&region=IN&cartcmd=emptycart">All Other Countries (USD)</a></p>
964 </div>
965 </div>
966 } else if (pageDomain == "b2i-hr") {
967 <div class="languages">
968 <div class="firstRowLang langColumn">
969 <p><a href="https://@hostNameForRedirect/eu-en/?CurrencyCode=EUR&region=EU&cartcmd=emptycart">Europe (EUR)</a></p>
970 <p><a href="https://@hostNameForRedirect/na-en/?CurrencyCode=USD&region=NA&cartcmd=emptycart">US & Canada (USD)</a></p>
971 <p><a href="https://@hostNameForRedirect/ch-en/?CurrencyCode=CNY&region=CH&cartcmd=emptycart">China (CNY)</a></p>
972 <p><a href="https://@hostNameForRedirect.Replace(".com", ".hr")/b2i-hr/@urlCro?CurrencyCode=EUR&region=HR&cartcmd=emptycart">Croatia (Hrvatska) (EUR)</a></p>
973 </div>
974 <div class="secondRowLang langColumn">
975 <p><a href="https://@hostNameForRedirect/jp-en/?CurrencyCode=JPY&region=JP&cartcmd=emptycart">Japan (JPY)</a></p>
976 <p><a href="https://@hostNameForRedirect/sa-en/?CurrencyCode=USD&region=LA&cartcmd=emptycart">Latin America (USD)</a></p>
977 <p style="display:none;"><a href="https://@hostNameForRedirect/uk-en/?CurrencyCode=GBP&region=GB&cartcmd=emptycart">United Kingdom (GBP)</a></p>
978 <p style="display:none;"><a href="https://@hostNameForRedirect/au-en/?CurrencyCode=AUD&region=AU&cartcmd=emptycart">Australia (AUD)</a></p>
979 <p><a href="https://@hostNameForRedirect/in-en/?CurrencyCode=USD&region=IN&cartcmd=emptycart">All Other Countries (USD)</a></p>
980 </div>
981 </div>
982 } else {
983 <div class="languages">
984 <div class="firstRowLang langColumn">
985 <p><a href="https://@hostNameForRedirect/eu-en/@urlEng?CurrencyCode=EUR&region=EU&cartcmd=emptycart">Europe (EUR)</a></p>
986 <p><a href="https://@hostNameForRedirect/na-en/@urlEng?CurrencyCode=USD&region=NA&cartcmd=emptycart" >US & Canada (USD)</a></p>
987 <p><a href="https://@hostNameForRedirect/ch-en/@urlEng?CurrencyCode=CNY&region=CH&cartcmd=emptycart">China (CNY)</a></p>
988 <p><a href="https://@hostNameForRedirect.Replace(".com", ".hr")/hr-hr?CurrencyCode=EUR&region=HR&cartcmd=emptycart">Croatia (Hrvatska) (EUR)</a></p>
989 </div>
990 <div class="secondRowLang langColumn">
991 <p><a href="https://@hostNameForRedirect/jp-en/@urlEng?CurrencyCode=JPY&region=JP&cartcmd=emptycart">Japan (JPY)</a></p>
992 <p><a href="https://@hostNameForRedirect/sa-en/@urlEng?CurrencyCode=USD&region=LA&cartcmd=emptycart">Latin America (USD)</a></p>
993 <p style="display:none;"><a href="https://@hostNameForRedirect/uk-en/@urlEng?CurrencyCode=GBP&region=GB&cartcmd=emptycart">United Kingdom (GBP)</a></p>
994 <p style="display:none;"><a href="https://@hostNameForRedirect/au-en/@urlEng?CurrencyCode=AUD&region=AU&cartcmd=emptycart">Australia (AUD)</a></p>
995 <p><a href="https://@hostNameForRedirect/in-en/@urlEng?CurrencyCode=USD&region=IN&cartcmd=emptycart">All Other Countries (USD)</a></p>
996 </div>
997 </div>
998 }
999 </div>
1000 <div id="toggleregionSelector" class="u-pull--right" style="position: absolute; right: 10px;top: 0;" onclick="document.getElementById('regionSelector').style.display = 'none';">
1001 <img class="grid--external-bleed-y" src="/Files/Images/icons8-multiply-50.png" width="24" height="24" alt="Multiply icon" style="float: right;cursor: pointer;">
1002 </div>
1003 </div>
1004 </div>
1005 </div>
1006
1007
1008 <script>
1009
1010 function setCookie(cname, cvalue, exdays) {
1011 const d = new Date();
1012 d.setTime(d.getTime() + (d * 24 * 60 * 60 * 1000));
1013 let expires = "expires=" + d.toUTCString();
1014 document.cookie = cname + "=" + cvalue + ";" + expires;
1015 }
1016
1017 function getCookie(cname) {
1018 let name = cname + "=";
1019 let decodedCookie = decodeURIComponent(document.cookie);
1020 let ca = decodedCookie.split(';');
1021 for (let i = 0; i < ca.length; i++) {
1022 let c = ca[i];
1023 while (c.charAt(0) == ' ') {
1024 c = c.substring(1);
1025 }
1026 if (c.indexOf(name) == 0) {
1027 return c.substring(name.length, c.length);
1028 }
1029 }
1030 return "";
1031 }
1032 </script>
1033