Error executing template "Designs/ProNails_generated/_parsed/Workshop.parsed.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_2257b114ff564c70b854de10977f2e58.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\pronails.cloud.dynamicweb-cms.com\files\Templates\Designs\ProNails_generated\_parsed\Workshop.parsed.cshtml:line 1033
   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 3 @using System; 4 @using System.Web; 5 @using System.Linq; 6 @using System.Data; 7 @using System.Data.SqlClient; 8 @using System.Globalization; 9 @using System.Reflection; 10 11 @using Dynamicweb; 12 @using Dynamicweb.Content.Items; 13 @using Dynamicweb.Environment; 14 @using Dynamicweb.Frontend; 15 @using Dynamicweb.Frontend.Navigation; 16 17 @using Bluedesk.DynamicWeb.ItemTypes; 18 @using Bluedesk.DynamicWeb.ItemTypes.Settings; 19 @using Bluedesk.DynamicWeb.ItemTypes.Configuration; 20 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 21 22 @using Bluedesk.Tools.Generic; 23 @using Bluedesk.Tools.DynamicWeb.DataAccess; 24 25 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend; 26 @using ProNails.ItemTypes; 27 28 29 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 30 31 @using System; 32 @using System.Web; 33 @using System.Linq; 34 @using System.Globalization; 35 36 @using Dynamicweb; 37 @using Dynamicweb.Content.Items; 38 @using Dynamicweb.Environment; 39 @using Dynamicweb.Frontend; 40 @using Dynamicweb.Frontend.Navigation; 41 42 @using Bluedesk.Tools.Generic; 43 44 @using Bluedesk.DynamicWeb.ItemTypes; 45 @using Bluedesk.DynamicWeb.ItemTypes.Settings; 46 @using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration; 47 48 @using Bluedesk.DynamicWeb.ItemTypes.Configuration; 49 50 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 51 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend; 52 53 @{ 54 55 var master_configuration = Dynamicweb.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "MasterConfiguration"); 56 MasterConfig mc = master_configuration.Item.ToCodeFirstItem<MasterConfig>(); 57 58 bool HideStandardFooter = mc.FooterConfiguration.HideStandardFooter.ToString() == "True" ? true : false; 59 60 string MasterConfigCssClass = !string.IsNullOrWhiteSpace(mc.CssClass) ? mc.CssClass : ""; 61 62 // GeneralConfig GeneralConfiguration = mc.GeneralConfiguration; 63 EcomConfig EcommerceConfiguration = mc.EcomConfiguration; 64 65 bool WithVATBool = Pageview.Area.EcomPricesWithVat == "True"; 66 bool pricesWithoutVatForUsers = EcommerceConfiguration.ShowPricesWithoutVatForUsers; 67 bool pricesWithoutVatForValidVat = EcommerceConfiguration.ShowPricesWithoutVatWhenValidVatNumber; 68 if(pricesWithoutVatForUsers && !pricesWithoutVatForValidVat && Pageview.User != null) { 69 WithVATBool = false; 70 } 71 if(pricesWithoutVatForValidVat && Pageview.User != null && !string.IsNullOrWhiteSpace(Pageview.User.VatRegNumber)) { 72 WithVATBool = false; 73 } 74 string ecomShowPricesWithVat = WithVATBool.ToString().ToLower(); 75 string ecomPricesFormatted = (EcommerceConfiguration.FormattedPrices).ToString().ToLower(); 76 77 bool IsNotContentManager = false; 78 bool isVisualEditor = Pageview.IsVisualEditorMode; 79 80 if (isVisualEditor) 81 { 82 System.Web.HttpContext.Current.Session["PreviousPage"] = Pageview.Page.ID; 83 IsNotContentManager = (Dynamicweb.Security.UserManagement.User.GetCurrentBackendUser()?.Groups?.All(g => g.Name != "Content managers") ?? true); 84 } 85 86 BaseSettingsObj BaseSettings = new BaseSettingsObj(); 87 88 BaseSettings = BaseSettingServices.RenderBaseSettings(Pageview); 89 HttpContext.Current.Session["BaseSettings"] = BaseSettings; 90 91 //if (HttpContext.Current.Session["BaseSettings"] == null) 92 //{ 93 94 //} 95 //else 96 //{ 97 // BaseSettings = (BaseSettingsObj)HttpContext.Current.Session["BaseSettings"]; 98 // if (BaseSettings.AreaID != Pageview.AreaID) 99 // { 100 // BaseSettings = BaseSettingServices.RenderBaseSettings(Pageview); 101 // HttpContext.Current.Session["BaseSettings"] = BaseSettings; 102 // } 103 //} 104 105 BaseSettingsBrandConfiguration BaseSettingsBrandConfiguration = BaseSettings.BrandConfiguration; 106 BaseSettingsButtons BaseSettingsButtons = BaseSettingsBrandConfiguration.Buttons; 107 108 var font_configuration = Dynamicweb.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "FontConfiguration"); 109 110 var httpdomain = Dynamicweb.Environment.Helpers.LinkHelper.GetHttpDomain(); 111 var lang = Pageview.Area.CultureInfo.TwoLetterISOLanguageName; 112 var langName = Pageview.Area.Culture; 113 114 var csrftoken = application._webapi.Helper.CSRFHelper.TokenHeaderValue(); 115 var designRoot = BaseSettings.DesignRoot; 116 117 var phonenumber = BaseSettings.CorporateSettings.Phonenumber; 118 var formattedPhonenumber = phonenumber.Replace(" ", String.Empty); 119 var emailadress = BaseSettings.CorporateSettings.Emailadress; 120 var buttonIconClass = Pageview.Area.Item["Global_button_icon"] != null ? Pageview.Area.Item["Global_button_icon"].ToString().Replace("+", " ") : "fal fa-arrow-right"; 121 var callmebackformlink = BaseSettings.BrandConfiguration.CallMeBackForm; 122 var mobileThemeColor = BaseSettings.BrandConfiguration.MobileThemeColor; 123 124 bool isOffline = false; 125 126 DateTime workingHoursStart = BaseSettings.CorporateSettings.OpeningTime; 127 DateTime workingHoursEnd = BaseSettings.CorporateSettings.ClosingTime; 128 DateTime today = DateTime.Now; 129 var cHour = DateTime.Now.TimeOfDay; 130 int cDay = (int)DateTime.Now.DayOfWeek; 131 string availableToHour24hFormat = workingHoursEnd.TimeOfDay.ToString().Substring(0, 5); 132 var timeFromInput = DateTime.ParseExact(availableToHour24hFormat, "H:m", null, DateTimeStyles.None); 133 string availableToHour12hFormat = timeFromInput.ToString("hh:mm tt", CultureInfo.InvariantCulture); 134 var availableToHour = lang == "en" ? availableToHour12hFormat : availableToHour24hFormat; 135 bool isOvertime = cHour >= workingHoursEnd.TimeOfDay || cHour <= workingHoursStart.TimeOfDay; 136 bool isNoValidDate = today < workingHoursStart || today > workingHoursEnd; 137 if (isNoValidDate || isOvertime) 138 { 139 isOffline = true; 140 } 141 142 Boolean showBreadcrumbs = Pageview.Page.PropertyItem != null && Pageview.Page.PropertyItem["ShowBreadcrumbs"] != null ? Convert.ToBoolean(Pageview.Page.PropertyItem["ShowBreadcrumbs"]) : false; 143 144 var appcss = Cache.VersionedFile(designRoot + "/dist/app.css"); 145 146 var favicon32 = Cache.VersionedFile(designRoot + "/assets/img/favicon-32.png", true); 147 var favicon16 = Cache.VersionedFile(designRoot + "/assets/img/favicon-16.png", true); 148 var favicon = Cache.VersionedFile(designRoot + "/assets/img/favicon.ico", true); 149 150 favicon = !string.IsNullOrWhiteSpace(BaseSettings.BrandConfiguration.Favicons.Favicon) ? BaseSettings.BrandConfiguration.Favicons.Favicon : favicon; 151 favicon16 = !string.IsNullOrWhiteSpace(BaseSettings.BrandConfiguration.Favicons.Favicon16) ? BaseSettings.BrandConfiguration.Favicons.Favicon16 : favicon16; 152 favicon32 = !string.IsNullOrWhiteSpace(BaseSettings.BrandConfiguration.Favicons.Favicon32) ? BaseSettings.BrandConfiguration.Favicons.Favicon32 : favicon32; 153 154 var appbundlejs = Cache.VersionedFile(designRoot + "/dist/app.bundle.js"); 155 var appAsyncbundlejs = Cache.VersionedFile(designRoot + "/dist/appAsync.bundle.js"); 156 var vuebundlejs = Cache.VersionedFile(designRoot + "/dist/vue.bundle.js"); 157 158 } 159 160 161 @{ 162 // Workshop page added variables 163 var pnColorService = new ColorSwatchService(); 164 Workshop _workshop = ItemManager.Storage.GetById<Workshop>(Pageview.Page.ItemId ?? "0"); 165 ButtonConfiguration _button = ItemManager.Storage.GetById<ButtonConfiguration>(_workshop.ButtonConfigurationID ?? "0"); 166 } 167 168 <!DOCTYPE html> 169 <html lang="@lang" prefix="og: http://ogp.me/ns#"> 170 <head> 171 <meta charset="utf-8"> 172 <meta http-equiv="X-UA-Compatible" content="IE=edge"> 173 <meta name="viewport" content="width=device-width, initial-scale=1"> 174 <meta name="theme-color" content="@mobileThemeColor"> 175 @Model.MetaTags 176 <title>@Model.Title</title> 177 178 @RenderSnippet("canonical") 179 @RenderSnippet("ogTags") 180 181 @{ 182 string urlProtocol = Dynamicweb.Context.Current.Request.Url.Scheme; 183 List<Dynamicweb.Content.Page> pageTranslations = new List<Dynamicweb.Content.Page>(); 184 bool isMasterPage = Pageview.Area.IsMaster; 185 if (isMasterPage) 186 { 187 pageTranslations.Add(Pageview.Page); 188 if (Pageview.Page.Languages != null) 189 { 190 foreach (var language in Pageview.Page.Languages) 191 { 192 if (language.Active) 193 { 194 pageTranslations.Add(language); 195 } 196 } 197 } 198 } 199 else 200 { 201 pageTranslations.Add(Pageview.Page.MasterPage); 202 if (Pageview.Page.MasterPage != null) 203 { 204 if (Pageview.Page.MasterPage.Languages != null) 205 { 206 foreach (var language in Pageview.Page.MasterPage.Languages) 207 { 208 if (language.Active) 209 { 210 pageTranslations.Add(language); 211 } 212 } 213 } 214 } 215 } 216 foreach (var page in pageTranslations) 217 { 218 if (page != null) 219 { 220 string url = $"Default.aspx?ID={page.ID}"; 221 string groupid = Dynamicweb.Context.Current.Request.QueryString.Get("GroupID"); 222 string productid = Dynamicweb.Context.Current.Request.QueryString.Get("ProductID"); 223 string variantid = Dynamicweb.Context.Current.Request.QueryString.Get("VariantID"); 224 if (!string.IsNullOrWhiteSpace(groupid)) 225 { 226 var groupObj = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(groupid, page.Area.EcomLanguageId); 227 if (groupObj == null) 228 { 229 continue; 230 } 231 url = $"{url}&GroupID={groupid}"; 232 } 233 if (!string.IsNullOrWhiteSpace(productid)) 234 { 235 var productObj = Dynamicweb.Ecommerce.Services.Products.GetProductById(productid, variantid, page.Area.EcomLanguageId);; 236 if (productObj == null) 237 { 238 continue; 239 } 240 url = $"{url}&ProductID={productid}"; 241 if (!string.IsNullOrWhiteSpace(variantid)) 242 { 243 url = $"{url}&VariantID={variantid}"; 244 } 245 } 246 247 string currentdomain = Context.Current.Request.Url.DnsSafeHost; 248 if (!string.IsNullOrEmpty(page.Area.DomainLock)) { 249 currentdomain = page.Area.DomainLock; 250 } 251 string friendlyUrl = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(url); 252 string href = $"{urlProtocol}://{currentdomain}{friendlyUrl}"; 253 string hreflang = page.Area.CultureInfo.Name.ToLower(); 254 <link rel="alternate" href="@href" hreflang="@hreflang" /> 255 } 256 } 257 } 258 259 260 <link rel="preconnect" href="https://fonts.googleapis.com"> 261 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> 262 <link href="@appcss" rel="stylesheet" type="text/css" /> 263 264 @{ 265 if (!string.IsNullOrWhiteSpace(favicon32)) 266 { 267 <link rel="icon" type="image/png" sizes="32x32" href="@favicon32"> 268 } 269 if (!string.IsNullOrWhiteSpace(favicon16)) 270 { 271 <link rel="icon" type="image/png" sizes="16x16" href="@favicon16"> 272 } 273 if (!string.IsNullOrWhiteSpace(favicon)) 274 { 275 <link rel="shortcut icon" href="@favicon"> 276 } 277 } 278 279 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 280 @using System; 281 @using System.Web; 282 @using System.Linq; 283 @using System.Globalization; 284 285 @using Dynamicweb; 286 @using Dynamicweb.Content.Items; 287 @using Dynamicweb.Environment; 288 @using Dynamicweb.Frontend; 289 @using Dynamicweb.Frontend.Navigation; 290 291 @using Bluedesk.Tools.Generic; 292 293 @using Bluedesk.DynamicWeb.ItemTypes; 294 @using Bluedesk.DynamicWeb.ItemTypes.Settings; 295 @using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration; 296 297 @using Bluedesk.DynamicWeb.ItemTypes.Configuration; 298 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 299 @using Bluedesk.DynamicWeb.ItemTypes.Extensions; 300 301 @helper RenderCSSKeyAndValue(string Key, string Value) 302 { 303 if (!string.IsNullOrWhiteSpace(Value)) 304 { 305 <text>@Key : @Value !important;</text> 306 } 307 } 308 309 @helper SetFontCSSVariables(FontConfigurationItemTab FontConfiguration) 310 { 311 312 string Top = FontConfiguration.top != 0 ? FontConfiguration.top.ToString() + "px" : ""; 313 string Left = FontConfiguration.left != 0 ? FontConfiguration.left.ToString() + "px" : ""; 314 string Right = FontConfiguration.right != 0 ? FontConfiguration.right.ToString() + "px" : ""; 315 string Bottom = FontConfiguration.bottom != 0 ? FontConfiguration.bottom.ToString() + "px" : ""; 316 317 string Position = FontConfiguration.PositionAbsolute ? "absolute" : "relative"; 318 319 string Color = FontConfiguration.Color?.GetColorCode(Pageview.AreaID) ?? ""; 320 string BackgroundColor = FontConfiguration.Backgroundcolor?.GetColorCode(Pageview.AreaID) ?? ""; 321 322 string BorderColor = FontConfiguration.BorderColor?.GetColorCode(Pageview.AreaID) ?? ""; 323 string BorderSize = FontConfiguration.BorderSize != 0 ? FontConfiguration.BorderSize.ToString() + "px" : ""; 324 325 <text> 326 327 --Position: @Position; 328 329 @RenderCSSKeyAndValue("--Padding", FontConfiguration.Padding) 330 331 @RenderCSSKeyAndValue("--Top", Top) 332 @RenderCSSKeyAndValue("--Left", Left) 333 @RenderCSSKeyAndValue("--Right", Right) 334 @RenderCSSKeyAndValue("--Bottom", Bottom) 335 336 @RenderCSSKeyAndValue("--Color", Color) 337 @RenderCSSKeyAndValue("--FontSize", FontConfiguration.FontSize) 338 @RenderCSSKeyAndValue("--FontStyle", FontConfiguration.FontStyle) 339 340 @RenderCSSKeyAndValue("--FontWeight", FontConfiguration.FontWeight) 341 @RenderCSSKeyAndValue("--FontFamily", FontConfiguration.FontConfiguration.FontFamily) 342 @RenderCSSKeyAndValue("--LineHeight", FontConfiguration.LineHeight) 343 344 @RenderCSSKeyAndValue("--BackgroundColor", BackgroundColor) 345 @RenderCSSKeyAndValue("--BorderColor", BorderColor) 346 @RenderCSSKeyAndValue("--BorderSize", BorderSize) 347 348 </text> 349 350 } 351 352 353 <script> 354 window.globals = { 355 pageId: '@Pageview.ID', 356 Token: '@csrftoken', 357 DW_AREA_CULTURE: '@langName', 358 DW_AREA_CULTURE_SHORT: '@lang', 359 globalIconClass: '@buttonIconClass', 360 DW_USERID: '@Dynamicweb.Security.UserManagement.User.GetCurrentExtranetUserId()', 361 DW_SHOW_PRICES_WITH_VAT: @ecomShowPricesWithVat, 362 DW_PRICES_FORMATTED: @ecomPricesFormatted 363 }; 364 </script> 365 366 @BaseSettings.System.HeadScript 367 368 @{ 369 var _cookieOptinLevel = Dynamicweb.Environment.CookieManager.GetCookieOptInLevel(); 370 var _enabledCookieCategories = Dynamicweb.Environment.CookieManager.GetCookieOptInCategories(); 371 if (_cookieOptinLevel.ToString() == "All" || _enabledCookieCategories.Contains("Marketing_Cookies")) 372 { 373 @BaseSettings.System.HeadScriptAfterConsent; 374 } 375 } 376 377 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend; 378 @{ 379 380 var reviewName = BaseSettings.Review.Review_Name != null ? BaseSettings.Review.Review_Name : ""; 381 var reviewBestRating = BaseSettings.Review.Review_Best_Rating != null ? BaseSettings.Review.Review_Best_Rating : ""; 382 var reviewWorstRating = BaseSettings.Review.Review_Worst_Rating != null ? BaseSettings.Review.Review_Worst_Rating : ""; 383 var reviewRatingValue = BaseSettings.Review.Review_Rating_Value != null ? BaseSettings.Review.Review_Rating_Value : ""; 384 var reviewCount = BaseSettings.Review.Review_Count != null ? BaseSettings.Review.Review_Count : ""; 385 var reviewUrl = BaseSettings.Review.Review_URL != null ? BaseSettings.Review.Review_URL : ""; 386 387 var searchPageID = Bluedesk.Tools.DynamicWeb.Generic.PageHelper.GetPageIDByNavigationTag("searchresults", Pageview.AreaID); 388 var domain = Dynamicweb.Environment.Helpers.LinkHelper.GetHttpDomain(); 389 } 390 391 <script type="application/ld+json"> 392 [{ 393 "@@context": "https://schema.org", 394 "@@type": "Organization", 395 "name" : "@BaseSettings.CorporateSettings.CompanyName", 396 "url": "@domain", 397 "sameAs" : "@BaseSettings.SocialMedia.Facebook", 398 "logo": "@domain@BaseSettings.BrandConfiguration.Logos.Logo", 399 "contactPoint" : [{ 400 "@@type" : "ContactPoint", 401 "telephone" : "@BaseSettings.CorporateSettings.Phonenumber", 402 "contactType" : "customer service" , 403 "@@context": "https://schema.org", 404 "@@id": "@domain", 405 "name": "@BaseSettings.CorporateSettings.CompanyName" 406 }], 407 "address": { 408 "@@type": "PostalAddress", 409 "streetAddress": "@BaseSettings.CorporateSettings.Address", 410 "addressLocality": "@BaseSettings.CorporateSettings.City", 411 "postalCode": "@BaseSettings.CorporateSettings.Zipcode", 412 "addressRegion": "@BaseSettings.CorporateSettings.Region", 413 "addressCountry": "@BaseSettings.CorporateSettings.Country" 414 } 415 }, 416 { 417 "@@context": "https://schema.org", 418 "@@type": "WebSite", 419 "name" : "@BaseSettings.CorporateSettings.CompanyName", 420 "alternateName" : "@BaseSettings.CorporateSettings.AltCompanyName", 421 "url": "@domain", 422 "potentialAction": { 423 "@@type": "SearchAction", 424 "target": "@domain/Default.aspx?ID=@searchPageID&q={search_term_string}", 425 "query-input": "required name=search_term_string" 426 } 427 }] 428 </script> 429 430 <script type="application/ld+json"> 431 { 432 "@@context": "https://schema.org", 433 "@@type": "Product", 434 "name": "@reviewName", 435 "url":"@reviewUrl", 436 "aggregateRating": { 437 "@@type": "AggregateRating", 438 "bestRating": "@reviewBestRating", 439 "worstRating": "@reviewWorstRating", 440 "ratingValue": "@reviewRatingValue", 441 "reviewCount": "@reviewCount" 442 } 443 } 444 </script> 445 446 447 @RenderSnippet("DataLayer") 448 @RenderSnippet("GoogleMapsScript") 449 450 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend; 451 452 @{ 453 454 // TODO: Add there options to master config for product overview 455 bool hidePricesForGuests = false; 456 bool hideShoppingCartForGuests = false; 457 458 bool enableShoppingCart = hideShoppingCartForGuests && Pageview.User == null ? false : BaseSettings.Features.ConfigModuleShoppingCart; 459 bool enableLogin = BaseSettings.Features.ConfigModuleLogin; 460 bool enableQuickOrder = BaseSettings.Features.ConfigModuleQuickOrder; 461 bool enableAdvancedSearch = BaseSettings.Features.ConfigModuleAdvancedSearch; 462 bool enableCallMeBack = BaseSettings.Features.ConfigModuleCallMeBack; 463 bool enableDyslexicFont = BaseSettings.Features.ConfigModuleDyslexicFont; 464 bool enableProductCompare = BaseSettings.Features.ConfigModuleProductCompare; 465 } 466 467 468 <style> 469 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 470 @using Dynamicweb; 471 472 @using System.Data; 473 @using System.Data.SqlClient; 474 @using Bluedesk.Tools.DynamicWeb.DataAccess; 475 476 @using Bluedesk.DynamicWeb.ItemTypes; 477 @using Bluedesk.DynamicWeb.ItemTypes.Settings; 478 @using Bluedesk.DynamicWeb.ItemTypes.Configuration; 479 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 480 481 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend; 482 483 @Title("Configuration page template") 484 485 @{ 486 487 string RoundedCornersValue = BaseSettings.BrandConfiguration.RoundedCorners; 488 string ButtonHeight = BaseSettings.BrandConfiguration.ButtonHeight; 489 490 string fontawesomeFontFamily = "Font Awesome 5 Pro"; 491 int fontawesomeFontWeight = 300; 492 493 switch (BaseSettings.BrandConfiguration.FontawesomeStyle) 494 { 495 496 case "fal": 497 fontawesomeFontWeight = 300; 498 break; 499 case "far": 500 fontawesomeFontWeight = 400; 501 break; 502 case "fas": 503 fontawesomeFontWeight = 900; 504 break; 505 case "fad": 506 fontawesomeFontWeight = 900; 507 fontawesomeFontFamily = "Font Awesome 5 Duotone"; 508 break; 509 } 510 511 } 512 513 @BaseSettingServices.RenderButtonCSS("btn__primary", BaseSettingsButtons.PrimaryButtonConfiguration) 514 @BaseSettingServices.RenderButtonCSS("btn__secondary", BaseSettingsButtons.SecondaryButtonConfiguration) 515 @BaseSettingServices.RenderButtonCSS("btn__contrast", BaseSettingsButtons.ContrastButtonConfiguration) 516 517 :root, 518 body { 519 520 --BaseColorPrimary : @BaseSettingsBrandConfiguration.BaseColorPrimary; 521 --BaseColorSecondary : @BaseSettingsBrandConfiguration.BaseColorSecondary; 522 --BaseColorContrast : @BaseSettingsBrandConfiguration.BaseColorContrast; 523 524 --BaseFontPrimary : @BaseSettingsBrandConfiguration.PrimaryFontFamily; 525 --BaseFontSecondary : @BaseSettingsBrandConfiguration.PrimaryFontFamily; 526 527 @BaseSettings.BrandConfiguration.BodyInlineStyles 528 --StandardUnitSize : 3.2rem; 529 } 530 531 .footer { 532 --FooterContainerDisplay: none !important; 533 display: var(--FooterContainerDisplay) 534 } 535 536 h1, h2, h3, h4, h5, h6 { @BaseSettings.BrandConfiguration.HeaderInlineStyles } 537 538 h1.cta-paragraph__header { @BaseSettings.BrandConfiguration.H1InlineStyles } 539 h2.cta-paragraph__header { @BaseSettings.BrandConfiguration.H2InlineStyles } 540 h3.cta-paragraph__header { @BaseSettings.BrandConfiguration.H3InlineStyles } 541 h4.cta-paragraph__header { @BaseSettings.BrandConfiguration.H4InlineStyles } 542 543 .po-block__addtocart .btn, 544 .productdetails__add-to-cart, 545 .searchbox__input { 546 border-radius: @RoundedCornersValue; 547 } 548 549 main.blur { 550 filter: grayscale(50%) blur(15px); 551 -webkit-filter: grayscale(50%) blur(15px); 552 } 553 554 .AdvancedGridButton { 555 --BorderRadius: @RoundedCornersValue; 556 } 557 558 .btn { 559 height: var(--StandardUnitSize); 560 } 561 562 .btn__icon { 563 564 --fontawesomeFontFamily : "@fontawesomeFontFamily"; 565 --fontawesomeFontWeight : @fontawesomeFontWeight; 566 567 font-family: var(--fontawesomeFontFamily); 568 font-weight: var(--fontawesomeFontWeight); 569 570 -moz-osx-font-smoothing: grayscale; 571 -webkit-font-smoothing: antialiased; 572 display: inline-block; 573 font-style: normal; 574 font-variant: normal; 575 text-rendering: auto; 576 line-height: 1; 577 578 } 579 580 .cta-paragraph { 581 background-color: var(--mainBackgroundColor); 582 } 583 584 .cta-paragraph__container { 585 background-color: var(--contentBackgroundColor); 586 border: var(--contentBorder); 587 } 588 589 .cta-paragraph__subheader, 590 .cta-paragraph__header, 591 .cta-paragraph__text p, 592 .cta-paragraph__text li { 593 color: var(--Color); 594 background-color: var(--BackgroundColor); 595 border-color: var(--BorderColor); 596 position: var(--Position); 597 top: var(--Top); 598 left: var(--Left); 599 right: var(--Right); 600 bottom: var(--Bottom); 601 padding: var(--Padding); 602 border: var(--BorderSize); 603 font-size: var(--FontSize); 604 text-transform: var(--FontStyle); 605 line-height: var(--LineHeight); 606 font-weight: var(--FontWeight); 607 font-family: var(--FontFamily); 608 border-radius: var(--BorderRadius); 609 } 610 611 .cta-paragraph__content-container { 612 align-items: var(--ContentElementAlignmentAlignItems); 613 text-align: var(--ContentElementAlignmentTextAlign); 614 } 615 616 .cta-paragraph__btn-navigation, 617 .cta-paragraph__content-container { 618 align-items : var(--ContainerFitContentAlignmentAlignItems); 619 justify-content: var(--ContainerFitContentAlignmentJustifyContent); 620 } 621 622 .jumbotron__subheader, 623 .jumbotron__header, 624 .jumbotron__shoutbox-intro p, 625 .jumbotron__shoutbox-intro li, 626 .header--desktop.headerNew { 627 position: relative; 628 } 629 630 .header--desktop.headerNew.stickyheader { 631 position: fixed; 632 } 633 634 @@media screen and (min-width: 992px){ 635 .image-left { 636 justify-content: flex-end; 637 flex-direction: row; 638 } 639 640 .image-right { 641 justify-content: flex-start; 642 flex-direction: row-reverse; 643 } 644 } 645 646 .AdvancedGrid__row { 647 background-color: var(--BackgroundColor); 648 } 649 650 .cta-paragraph__btn-navigation { 651 padding: 1.2rem 0rem !important; 652 } 653 654 .AdvancedGrid, 655 .AdvancedGrid__container { 656 width: 100%; 657 background-image: var(--BackgroundImage); 658 min-height: var(--Height); 659 } 660 661 @{ 662 663 int PageViewId = Pageview.Page.ID; 664 int AreaId = Pageview.AreaID; 665 666 // HttpContext.Current.Session["PageIdForStyles"] = Pageview.Page.ID; 667 // HttpContext.Current.Session["AreaIdForStyles"] = Pageview.AreaID; 668 669 DataTable AdvancedGridStylesDataTable = null; 670 671 AdvancedGridStylesDataTable = DynamicwebData.Query($@" 672 673 SELECT 674 InlineStyles AS Styles 675 676 FROM 677 [dbo].[ItemType_AdvancedGridConfiguration] AS AGC 678 LEFT JOIN [dbo].[GridRow] AS GR ON GR.GridRowItemId = AGC.Id 679 680 WHERE 681 GR.GridRowPageId = @PageId; 682 683 ", new SqlParameter("PageId", PageViewId)); 684 685 DataTable BackgroundConfigDataTable = null; 686 687 BackgroundConfigDataTable = DynamicwebData.Query($@" 688 689 SELECT 690 distinct(BG.Stylesheet) AS Styles 691 692 FROM [dbo].GridRow AS GR 693 INNER JOIN dbo.Paragraph AS PG ON PG.ParagraphGridRowId = GR.GridRowId 694 LEFT JOIN dbo.ItemType_CTAParagraph AS CTA ON CTA.Id = PG.ParagraphItemId 695 LEFT JOIN dbo.ItemType_MultiColumnParagraph AS MCP ON MCP.Id = PG.ParagraphItemId 696 LEFT JOIN dbo.ItemType_Carousel AS CS ON CS.Id = PG.ParagraphItemId 697 LEFT JOIN dbo.ItemType_BackgroundConfiguration AS BG ON CTA.BackgroundConfigurationID = BG.Id 698 OR MCP.BackgroundConfigurationID = BG.Id 699 OR CS.BackgroundConfigurationID = BG.Id 700 701 WHERE GR.GridRowPageID=@PageId 702 AND bg.Stylesheet Is NOT NULL", new SqlParameter("PageId", PageViewId)); 703 704 DataTable ButtonConfigDataTable = null; 705 706 ButtonConfigDataTable = DynamicwebData.Query($@" 707 708 SELECT 709 distinct(BCONF.Stylesheet) AS Styles 710 711 FROM [dbo].GridRow AS GR 712 LEFT JOIN [dbo].Paragraph AS P ON P.ParagraphGridRowId = GR.GridRowId 713 LEFT JOIN [dbo].ItemType_CTAParagraph AS CTAP ON CTAP.Id = P.ParagraphItemId 714 715 LEFT JOIN [dbo].ItemType_MultiColumnParagraph AS MCP ON MCP.Id = P.ParagraphItemId 716 LEFT JOIN [dbo].[ItemList] AS ColumnIL ON ColumnIL.ItemListId = MCP.ParagraphListID 717 LEFT JOIN [dbo].[ItemListRelation] AS ColumnILR ON ColumnIL.ItemListId = ColumnILR.ItemListRelationItemListId 718 LEFT JOIN [dbo].[ItemType_ParagraphColumn] AS PC ON PC.Id = ColumnILR.ItemListRelationItemId 719 720 LEFT JOIN [dbo].ItemType_Carousel AS CS ON CS.Id = P.ParagraphItemId 721 LEFT JOIN [dbo].[ItemList] AS CIIL ON CIIL.ItemListId = CS.CarouselListID 722 LEFT JOIN [dbo].[ItemListRelation] AS CIILR ON CIIL.ItemListId = CIILR.ItemListRelationItemListId 723 LEFT JOIN [dbo].ItemType_CarouselItem AS CI ON CI.Id = CIILR.ItemListRelationItemId 724 725 LEFT JOIN [dbo].[ItemType_JumbotronContainer] AS JC ON JC.Id = P.ParagraphItemId 726 LEFT JOIN [dbo].[ItemList] AS JCIL ON JCIL.ItemListId = JC.JumbotronListID 727 LEFT JOIN [dbo].[ItemListRelation] AS JCILR ON JCIL.ItemListId = JCILR.ItemListRelationItemListId 728 LEFT JOIN [dbo].ItemType_JumbotronListItem AS JCLI ON JCLI.Id = JCILR.ItemListRelationItemId 729 730 LEFT JOIN [dbo].[ItemType_CTAButton] AS CTAB ON 731 CTAP.ButtonID = CTAB.Id 732 OR CTAP.ExtraButtonID = CTAB.Id 733 OR MCP.ButtonID = CTAB.Id 734 OR PC.ButtonID = CTAB.Id 735 OR PC.ExtraButtonID = CTAB.Id 736 OR CS.ButtonID = CTAB.Id 737 OR CI.ButtonID = CTAB.Id 738 OR CI.ExtraButtonID = CTAB.Id 739 OR JCLI.ButtonID = CTAB.Id 740 LEFT JOIN [dbo].[ItemType_ButtonConfiguration] AS BCONF ON CTAB.ButtonConfigurationID = BCONF.Id 741 742 WHERE 743 GR.GridRowPageID = @PageId 744 AND GR.GridRowActive = 1 745 AND CTAB.ButtonConfigurationID Is NOT NULL", new SqlParameter("PageId", PageViewId)); 746 747 DataTable MasterConfigDataTable = null; 748 749 MasterConfigDataTable = DynamicwebData.Query($@" 750 751 SELECT 752 MC.CustomCSS 753 754 FROM 755 [dbo].[Page] AS P 756 INNER JOIN [dbo].[ItemType_MasterConfig] AS MC ON P.PageItemId = MC.Id 757 758 WHERE 759 p.PageItemType = 'MasterConfig' 760 AND PageAreaId = @AreaId;", new SqlParameter("AreaId", AreaId)); 761 762 if (AdvancedGridStylesDataTable != null && AdvancedGridStylesDataTable.Rows.Count > 0) 763 { 764 for (int i = 0; i < AdvancedGridStylesDataTable.Rows.Count; i++) 765 { 766 @AdvancedGridStylesDataTable.Rows[i]["Styles"].ToString(); 767 } 768 } 769 770 if (BackgroundConfigDataTable != null && BackgroundConfigDataTable.Rows.Count > 0) 771 { 772 for (int i = 0; i < BackgroundConfigDataTable.Rows.Count; i++) 773 { 774 @BackgroundConfigDataTable.Rows[i]["Styles"].ToString().Replace("--Color: ;", ""); 775 } 776 } 777 778 if (ButtonConfigDataTable != null && ButtonConfigDataTable.Rows.Count > 0) 779 { 780 for (int i = 0; i < ButtonConfigDataTable.Rows.Count; i++) 781 { 782 @ButtonConfigDataTable.Rows[i]["Styles"].ToString(); 783 } 784 } 785 786 @MasterConfigDataTable.Rows[0]["CustomCSS"].ToString(); 787 } 788 789 </style> 790 791 </head> 792 793 <body class="@MasterConfigCssClass workshoppage"> 794 795 @BaseSettings.System.BodyScript 796 797 @{ 798 if (_cookieOptinLevel.ToString() == "All" || _enabledCookieCategories.Contains("Marketing_Cookies")) 799 { 800 @BaseSettings.System.BodyScriptAfterConsent; 801 } 802 } 803 804 @BaseSettings.System.TailScript 805 806 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 807 808 @using System.Linq; 809 @using System.Data; 810 811 @using Dynamicweb; 812 @using Dynamicweb.Content; 813 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend; 814 815 @{ 816 817 DataTable DataTableObj = AdvancedGridServices.GetHeaderGridDataTable(Pageview.AreaID, Pageview.Page.ID); 818 819 WrapperObj Header = AdvancedGridServices.RenderWrapper(DataTableObj, "header", "header", Pageview.AreaID, Pageview.Page.ID); 820 WrapperObj Footer = AdvancedGridServices.RenderWrapper(DataTableObj, "footer", "footer", Pageview.AreaID, Pageview.Page.ID); 821 822 // var homepage = Dynamicweb.Services.Pages.GetRootPagesForArea(Pageview.AreaID).FirstOrDefault(p => p.ItemType == "HomePage" && p.Active) ?? Dynamicweb.Services.Pages.GetFirstPageForArea(Pageview.AreaID); 823 824 MasterLayoutPageObj MasterLayoutPageObj = MasterLayoutControllers.RenderMasterLayoutPageObj(Pageview); 825 826 bool userLoggedIn = false; 827 if (enableLogin) { userLoggedIn = Pageview.User == null ? false : true; } 828 829 string HeaderContainerSize = mc.HeaderConfiguration.ContainerSize != 0 ? mc.HeaderConfiguration.ContainerSize + "px" : "auto"; 830 831 } 832 833 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 834 @using Dynamicweb; 835 @using Dynamicweb.Content.Items; 836 837 <script> 838 839 function setImagesSizes(Classname) { 840 var Images = document.querySelectorAll(Classname); 841 for (var index = 0; index < Images.length; index++) { 842 if (!Images[index].hasAttribute("height")) { 843 Images[index].setAttribute("height", Images[index].offsetHeight); 844 } 845 if (!Images[index].hasAttribute("width")) { 846 Images[index].setAttribute("width", Images[index].offsetWidth); 847 } 848 } 849 } 850 851 window.addEventListener('load', function () { 852 setImagesSizes("img"); 853 setImagesSizes(".mc-header__logo-image"); 854 }); 855 856 </script> 857 858 859 <header>@MasterLayoutPageObj.Header</header> 860 861 <!-- DO NOT REMOVE --> 862 <div id="quick-order"></div> 863 <div id="backdrop-megamenu"></div> 864 <mega-menu id="mega-menu"></mega-menu> 865 <!-- DO NOT REMOVE --> 866 867 @if (isVisualEditor && IsNotContentManager) 868 { 869 @AdvancedGridServices.RenderVisualEditorNavigation(DataTableObj, "header") 870 } 871 872 <style>@MasterLayoutPageObj.CSS</style> 873 874 <style> 875 876 877 .visual-editor__navigation { 878 position: absolute; 879 top: 10px; 880 left: 10px; 881 display: flex; 882 flex-direction: row; 883 z-index: 100000000; 884 } 885 886 .visual-editor__button { 887 height: 50px; 888 min-width: 150px; 889 right: auto; 890 left: auto; 891 background-color: white; 892 box-shadow: -10px 10px 10px rgb(28 28 84 / 25%); 893 display: flex; 894 justify-content: center; 895 align-items: center; 896 padding: 25px; 897 margin-right: 25px; 898 } 899 900 .visual-editor__button-icon { 901 margin-right: 25px; 902 } 903 904 .header { 905 --HeaderContainerDisplay: none; 906 } 907 908 .header__container { 909 padding: 0; 910 } 911 912 .header__container, .header__stickyheader-container { 913 max-width: none; 914 } 915 916 .header .AdvancedGrid__container { 917 max-width: @HeaderContainerSize; 918 margin: 0 auto; 919 } 920 921 .header .AdvancedGrid__column { 922 background-color: var(--BackgroundColor); 923 flex-grow: var(--FlexGrow); 924 } 925 926 .AdvancedGrid__row { 927 align-items: center; 928 } 929 </style> 930 931 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 932 @using Dynamicweb; 933 @using Bluedesk.DynamicWeb.ItemTypes; 934 935 @{ 936 var pid = ModuleOnlyParagraph.GetParagraphIDByTag<ModuleOnlyParagraph>("SideBarForm", Pageview.AreaID); 937 938 if (pid > 0) 939 { 940 <section id="vue-side-bar-form" data-paragraphid="@pid" data-telephone="@phonenumber" data-formatphonenumber="@formattedPhonenumber" data-isoffline="@isOffline"></section> 941 } 942 } 943 944 945 @if (@enableProductCompare) 946 { 947 <div id="vue-compare-list"></div> 948 } 949 950 <main> 951 952 @Model.Grid("grid", "Before content", "", "AdvancedGrid") 953 954 @if (showBreadcrumbs) 955 { 956 var navigationSettings = new NavigationSettings(); 957 navigationSettings.ExpandMode = ExpandMode.PathOnly; 958 navigationSettings.StartLevel = 1; 959 navigationSettings.StopLevel = 99; 960 navigationSettings.Parameters.Add("PageTitle", Model.Title); 961 navigationSettings.IncludeFoldersAndHidden = true; 962 963 @Navigation.RenderNavigation("Navigation/Breadcrumbs.cshtml", navigationSettings) 964 965 } 966 967 @{ 968 string introBackgroundColor = _workshop.IntroBackgroundColor != null ? _workshop.IntroBackgroundColor.ToString() : ""; 969 introBackgroundColor = !introBackgroundColor.Contains("#") ? pnColorService.GetHexColor(Pageview.AreaID, introBackgroundColor) : introBackgroundColor; 970 } 971 <section class="workshoppage__intro" style="--introbgcolor: @introBackgroundColor"> 972 <div class="container workshoppage__row"> 973 <div class="workshoppage__description"> 974 @if(!string.IsNullOrWhiteSpace(_workshop.SubTitle)) 975 { 976 <p class="workshoppage__subheader">@_workshop.SubTitle</p> 977 } 978 <h1 class="workshoppage__header">@_workshop.Name</h1> 979 @if(!string.IsNullOrWhiteSpace(_workshop.Description)) 980 { 981 <div> 982 @_workshop.Description 983 </div> 984 } 985 @if(_button != null && !string.IsNullOrWhiteSpace(_workshop.ButtonText)) { 986 @RenderAcademyButton(_button, _workshop.ButtonLink, _button.ButtonClass, _workshop.ButtonText, "", false, "fa-chevron-right", "workshoppage__signupbtn", "", "") 987 } 988 </div> 989 <div class="workshoppage__image w-full md:w-33p"> 990 @if(!string.IsNullOrWhiteSpace(_workshop.Image)) { 991 string imgUrl = "/Admin/Public/GetImage.ashx?Image=" + _workshop.Image + "&Crop=5&Format=webp&Quality=90&Compression=80&Width=500&Height=500"; 992 <figure class=""> 993 <img src="@imgUrl" alt="@_workshop.Name"> 994 </figure> 995 } 996 </div> 997 </div> 998 </section> 999 1000 <div class="container workshoppage__row"> 1001 @if(!string.IsNullOrWhiteSpace(_workshop.TopicsTitle)) { 1002 <h2>@_workshop.TopicsTitle</h2> 1003 } 1004 <ol class="workshoppage__learngrid"> 1005 @foreach(WorkshopTopic _topic in _workshop.Topics()) { 1006 string topicBackgroundColor = _workshop.TopicsBackgroundColor != null ? _workshop.TopicsBackgroundColor.ToString() : ""; 1007 topicBackgroundColor = !topicBackgroundColor.Contains("#") ? pnColorService.GetHexColor(Pageview.AreaID, topicBackgroundColor) : topicBackgroundColor; 1008 1009 if(!string.IsNullOrWhiteSpace(_topic.BackgroundColor) && _topic.BackgroundColor != "transparent") { 1010 string blockBackgroundColor = _topic.BackgroundColor != null ? _topic.BackgroundColor.ToString() : ""; 1011 topicBackgroundColor = !blockBackgroundColor.Contains("#") ? pnColorService.GetHexColor(Pageview.AreaID, blockBackgroundColor) : blockBackgroundColor; 1012 } 1013 <li style="--topic-bg-color: @topicBackgroundColor"> 1014 <h3>@_topic.Name</h3> 1015 <p>@_topic.Description</p> 1016 </li> 1017 } 1018 </ol> 1019 </div> 1020 1021 @Model.Grid("grid2", "Between content", "", "AdvancedGrid") 1022 1023 <section class="container workshoppage__row"> 1024 <div class="workshoppage__locations"> 1025 <h2>@Translate("WorkshopDetail.LocationsTitle", "Locations")</h2> 1026 @foreach(WorkshopCourse _location in _workshop.Locations().OrderBy(p => p.Location()?.Name)) { 1027 1028 IEnumerable<WorkshopTime> workshopTimes = _location.Times().Where(t => DateTime.Now.CompareTo(t.WorkshopStartDateTime) < 0).OrderBy(t => t.WorkshopStartDateTime); 1029 1030 if(workshopTimes.Any()) 1031 { 1032 <ul class="mb-4"> 1033 <li><h4>@_location.Location().Name</h4></li> 1034 <li> 1035 <ul class="workshoppage__dates"> 1036 @foreach(WorkshopTime _time in workshopTimes) 1037 { 1038 string formattedTime = _time.WorkshopStartDateTime.ToString("d MMMM yyyy - HH:mm", Pageview.Area.CultureInfo) + "-" + _time.WorkshopEndDateTime.ToString("HH:mm", CultureInfo.InvariantCulture); 1039 <li> 1040 <p>@formattedTime</p> 1041 @if(_time.ExtraTimes().Any()) 1042 { 1043 <span class="workshoppage__datesseperator">&</span> 1044 <ul class="workshoppage__extradates"> 1045 @foreach(WorkshopDay _extratime in _time.ExtraTimes().OrderBy(t => t.WorkshopStartDateTime)) 1046 { 1047 string formattedExtraTime = _extratime.WorkshopStartDateTime.ToString("d MMMM - HH:mm", Pageview.Area.CultureInfo) + "-" + _extratime.WorkshopEndDateTime.ToString("HH:mm", CultureInfo.InvariantCulture); 1048 <li> 1049 <p>@formattedExtraTime</p> 1050 </li> 1051 } 1052 </ul> 1053 } 1054 </li> 1055 } 1056 </ul> 1057 </li> 1058 </ul> 1059 } 1060 } 1061 1062 @if(_workshop.LocationsInfo != null && !string.IsNullOrWhiteSpace(_workshop.LocationsInfo)) 1063 { 1064 <p>@_workshop.LocationsInfo</p> 1065 } 1066 1067 <h2 class="mt-6">@Translate("WorkshopDetail.PriceTitle", "Price")</h2> 1068 1069 <p>@_workshop.Price</p> 1070 1071 @if(_workshop.PriceInfo != null && !string.IsNullOrWhiteSpace(_workshop.PriceInfo)) 1072 { 1073 <p>@_workshop.PriceInfo</p> 1074 } 1075 </div> 1076 <div id="signup" class="workshoppage__form"> 1077 @Model.Grid("grid3", "Signup form", "", "AdvancedGrid") 1078 </div> 1079 </section> 1080 1081 @Model.Grid("grid4", "After content", "", "AdvancedGrid") 1082 1083 </main> 1084 1085 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 1086 @using Dynamicweb; 1087 @using Bluedesk.DynamicWeb.ItemTypes; 1088 @using Bluedesk.DynamicWeb.ItemTypes.Extensions; 1089 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend; 1090 1091 @{ 1092 1093 string footerLogo = BaseSettings.BrandConfiguration.Logos.FooterLogo; 1094 string footerDescription = BaseSettings.CorporateSettings.FooterDescription; 1095 1096 var fb = BaseSettings.SocialMedia.Facebook; 1097 var twitter = BaseSettings.SocialMedia.Twitter; 1098 var linkedin = BaseSettings.SocialMedia.LinkedIn; 1099 var instagram = BaseSettings.SocialMedia.Instagram; 1100 var youtube = BaseSettings.SocialMedia.Youtube; 1101 var pinterest = BaseSettings.SocialMedia.Pinterest ?? ""; 1102 1103 var companyName = BaseSettings.CorporateSettings.CompanyName; 1104 var Emailadress = BaseSettings.CorporateSettings.Emailadress; 1105 var Phonenumber = BaseSettings.CorporateSettings.Phonenumber; 1106 var Address = BaseSettings.CorporateSettings.Address; 1107 var Zipcode = BaseSettings.CorporateSettings.Zipcode; 1108 var City = BaseSettings.CorporateSettings.City; 1109 var Country = BaseSettings.CorporateSettings.Country; 1110 1111 var selectedPaymentLogos = BaseSettings.BrandConfiguration.Logos.FooterPaymentLogos; 1112 1113 bool footer__newsletter_signup_display = !string.IsNullOrWhiteSpace(mc.FooterConfiguration.NewsLetterSignUpDisplay.ToString()) && mc.FooterConfiguration.NewsLetterSignUpDisplay.ToString() == "True" ? true : false; 1114 bool footer__USP_display = !string.IsNullOrWhiteSpace(mc.FooterConfiguration.UspDisplay.ToString()) && mc.FooterConfiguration.UspDisplay.ToString() == "True" ? true : false; 1115 1116 string footer__background_color = mc.FooterConfiguration.BackgroundColor?.GetColorCode(Pageview.AreaID) ?? "#000000"; 1117 string footer__color = mc.FooterConfiguration.Color?.GetColorCode(Pageview.AreaID) ?? "#FFFFFF"; 1118 1119 string footer__top_image = !string.IsNullOrWhiteSpace(mc.FooterConfiguration.TopImage.ToString()) ? mc.FooterConfiguration.TopImage.ToString() : ""; 1120 1121 1122 1123 } 1124 1125 <div id="scroll-to-top" class="scroll-to-top" aria-label="@Translate("Naar boven", "To Top")"> 1126 <span class="scroll-to-top__text"> 1127 @Translate("Naar boven", "To Top") 1128 </span> 1129 <i class="fal fa-arrow-to-top scroll-to-top__icon"></i> 1130 </div> 1131 1132 @if (Pageview.Page.ParentPageId > 0) 1133 { 1134 var siblings = Dynamicweb.Services.Pages.GetPagesByParentID(Pageview.Page.ParentPageId).Where(p => p.Active).ToList(); 1135 var parentpageItemType = Pageview.Page.Parent.ItemType; 1136 bool isParentPageOverviewpage = parentpageItemType == "OverviewPage"; 1137 1138 if (siblings.Count() > 1 && isParentPageOverviewpage) 1139 { 1140 var prevPage = siblings.OrderByDescending(p => p.Sort).FirstOrDefault(p => p.Sort < Pageview.Page.Sort); 1141 var nextPage = siblings.OrderBy(p => p.Sort).FirstOrDefault(p => p.Sort > Pageview.Page.Sort); 1142 var overview = "/Default.aspx?ID=" + Pageview.Page.ParentPageId; 1143 1144 <section class="page-navigation"> 1145 @if (prevPage != null) 1146 { 1147 var back = "/Default.aspx?ID=" + prevPage.ID; 1148 <a href="@back" class="page-navigation__item"> 1149 <i class="fal fa-arrow-alt-to-left page-navigation__item--icon"></i> 1150 <label class="page-navigation__item-label">@Translate("pagenavigation.previous", "Previous")</label> 1151 </a> 1152 } 1153 1154 <a href="@overview" class="page-navigation__item"> 1155 <label class="page-navigation__item-label">@Translate("pagenavigation.Overview", "To overview")</label> 1156 <i class="fas fa-th page-navigation__item--icon"></i> 1157 </a> 1158 1159 @if (nextPage != null) 1160 { 1161 var forward = "/Default.aspx?ID=" + nextPage.ID; 1162 <a href="@forward" class="page-navigation__item"> 1163 <label class="page-navigation__item-label">@Translate("pagenavigation.next", "Next")</label> 1164 <i class="fal fa-arrow-alt-to-right page-navigation__item--icon"></i> 1165 </a> 1166 } 1167 </section> 1168 } 1169 } 1170 1171 @* 1172 1173 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 1174 @using Dynamicweb; 1175 @using Bluedesk.Tools.DynamicWeb.ExtensionMethods; 1176 @using Bluedesk.DynamicWeb.ItemTypes; 1177 1178 @{ 1179 1180 if (Pageview.Page.ParentPageId > 0) 1181 { 1182 1183 // Paging 1184 1185 var siblings = Dynamicweb.Services.Pages.GetPagesByParentID(Pageview.Page.ParentPageId).Where(p => p.Active).ToList(); 1186 var currentID = Pageview.Page.ID; 1187 var parentpageItemType = Pageview.Page.Parent.ItemType; 1188 bool isParentPageOverviewpage = parentpageItemType == "OverviewPage"; 1189 1190 1191 var siblingsCount = siblings.Count; 1192 1193 int previousIdx = 0; 1194 int nextIdx = siblingsCount - 1; 1195 int idx = 0; 1196 1197 for (int i = 0; i < siblingsCount; i++) 1198 { 1199 if (siblings[i].ID == currentID && siblings[i].PropertyItem != null) 1200 { 1201 idx = i; 1202 } 1203 } 1204 1205 previousIdx = idx == previousIdx ? previousIdx : idx - 1; 1206 nextIdx = idx == nextIdx ? nextIdx : idx + 1; 1207 1208 var previousID = siblings[previousIdx].ID; 1209 var nextID = siblings[nextIdx].ID; 1210 var overview = "/Default.aspx?ID=" + Pageview.Page.ParentPageId; 1211 1212 if (siblingsCount > 1) 1213 { 1214 1215 <section class="page-navigation"> 1216 1217 @if (!(previousID == currentID || previousID == 0)) 1218 { 1219 var back = "/Default.aspx?ID=" + previousID; 1220 <a href="@back" class="page-navigation__item"> 1221 <i class="fal fa-arrow-alt-to-left page-navigation__item--icon"></i> 1222 <label class="page-navigation__item-label">@Translate("pagenavigation.previous", "Previous")</label> 1223 </a> 1224 } 1225 1226 <a href="@overview" class="page-navigation__item"> 1227 <label class="page-navigation__item-label">@Translate("pagenavigation.Overview", "To overview")</label> 1228 <i class="fas fa-th page-navigation__item--icon"></i> 1229 </a> 1230 1231 @if (!(nextID == currentID || nextID == 0)) 1232 { 1233 var forward = "/Default.aspx?ID=" + nextID; 1234 <a href="@forward" class="page-navigation__item"> 1235 <label class="page-navigation__item-label">@Translate("pagenavigation.next", "Next")</label> 1236 <i class="fal fa-arrow-alt-to-right page-navigation__item--icon"></i> 1237 </a> 1238 } 1239 1240 </section> 1241 1242 } 1243 1244 } 1245 else 1246 { 1247 // No action 1248 } 1249 1250 } 1251 1252 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 1253 @using Dynamicweb; 1254 1255 @if (Pageview.Page.ParentPageId > 0) 1256 { 1257 var siblings = Dynamicweb.Services.Pages.GetPagesByParentID(Pageview.Page.ParentPageId).Where(p => p.Active).ToList(); 1258 var parentpageItemType = Pageview.Page.Parent.ItemType; 1259 bool isParentPageOverviewpage = parentpageItemType == "OverviewPage"; 1260 1261 if (siblings.Count() > 1 && isParentPageOverviewpage) 1262 { 1263 var prevPage = siblings.OrderByDescending(p => p.Sort).FirstOrDefault(p => p.Sort < Pageview.Page.Sort); 1264 var nextPage = siblings.OrderBy(p => p.Sort).FirstOrDefault(p => p.Sort > Pageview.Page.Sort); 1265 var overview = "/Default.aspx?ID=" + Pageview.Page.ParentPageId; 1266 1267 <section class="page-navigation"> 1268 @if (prevPage != null) 1269 { 1270 var back = "/Default.aspx?ID=" + prevPage.ID; 1271 <a href="@back" class="page-navigation__item"> 1272 <i class="fal fa-arrow-alt-to-left page-navigation__item--icon"></i> 1273 <label class="page-navigation__item-label">@Translate("pagenavigation.previous", "Previous")</label> 1274 </a> 1275 } 1276 1277 <a href="@overview" class="page-navigation__item"> 1278 <label class="page-navigation__item-label">@Translate("pagenavigation.Overview", "To overview")</label> 1279 <i class="fas fa-th page-navigation__item--icon"></i> 1280 </a> 1281 1282 @if (nextPage != null) 1283 { 1284 var forward = "/Default.aspx?ID=" + nextPage.ID; 1285 <a href="@forward" class="page-navigation__item"> 1286 <label class="page-navigation__item-label">@Translate("pagenavigation.next", "Next")</label> 1287 <i class="fal fa-arrow-alt-to-right page-navigation__item--icon"></i> 1288 </a> 1289 } 1290 </section> 1291 } 1292 } 1293 1294 *@ 1295 1296 1297 1298 <footer>@MasterLayoutPageObj.Footer</footer> 1299 1300 @if (isVisualEditor && IsNotContentManager) 1301 { 1302 <nav class="footer-layout"> 1303 @AdvancedGridServices.RenderVisualEditorNavigation(DataTableObj, "footer") 1304 </nav> 1305 1306 <style> 1307 .footer-layout { 1308 position: absolute; 1309 bottom: 25px; 1310 } 1311 </style> 1312 } 1313 1314 @if (!string.IsNullOrWhiteSpace(footer__top_image) && HideStandardFooter == false) 1315 { 1316 <figure class="footer__top-image"> 1317 <img src="@footer__top_image" alt="" /> 1318 </figure> 1319 } 1320 1321 @if (HideStandardFooter == false) 1322 { 1323 1324 <footer class="footer" style="--footer-bg-color: @footer__background_color; --footer-color: @footer__color;"> 1325 1326 @if (footer__USP_display) 1327 { 1328 if (!string.IsNullOrWhiteSpace(BaseSettings.USP.USP_1) || !string.IsNullOrWhiteSpace(BaseSettings.USP.USP_2) || !string.IsNullOrWhiteSpace(BaseSettings.USP.USP_3) || !string.IsNullOrWhiteSpace(BaseSettings.USP.USP_4) || !string.IsNullOrWhiteSpace(BaseSettings.USP.USP_5)) 1329 { 1330 <div class="footer-usp__wrapper"> 1331 <div class="container"> 1332 <ul class="footer-usp__list flex-wrap"> 1333 @RenderFooterUSP(BaseSettings.USP.USP_1, BaseSettings.USP.USP_1_icon) 1334 @RenderFooterUSP(BaseSettings.USP.USP_2, BaseSettings.USP.USP_2_icon) 1335 @RenderFooterUSP(BaseSettings.USP.USP_3, BaseSettings.USP.USP_3_icon) 1336 @RenderFooterUSP(BaseSettings.USP.USP_4, BaseSettings.USP.USP_4_icon) 1337 @RenderFooterUSP(BaseSettings.USP.USP_5, BaseSettings.USP.USP_5_icon) 1338 1339 </ul> 1340 </div> 1341 </div> 1342 } 1343 } 1344 1345 @if (footer__newsletter_signup_display) 1346 { 1347 <div> 1348 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 1349 @using Dynamicweb; 1350 1351 @{ 1352 var newsletterFormID = ModuleOnlyParagraph.GetParagraphIDByTag<ModuleOnlyParagraph>("Footer.Newsletter", Pageview.AreaID); 1353 1354 if (newsletterFormID > 0) 1355 { 1356 <section class="footer__newsletter-container"> 1357 <div class="container footer__newsletter"> 1358 <label class="footer__newsletter-label"> 1359 @Translate("Footer.SignUpNewsletter", "Sign up for the digital newsletter") 1360 </label> 1361 @RenderParagraphContent(newsletterFormID) 1362 </div> 1363 </section> 1364 } 1365 } 1366 1367 </div> 1368 } 1369 1370 @if (!string.IsNullOrWhiteSpace(mc.FooterConfiguration.BackgroundGradient)) 1371 { 1372 <style> 1373 .footer { 1374 @mc.FooterConfiguration.BackgroundGradient; 1375 } 1376 </style> 1377 } 1378 1379 <section class="container footer__content"> 1380 1381 <div class="footer__link"> 1382 @{ 1383 var footerColumnOneNavigationSettings = new NavigationSettings(); 1384 footerColumnOneNavigationSettings.ExpandMode = ExpandMode.All; 1385 footerColumnOneNavigationSettings.StartLevel = 1; 1386 footerColumnOneNavigationSettings.StopLevel = 4; 1387 footerColumnOneNavigationSettings.RootNavigationTag = "footer-column-1"; 1388 var footerColumnOneNavigation = Navigation.RenderNavigation("Navigation/BottomNavigation.cshtml", footerColumnOneNavigationSettings); 1389 1390 if (!string.IsNullOrEmpty(footerColumnOneNavigation)) 1391 { 1392 <p class="footer__link-header">@Translate("Footer.Column1.Header", "What you need to know")</p> 1393 @footerColumnOneNavigation 1394 } 1395 } 1396 </div> 1397 <div class="footer__link"> 1398 @{ 1399 var footerColumnTwoNavigationSettings = new NavigationSettings(); 1400 footerColumnTwoNavigationSettings.ExpandMode = ExpandMode.All; 1401 footerColumnTwoNavigationSettings.StartLevel = 1; 1402 footerColumnTwoNavigationSettings.StopLevel = 4; 1403 footerColumnTwoNavigationSettings.RootNavigationTag = "footer-column-2"; 1404 var footerColumnTwoNavigation = Navigation.RenderNavigation("Navigation/BottomNavigation.cshtml", footerColumnTwoNavigationSettings); 1405 1406 if (!string.IsNullOrEmpty(footerColumnTwoNavigation)) 1407 { 1408 <p class="footer__link-header">@Translate("Footer.Column2.Header", "Category two")</p> 1409 @footerColumnTwoNavigation 1410 } 1411 } 1412 </div> 1413 <div class="footer__link"> 1414 @{ 1415 var footerColumnThreeNavigationSettings = new NavigationSettings(); 1416 footerColumnThreeNavigationSettings.ExpandMode = ExpandMode.All; 1417 footerColumnThreeNavigationSettings.StartLevel = 1; 1418 footerColumnThreeNavigationSettings.StopLevel = 4; 1419 footerColumnThreeNavigationSettings.RootNavigationTag = "footer-column-3"; 1420 var footerColumnThreeNavigation = Navigation.RenderNavigation("Navigation/BottomNavigation.cshtml", footerColumnThreeNavigationSettings); 1421 1422 if (!string.IsNullOrEmpty(footerColumnThreeNavigation)) 1423 { 1424 <p class="footer__link-header">@Translate("Footer.Column3.Header", "Category three")</p> 1425 @footerColumnThreeNavigation 1426 } 1427 } 1428 </div> 1429 1430 @if (!string.IsNullOrWhiteSpace(footerLogo) || !string.IsNullOrWhiteSpace(footerDescription)) 1431 { 1432 <div class="footer__description-container"> 1433 @if (!string.IsNullOrWhiteSpace(footerLogo)) 1434 { 1435 <img class="footer__logo" loading="lazy" src="/Admin/Public/GetImage.ashx?Image=@footerLogo&Crop=5&Format=webp&Quality=99&Compression=80&Width=400" alt="Footer logo" width="400" height="200" /> 1436 } 1437 1438 @if (!string.IsNullOrWhiteSpace(footerDescription)) 1439 { 1440 <div class="footer__description"> 1441 @footerDescription 1442 </div> 1443 } 1444 </div> 1445 } 1446 1447 </section> 1448 1449 <section class="footer__copyright"> 1450 1451 <div class="container bottombar__container"> 1452 @{ 1453 var copyRightMenuNavigationSettings = new NavigationSettings(); 1454 copyRightMenuNavigationSettings.ExpandMode = ExpandMode.All; 1455 copyRightMenuNavigationSettings.StartLevel = 1; 1456 copyRightMenuNavigationSettings.StopLevel = 4; 1457 copyRightMenuNavigationSettings.RootNavigationTag = "bottombar"; 1458 var copyRightMenuNavigation = Navigation.RenderNavigation("Navigation/CleanNavigation.cshtml", copyRightMenuNavigationSettings); 1459 1460 if (!string.IsNullOrEmpty(copyRightMenuNavigation)) 1461 { 1462 @copyRightMenuNavigation; 1463 } 1464 } 1465 1466 @if (!string.IsNullOrWhiteSpace(twitter) || !string.IsNullOrWhiteSpace(fb) || !string.IsNullOrWhiteSpace(linkedin) || !string.IsNullOrWhiteSpace(youtube) || !string.IsNullOrWhiteSpace(instagram) || !string.IsNullOrWhiteSpace(pinterest)) 1467 { 1468 <section class="footer__social-container"> 1469 1470 <span class="footer__icon-labels">@Translate("Footer.FollowUs", "Volg ons op:")</span> 1471 1472 <div class="footer__social-icon-container"> 1473 @if (!string.IsNullOrWhiteSpace(twitter)) 1474 { 1475 <a href="@twitter" target="_blank" title="twitter" class="footer__social" rel="noreferrer"><i class="fab fa-twitter"></i></a> 1476 } 1477 @if (!string.IsNullOrWhiteSpace(fb)) 1478 { 1479 <a href="@fb" target="_blank" title="facebook" class="footer__social" rel="noreferrer"><i class="fab fa-facebook-square"></i></a> 1480 } 1481 @if (!string.IsNullOrWhiteSpace(linkedin)) 1482 { 1483 <a href="@linkedin" target="_blank" title="LinkedIn" class="footer__social" rel="noreferrer"><i class="fab fa-linkedin"></i></a> 1484 } 1485 @if (!string.IsNullOrWhiteSpace(youtube)) 1486 { 1487 <a href="@youtube" target="_blank" title="YouTube" class="footer__social" rel="noreferrer"><i class="fab fa-youtube"></i></a> 1488 } 1489 @if (!string.IsNullOrWhiteSpace(instagram)) 1490 { 1491 <a href="@instagram" target="_blank" title="Instagram" class="footer__social" rel="noreferrer"><i class="fab fa-instagram"></i></a> 1492 } 1493 @if (!string.IsNullOrWhiteSpace(pinterest)) 1494 { 1495 <a href="@pinterest" target="_blank" title="Pinterest" class="footer__social" rel="noreferrer"><i class="fab fa-pinterest"></i></a> 1496 } 1497 </div> 1498 1499 </section> 1500 } 1501 </div> 1502 1503 </section> 1504 1505 <section class="footer-paymentoptions" data-paymentmethods="@selectedPaymentLogos"></section> 1506 </footer> 1507 1508 } 1509 1510 @helper RenderFooterUSP(string USP_content, string USP_icon) 1511 { 1512 if (!string.IsNullOrWhiteSpace(USP_content)) 1513 { 1514 var usp_icon_class = (!string.IsNullOrWhiteSpace(USP_icon)) ? USP_icon : "fal fa-check"; 1515 1516 <li class="footer-usp__item"> 1517 <i class="@usp_icon_class footer-usp__icon"></i> 1518 <span>@USP_content</span> 1519 </li> 1520 } 1521 } 1522 1523 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 1524 @using Dynamicweb; 1525 @using Dynamicweb.Content.Items; 1526 @using Bluedesk.DynamicWeb.ItemTypes; 1527 1528 @{ 1529 var colorService = new ColorSwatchService(); 1530 bool displayPrices = mc.EcomConfiguration.HidePricesForGuests ? Pageview.User != null : true; 1531 string ShowZeroPrices = (!mc.EcomConfiguration.HideZeroPrices).ToString().ToLower(); 1532 1533 var homepage = Dynamicweb.Services.Pages.GetRootPagesForArea(Pageview.AreaID).FirstOrDefault(p => p.ItemType == "HomePage" && p.Active) ?? Dynamicweb.Services.Pages.GetFirstPageForArea(Pageview.AreaID); 1534 1535 var bottomBarItemsList = new List<object>(); 1536 foreach (var _item in mc.FooterConfiguration.BottombarItemList) 1537 { 1538 string title = _item.Title; 1539 string link = _item.TargetLink; 1540 1541 if (_item.Type == "login" && Pageview.User != null) 1542 { 1543 title = @Translate("Bottombar.Logout", "Logout"); 1544 link = $"/Admin/Public/ExtranetLogoff.aspx?ID={homepage.ID}"; 1545 } 1546 1547 var newItem = new 1548 { 1549 title = title, 1550 icon = _item.Icon, 1551 link = link, 1552 subtitle = _item.Title, 1553 type = _item.Type, 1554 visible = true 1555 }; 1556 bottomBarItemsList.Add(newItem); 1557 } 1558 var allBottomBarItems = bottomBarItemsList.ToArray(); 1559 string bottomBarItemsJson = Newtonsoft.Json.JsonConvert.SerializeObject(allBottomBarItems).Replace("\"", "\'"); 1560 1561 string BottombarBackgroundColor = mc.FooterConfiguration.BottombarBackgroundColor; 1562 if (!string.IsNullOrWhiteSpace(BottombarBackgroundColor)) 1563 { 1564 BottombarBackgroundColor = !BottombarBackgroundColor.Contains("#") ? colorService.GetHexColor(Pageview.AreaID, BottombarBackgroundColor) : BottombarBackgroundColor; 1565 } 1566 1567 string BottombarTextColor = mc.FooterConfiguration.BottombarTextColor; 1568 if (!string.IsNullOrWhiteSpace(BottombarTextColor)) 1569 { 1570 BottombarTextColor = !BottombarTextColor.Contains("#") ? colorService.GetHexColor(Pageview.AreaID, BottombarTextColor) : BottombarTextColor; 1571 } 1572 1573 string BottombarIconColor = mc.FooterConfiguration.BottombarIconColor; 1574 if (!string.IsNullOrWhiteSpace(BottombarIconColor)) 1575 { 1576 BottombarIconColor = !BottombarIconColor.Contains("#") ? colorService.GetHexColor(Pageview.AreaID, BottombarIconColor) : BottombarIconColor; 1577 } 1578 } 1579 1580 <style> 1581 .bottombar { 1582 background-color: @BottombarBackgroundColor; 1583 } 1584 .bottombar__button span { 1585 color: @BottombarTextColor; 1586 } 1587 .bottombar__button [class^=fa], 1588 .bottombar__button [class^=svg-] { 1589 color: @BottombarIconColor; 1590 } 1591 </style> 1592 1593 <section id="vue-modal" 1594 data-show-prices="@displayPrices.ToString().ToLower()" 1595 data-show-zero-prices="@ShowZeroPrices"> 1596 </section> 1597 1598 <section id="vue-bottom-bar" 1599 data-items="@bottomBarItemsJson" 1600 data-phonenumber="@formattedPhonenumber" 1601 data-isoffline="@isOffline" 1602 data-emailadress="@emailadress" 1603 data-currentpageid="@homepage.ID" 1604 data-enable-login="@enableLogin" 1605 data-enable-shoppingcart="@enableShoppingCart" 1606 data-enable-advancedsearch="@enableAdvancedSearch"></section> 1607 1608 @{ 1609 int SearchPageID = Bluedesk.Tools.DynamicWeb.Generic.PageHelper.GetPageIDByNavigationTag("searchresults", Pageview.AreaID); 1610 var SearchPlaceholder = Translate("Searchbox.PlaceholderValue", "Search..."); 1611 var SearchPlaceholderHover = Translate("Search.PlaceholderValue2", "Zoekt u misschien een ...?"); 1612 var SearchPrefill = Dynamicweb.Context.Current.Request["q"]; 1613 var SearchboxClass = !string.IsNullOrWhiteSpace(SearchPrefill) ? "open" : ""; 1614 var SearchtoggleClass = !string.IsNullOrWhiteSpace(SearchPrefill) ? "close" : ""; 1615 } 1616 1617 <section class="bottombar__searchbox__wrapper"> 1618 <form class="searchbox__form" method="get" action="/Default.aspx" style="display: flex; flex-grow: 1;"> 1619 <input type="text" name="q" value="@SearchPrefill" class="searchbox__input" placeholder="@SearchPlaceholder" aria-label="Search through site content" data-placeholder="@SearchPlaceholder" data-hoverplaceholder="@SearchPlaceholderHover" style="display: flex; flex-grow: 1;" /> 1620 <div class="searchbox__button"> 1621 <button type="submit" class="searchbox__form__submit icon icon--medium icon__search input__icon" aria-label="Search"> 1622 <i class="fal fa-search"></i> 1623 </button> 1624 </div> 1625 <input type="hidden" name="ID" value="@SearchPageID" /> 1626 </form> 1627 1628 </section> 1629 1630 @using Dynamicweb.Rendering 1631 @using Dynamicweb.Security.UserManagement 1632 1633 @{ 1634 UserImpersonation impersonationMode = User.ImpersonationMode; 1635 User currentUser = Pageview.User; 1636 User secondaryUser = Pageview.User?.CurrentSecondaryUser ?? null; 1637 bool isImpersonating = Pageview.User?.CurrentSecondaryUser != null; 1638 int impersonationPageId = GetPageIdByNavigationTag("CustomerImpersonation"); 1639 1640 if(isImpersonating && impersonationMode == UserImpersonation.Full) { 1641 currentUser = Pageview.User.CurrentSecondaryUser; 1642 secondaryUser = Pageview.User; 1643 } 1644 } 1645 1646 @if(currentUser != null && currentUser.GetUsersICanSetAsSecondary().Count > 0) 1647 { 1648 <div class="impersonation"> 1649 <div class="impersonation__header"> 1650 <p class="impersonation__title"> 1651 @Translate("Impersonate.Modal.Title", "Impersonation") 1652 @if (isImpersonating) 1653 { 1654 <span title="On" class="impersonation__indicator"></span> 1655 } 1656 </p> 1657 <i class="fal fa-chevron-up impersonation__header-icon"></i> 1658 </div> 1659 <div class="impersonation__body"> 1660 @if (isImpersonating) 1661 { 1662 <p>@string.Format(Translate("Impersonate.CurrentImpersonation", "You ({0}) are currently impersonating {1}"), string.Format("<strong>{0}</strong>", currentUser.UserName), string.Format("<strong>{0}</strong>", secondaryUser.UserName))</p> 1663 1664 <form method="post" name="stopImpersonation"> 1665 <input name="DwExtranetRemoveSecondaryUser" id="DwExtranetRemoveSecondaryUser" type="hidden"> 1666 <div class="mt-4"> 1667 <button class="btn btn__primary" type="submit"> 1668 <span class="btn__text">@Translate("Impersonate.StopBtn", "Stop impersonation")</span> 1669 <i class="fas fa-ban btn__icon"></i> 1670 </button> 1671 </div> 1672 </form> 1673 } else { 1674 <p>@Translate("Impersonate.Modal.Content", "Take a look at the list of customers you can impersonate.")</p> 1675 <div class="w-full flex mt-2"> 1676 <a href="Default.aspx?ID=@impersonationPageId" class="btn btn__primary"> 1677 <span class="btn__text">@Translate("Impersonate.Modal.ViewList", "View List")</span> 1678 <i class="fal fa-chevron-right btn__icon"></i> 1679 </a> 1680 </div> 1681 } 1682 </div> 1683 </div> 1684 } 1685 1686 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 1687 @using System; 1688 @using Dynamicweb; 1689 @using Dynamicweb.Ecommerce.CustomerExperienceCenter.Favorites; 1690 1691 @{ 1692 var favListService = new FavoriteListService(); 1693 IEnumerable<FavoriteList> favoriteLists = Pageview.User != null ? favListService.GetLists(Pageview.User.ID) : null; 1694 int favoritelistsPageId = GetPageIdByNavigationTag("CustomerFavorites"); 1695 } 1696 1697 @if(favoriteLists != null && Pageview.User != null) 1698 { 1699 <div class="offcanvas__backdrop" name="favoritelist"></div> 1700 <aside class="offcanvas" data-listcount="@favoriteLists.Count()" name="favoritelist"> 1701 <header class="offcanvas__header"> 1702 <span class="offcanvas__title">@Translate("OffCanvasMenu.FavoritesTitle", "Add to favorite list")</span> 1703 <button class="offcanvas__close" aria-label="@Translate("OffCanvasMenu.Close", "Close menu")"> 1704 <i class="fal fa-times"></i> 1705 </button> 1706 </header> 1707 <div class="offcanvas__body"> 1708 <p>@Translate("OffCanvasMenu.FavoritesContent", "Select the list you want to add the product to")</p> 1709 <ul class="favorites__list"> 1710 @foreach(FavoriteList list in favoriteLists) { 1711 <li class="favorites__list-item" data-listid="@list.ListId"> 1712 <span class="favorites__list-itemname">@list.Name</span> 1713 <i class="fas fa-plus"></i> 1714 </li> 1715 } 1716 </ul> 1717 </div> 1718 <footer class="offcanvas__footer"> 1719 <a href="/Default.aspx?ID=@favoritelistsPageId" class="btn btn__primary"> 1720 <span class="btn__text">@Translate("OffCanvasMenu.FavoritesManageLists", "Manage lists")</span> 1721 <i class="far fa-chevron-right btn__icon"></i> 1722 </a> 1723 </footer> 1724 </aside> 1725 } 1726 1727 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 1728 @using System; 1729 @using Dynamicweb; 1730 1731 @{ 1732 string currentWebsiteUrl = Dynamicweb.Environment.Helpers.LinkHelper.GetHttpDomain().Replace("https://", "").Replace("http://", ""); 1733 string redirectUrl = "www.pronails.nl"; 1734 } 1735 1736 <div class="popup__backdrop" name="language-popup"></div> 1737 1738 <div class="popup popup--content-centered" name="language-popup"> 1739 <div class="popup__innerwrapper"> 1740 <button class="popup__close languagemodal__close"> 1741 <i class="fal fa-times cross"></i> 1742 </button> 1743 <header class="popup__header"> 1744 <h2 class="popup__title">@Translate("LanguageSwitchModal.Title", "Hi Beautify Professional")</h2> 1745 </header> 1746 <div class="popup__body"> 1747 <p>@string.Format(Translate("LanguageSwitchModal.Current", "Now you've reached the website {0}."), currentWebsiteUrl)</p> 1748 <p>@string.Format(Translate("LanguageSwitchModal.Redirect", "Do you want to switch to the website {0} that is more relevant to your country?"), $"<span class='languagemodal__redirecturl'>{redirectUrl}</span>")</p> 1749 </div> 1750 <div class="popup__footer"> 1751 <a href="@redirectUrl" class="btn btn__contrast popup__btn languagemodal__btn"> 1752 <span class="btn__text">@Translate("LanguageSwitchModal.Button", "Yes, I want to switch")</span> 1753 <i class="btn__icon fal fa-chevron-right"></i> 1754 </a> 1755 </div> 1756 </div> 1757 </div> 1758 1759 1760 <div id="backdrop"></div> 1761 1762 <script src="@appbundlejs"></script> 1763 <script defer src="@vuebundlejs"></script> 1764 <script defer src="@appAsyncbundlejs"></script> 1765 1766 @if (font_configuration != null) 1767 { 1768 foreach (var item in font_configuration.Item.ToCodeFirstItem<Bluedesk.DynamicWeb.ItemTypes.Pages.ConfigurationPagesParent>().GetChildConfigs<FontConfiguration>()) 1769 { 1770 if (item["FontLink"] != null) 1771 { 1772 string fontName = item["FontName"].ToString(); 1773 string cssFile = $"files/Templates/Designs/Backyard/GoogleFont/{fontName.Replace(" ", "")}/{fontName.Replace(" ", "")}.css"; 1774 <link href="@cssFile" rel="stylesheet"> 1775 } 1776 } 1777 } 1778 1779 <link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.15.4/css/all.css" integrity="sha384-rqn26AG5Pj86AF4SO72RK5fyefcQ/x32DNQfChxWvbXIyXFePlEktwD18fEz+kQU" crossorigin="anonymous"> 1780 1781 @if (isVisualEditor && IsNotContentManager) 1782 { 1783 1784 <style> 1785 body { 1786 background-color: #f1f1f1; 1787 font-family: 'Barlow', sans-serif; 1788 } 1789 1790 .slidePanel { 1791 position: fixed; 1792 top: 0; 1793 bottom: 0; 1794 min-width: 500px; 1795 box-shadow: -10px 10px 10px rgb(153 153 255 / 10%); 1796 background-color: #FFFFFF; 1797 z-index: 1000; 1798 box-sizing: border-box; 1799 transition: all .5s ease-in; 1800 } 1801 1802 .slidePanel.open { 1803 right: 0; 1804 } 1805 1806 .slidePanel { 1807 right: -500px; 1808 transition: all 0.5s ease-in; 1809 } 1810 1811 .slidePanel__container { 1812 display: flex; 1813 position: relative; 1814 height: 100%; 1815 } 1816 1817 .togglePanelButton { 1818 position: fixed; 1819 top: 50px; 1820 left: 50px; 1821 display: flex; 1822 justify-content: center; 1823 align-items: center; 1824 color: white; 1825 background-color: black; 1826 padding: 0px 25px; 1827 height: 50px; 1828 cursor: pointer; 1829 z-index: 1000; 1830 } 1831 1832 .closeButton { 1833 position: absolute; 1834 display: flex; 1835 top: 25px; 1836 right: 25px; 1837 font-size: 2rem; 1838 text-decoration: none; 1839 color: black; 1840 } 1841 1842 .blur { 1843 filter: blur(4px); 1844 pointer-events: none; 1845 } 1846 1847 .sideMenu { 1848 display: flex; 1849 position: absolute; 1850 align-items: center; 1851 min-height: 100px; 1852 z-index: 1200; 1853 top: 0; 1854 bottom: 0; 1855 right: 100%; 1856 flex-direction: column; 1857 justify-content: center; 1858 } 1859 1860 .sideMenu__link:first-child { 1861 margin-top: 10px; 1862 } 1863 1864 .sideMenu__link { 1865 position: relative; 1866 flex-direction: column; 1867 display: flex; 1868 height: 50px; 1869 width: 50px; 1870 background-color: #f1f1f1; 1871 margin-bottom: 10px; 1872 margin-left: 10px; 1873 margin-right: 10px; 1874 justify-content: space-between; 1875 align-items: center; 1876 font-size: 10px; 1877 padding: 10px; 1878 box-sizing: border-box; 1879 text-decoration: none; 1880 color: rgb(22, 101, 123); 1881 font-size: 24px; 1882 } 1883 .sideMenu__link:hover { 1884 background-color: #c9c9c9; 1885 color: white; 1886 transition: all ease-in 0.5s; 1887 } 1888 .sideMenu__link label { 1889 font-size: 12px; 1890 } 1891 1892 .sideMenu__container { 1893 display: flex; 1894 position: relative; 1895 flex-direction: column; 1896 box-shadow: -10px 10px 10px rgb(153 153 255 / 10%); 1897 background-color: white; 1898 } 1899 1900 .toolbar.close { 1901 display: none; 1902 } 1903 1904 #toolbarVE { 1905 position: fixed !important; 1906 z-index: 100; 1907 background-color: #CCC; 1908 border: 2px solid #F1F1F1; 1909 text-align: center; 1910 right: 0px; 1911 top: 300px; 1912 } 1913 1914 #toolbarVEHeader { 1915 padding: 10px; 1916 cursor: move; 1917 z-index: 10; 1918 background-color: #6e6e6e; 1919 color: #fff; 1920 } 1921 </style> 1922 1923 <div class="toolbarVE" id="toolbar" style="top: 150px; left: auto; width: 70px; position: fixed !important; right: 0px !important; "> 1924 <div id="toolbarVEHeader"> 1925 <a href="javascript:void(0);" onclick="toggleClass('.toolbar', 'close');" style="color: #FFF;"><i class="icon fa-light fa-circle-xmark"></i></a> 1926 </div> 1927 <section class="sideMenu__container"> 1928 <a href="javascript:history.back();" class="sideMenu__link"><i class="icon fa-light fa-reply"></i></a> 1929 <a href="/dashboard-configuration" class="sideMenu__link"><i class="icon fa-light fa-grid-horizontal"></i></a> 1930 <a href="/button-configuration" class="sideMenu__link"><i class="icon fa-light fa-diagram-cells"></i></a> 1931 <a href="/button-configuration" class="sideMenu__link"><i class="icon fa-light fa-link"></i></a> 1932 <a href="/background-configuration" class="sideMenu__link"><i class="icon fa-light fa-paintbrush"></i></a> 1933 <a href="/jumbotron-configuration" class="sideMenu__link"><i class="icon fa-light fa-megaphone"></i></a> 1934 <a href="/theme-configuration-page/theme-01" class="sideMenu__link"><i class="icon fa-light fa-brush"></i></a> 1935 <a href="/font-configuration" class="sideMenu__link"><i class="icon fa-light fa-font"></i></a> 1936 <a href="/device-manager" class="sideMenu__link"><i class="icon fa-light fa-computer"></i></a> 1937 </section> 1938 </div> 1939 1940 <script> 1941 function toggleClass(ClassName, AddedClassName) { 1942 var element = document.querySelector(ClassName); 1943 if (element.classList.contains(AddedClassName)) { 1944 element.classList.remove(AddedClassName); 1945 } else { 1946 element.classList.add(AddedClassName); 1947 } 1948 } 1949 </script> 1950 1951 <script> 1952 //Make the DIV element draggagle: 1953 dragElement(document.getElementById("toolbar")); 1954 1955 function dragElement(elmnt) { 1956 var pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0; 1957 if (document.getElementById(elmnt.id + "Header")) { 1958 /* if present, the header is where you move the DIV from:*/ 1959 document.getElementById(elmnt.id + "Header").onmousedown = dragMouseDown; 1960 } else { 1961 /* otherwise, move the DIV from anywhere inside the DIV:*/ 1962 elmnt.onmousedown = dragMouseDown; 1963 } 1964 1965 function dragMouseDown(e) { 1966 e = e || window.event; 1967 e.preventDefault(); 1968 // get the mouse cursor position at startup: 1969 pos3 = e.clientX; 1970 pos4 = e.clientY; 1971 document.onmouseup = closeDragElement; 1972 // call a function whenever the cursor moves: 1973 document.onmousemove = elementDrag; 1974 } 1975 1976 function elementDrag(e) { 1977 e = e || window.event; 1978 e.preventDefault(); 1979 // calculate the new cursor position: 1980 pos1 = pos3 - e.clientX; 1981 pos2 = pos4 - e.clientY; 1982 pos3 = e.clientX; 1983 pos4 = e.clientY; 1984 // set the element's new position: 1985 elmnt.style.top = (elmnt.offsetTop - pos2) + "px"; 1986 elmnt.style.left = (elmnt.offsetLeft - pos1) + "px"; 1987 } 1988 1989 function closeDragElement() { 1990 /* stop moving when mouse button is released:*/ 1991 document.onmouseup = null; 1992 document.onmousemove = null; 1993 } 1994 } 1995 </script> 1996 1997 @*<section class="slidePanel" id="slidePanel"> 1998 1999 <div class="slidePanel__container"> 2000 2001 <a href="javasciprt:void(0);" onclick="toggleClass('.slidePanel', 'open'); toggleClass('main', 'blur')" class="closeButton"> 2002 <i class="fal fa-circle-xmark"></i> 2003 </a> 2004 2005 2006 <nav class="sideMenu" id="sideMenu"> 2007 2008 <section class="sideMenu__container"> 2009 <a href="javascript:history.back();" class="sideMenu__link"><i class="fal fa-reply"></i></a> 2010 <a href="/dashboard-configuration" class="sideMenu__link"><i class="fal fa-grid-horizontal"></i></a> 2011 <a href="/button-configuration" class="sideMenu__link"><i class="fal fa-diagram-cells"></i></a> 2012 <a href="/button-configuration" class="sideMenu__link"><i class="fal fa-link"></i></a> 2013 <a href="/background-configuration" class="sideMenu__link"><i class="fal fa-paintbrush"></i></a> 2014 <a href="/jumbotron-configuration" class="sideMenu__link"><i class="fal fa-megaphone"></i></a> 2015 <a href="/theme-configuration-page/theme-01" class="sideMenu__link"><i class="fal fa-brush"></i></a> 2016 <a href="/font-configuration" class="sideMenu__link"><i class="fal fa-font"></i></a> 2017 <a href="/device-manager" class="sideMenu__link"><i class="fal fa-computer"></i></a> 2018 </section> 2019 </nav> 2020 2021 </div> 2022 2023 </section>*@ 2024 2025 <script src="https://kit.fontawesome.com/a46eca85e2.js" crossorigin="anonymous"></script> 2026 2027 } 2028 2029 2030 </body> 2031 </html> 2032 2033 @helper RenderAcademyButton(ButtonConfiguration ButtonConfiguration, string btnLink, string btnClass, string btnText, string ariaLabel = "", bool newWindow = false, string btnIcon = "", string btnExtraClass = "", string btnTextClass = "", string btnIconClass = "") 2034 { 2035 string buttonID = ButtonConfiguration.Id; 2036 var master_configuration = Dynamicweb.Content.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "MasterConfiguration"); 2037 MasterConfig mc = master_configuration.Item.ToCodeFirstItem<MasterConfig>(); 2038 2039 string FontAwesomeLibrary = mc.GeneralConfiguration.fontawesomeStyle; 2040 bool HideIcon = ButtonConfiguration.HideIcon; 2041 string CustomIconClass = !string.IsNullOrWhiteSpace(ButtonConfiguration.CustomIcon) ? ButtonConfiguration.CustomIcon : !string.IsNullOrWhiteSpace(btnIcon) ? btnIcon : "fa-chevron-up"; 2042 string IconPositionClass = HideIcon ? "default-btn--no-icon" : mc.GeneralConfiguration.IconPosition == "left" ? "default-btn--icon-left" : ""; 2043 2044 string target = newWindow ? "_blank" : "_self"; 2045 string ariaText = !string.IsNullOrWhiteSpace(ariaLabel) ? "aria-label='" + ariaLabel + "'" : ""; 2046 2047 string styleBlock = GenerateButtonConfigVariables(ButtonConfiguration, mc, Pageview.AreaID); 2048 2049 if(string.IsNullOrWhiteSpace(btnLink)) { 2050 btnLink = "#signup"; 2051 } 2052 2053 if (!string.IsNullOrWhiteSpace(btnLink) && !string.IsNullOrWhiteSpace(btnText)) 2054 { 2055 <a href="@btnLink" class="btn default-btn default-btn--@buttonID @IconPositionClass @btnClass @btnExtraClass" target="@target" @ariaText style="@styleBlock"> 2056 <span class="btn__text @btnTextClass">@btnText</span> 2057 @if (!HideIcon) 2058 { 2059 <i class="btn__icon @FontAwesomeLibrary @CustomIconClass @btnIconClass"></i> 2060 } 2061 </a> 2062 } 2063 } 2064 2065 @functions { 2066 public string GenerateButtonConfigVariables(ButtonConfiguration BC, MasterConfig mc, int areaId) 2067 { 2068 var btnStyleBlock = new System.Text.StringBuilder(); 2069 btnStyleBlock.Append(GenerateCssVar("BackgroundColor", BC.ButtonColorConfiguration.BackgroundColor.GetColorCode(areaId))); 2070 2071 return btnStyleBlock.ToString(); 2072 } 2073 2074 public string GenerateCssVar(string name, string value) 2075 { 2076 if (!string.IsNullOrWhiteSpace(value)) { 2077 return $"--{name}: {value};"; 2078 } else { 2079 return ""; 2080 } 2081 } 2082 } 2083