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