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