Error executing template "Designs/Rapido/_parsed/CaseArticle.parsed.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_2d04d18042ba431fa47faf46f80cd3cf.Execute() in D:\dynamicweb.net\Solutions\Pilaro\karljensen.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\_parsed\CaseArticle.parsed.cshtml:line 786
   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.b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 2 3 @using Dynamicweb.Frontend.Devices 4 @using Dynamicweb.Extensibility 5 @using Dynamicweb.Content 6 @using Dynamicweb.Security 7 @using System 8 @using System.Linq 9 @using System.Web 10 @using System.IO 11 12 @{ 13 //General settings 14 string favicon = Model.Area.Item.GetFile("LogoFavicon") != null ? Model.Area.Item.GetFile("LogoFavicon").Path : "/Files/Images/favicon.png"; 15 string logo = Model.Area.Item.GetFile("LogoImage") != null ? Model.Area.Item.GetFile("LogoImage").Path : "/Files/Images/logo-dynamicweb.png"; 16 if (Path.GetExtension(logo).ToLower() != ".svg") 17 { 18 logo = "/Admin/Public/GetImage.ashx?height=60&amp;crop=5&amp;Compression=75&amp;image=" + @logo; 19 } 20 string searchPlaceholder = Translate("Search products", "Search products"); 21 string searchValue = HttpContext.Current.Request.QueryString.Get("Search") != null ? HttpContext.Current.Request.QueryString.Get("Search") : ""; 22 string wireframeMode = Model.Area.Item.GetBoolean("WireframeMode").ToString(); 23 24 //Font settings 25 string navigationFont = Model.Area.Item.GetItem("NavigationFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 26 string mobileNavigationFont = Model.Area.Item.GetItem("MobileNavigationFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 27 string headerFont = Model.Area.Item.GetItem("ContentLayoutHeaderFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 28 string subHeaderFont = Model.Area.Item.GetItem("ContentLayoutSubheaderFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 29 string contentFont = Model.Area.Item.GetItem("ContentLayoutBodyText").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 30 string newStickersFont = Model.Area.Item.GetItem("NewStickersFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 31 string customStickersFont = Model.Area.Item.GetItem("CustomStickersFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 32 string toolsMenuFont = Model.Area.Item.GetItem("ToolsMenuFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 33 34 //Page IDs for use in the template 35 int pageId = Model.TopPage.ID; 36 string firstPageId = Model.Area.FirstActivePage.ID.ToString(); 37 int cartPageId = GetPageIdByNavigationTag("CartPage"); 38 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 39 int cartFeedPageId = GetPageIdByNavigationTag("CartOrderlinesFeed"); 40 int productsPageId = GetPageIdByNavigationTag("ProductsPage"); 41 int productsSearchFeedId = /*GetPageIdByNavigationTag("ProductsSearchPage"); // */ productsPageId; 42 int productGroupsPageId = GetPageIdByNavigationTag("ProductGroupsFeed"); 43 int impersonationPageId = GetPageIdByNavigationTag("Impersonation"); 44 45 bool stickyMenu = Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet" ? false : Model.Area.Item.GetBoolean("NavigationStickyMenu"); 46 string stickyTop = stickyMenu ? "top-container--sticky" : ""; 47 string pagePos = stickyMenu ? "js-page-pos" : ""; 48 string topLayout = Model.Area.Item.GetList("LayoutTop").SelectedValue; 49 bool renderPagesInToolBar = Model.Area.Item.GetBoolean("RenderPagesInToolBar"); 50 string toolbarText = Model.Area.Item.GetString("ToolbarText"); 51 bool onlyPreview = Model.Area.Item.GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 52 53 string autoCssLink = "/Files/Templates/Designs/Rapido/css/rapido/rapido_" + Model.Area.ID.ToString() + ".min.css?ticks=" + Model.Area.UpdatedDate.Ticks; 54 55 string userInitials = ""; 56 if (Model.CurrentUser.ID != 0) 57 { 58 if (!String.IsNullOrEmpty(Model.CurrentUser.Name)) 59 { 60 string[] names = Model.CurrentUser.Name.Split(' '); 61 userInitials += Model.CurrentUser.Name.Substring(0, 1); 62 63 if (names.Length > 1) 64 { 65 if(!string.IsNullOrEmpty(names[names.Length - 1])){ 66 userInitials += names[names.Length - 1].Substring(0, 1); 67 } 68 69 } 70 } 71 else 72 { 73 userInitials += Model.CurrentUser.FirstName != null && Model.CurrentUser.FirstName != "" ? Model.CurrentUser.FirstName.Substring(0, 1) : ""; 74 userInitials += Model.CurrentUser.LastName != null && Model.CurrentUser.LastName != "" ? Model.CurrentUser.LastName.Substring(0, 1) : ""; 75 userInitials += userInitials.Length == 1 && Model.CurrentUser.FirstName != null && Model.CurrentUser.FirstName.Length > 1 ? Model.CurrentUser.FirstName.Substring(1, 2) : ""; 76 userInitials += userInitials == "" && Model.CurrentUser.Email != null && Model.CurrentUser.Email.Length > 1 ? Model.CurrentUser.Email.Substring(0, 2) : ""; 77 userInitials += userInitials == "" ? Model.CurrentUser.UserName.Substring(0, 2) : ""; 78 } 79 } 80 81 string siteURL = Dynamicweb.Context.Current.Request.Url.Scheme + "://" + Dynamicweb.Context.Current.Request.Url.Host; 82 string businessPhotoPath = Model.Area.Item.GetFile("BusinessPhoto") != null ? Model.Area.Item.GetFile("BusinessPhoto").Path : ""; 83 string businessName = Model.Area.Item.GetString("BusinessName"); 84 var address = Model.Area.Item.GetItem("Address"); 85 string streetAddress = ""; 86 string addressLocality = ""; 87 string addressRegion = ""; 88 string postalCode = ""; 89 string addressCountry = ""; 90 if (address != null) 91 { 92 streetAddress = address.GetString("StreetAddress"); 93 addressLocality = address.GetString("City"); 94 addressRegion = address.GetString("Region"); 95 postalCode = address.GetString("PostalCode"); 96 addressCountry = address.GetString("Country"); 97 } 98 string contactEmail = Model.Area.Item.GetString("ContactEmail"); 99 string contactNumber = Model.Area.Item.GetString("ContactNumber"); 100 } 101 <!DOCTYPE html> 102 103 <html lang="@Pageview.Area.CultureInfo"> 104 <head> 105 <meta charset="utf-8" /> 106 <title>@Model.Title</title> 107 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1"> 108 <meta name="robots" content="index, follow"> 109 110 <!-- Google Tag Manager --> 111 <script> 112 (function (w, d, s, l, i) { 113 w[l] = w[l] || []; w[l].push({ 114 'gtm.start': 115 new Date().getTime(), event: 'gtm.js' 116 }); var f = d.getElementsByTagName(s)[0], 117 j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src = 118 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f); 119 })(window, document, 'script', 'dataLayer', 'GTM-MMTZ3GD');</script> 120 <!-- End Google Tag Manager --> 121 <!-- Favicon --> 122 <link href="@favicon" rel="icon" type="image/png"> 123 124 <!-- Font awesome --> 125 <link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/rapido/font-awesome.min.css" type="text/css"> 126 127 <!-- Base (Default, wireframe) styles --> 128 <link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/base/base.min.css" type="text/css"> 129 130 <!-- Rapido Css from Website Settings --> 131 <link id="rapidoCss" rel="stylesheet" href="@autoCssLink" type="text/css"> 132 133 <!-- Ignite Css (Custom site specific styles) --> 134 <link id="igniteCss" type="text/css" href="/Files/Templates/Designs/Rapido/css/ignite/ignite.min.css" rel="stylesheet"> 135 136 <!-- Google fonts --> 137 @{ 138 var fonts = new string[8] { navigationFont, mobileNavigationFont, headerFont, subHeaderFont, contentFont, newStickersFont, customStickersFont, toolsMenuFont }; 139 var family = string.Join("%7C", fonts.Distinct().Select(x => string.Format("{0}:100,200,300,400,500,600,700,800,900", x))); 140 } 141 <link href="https://fonts.googleapis.com/css?family=@family" rel="stylesheet"> 142 143 @if (!string.IsNullOrEmpty(businessPhotoPath) && 144 !string.IsNullOrEmpty(businessName) && 145 !string.IsNullOrEmpty(streetAddress) && 146 !string.IsNullOrEmpty(addressLocality) && 147 !string.IsNullOrEmpty(addressRegion) && 148 !string.IsNullOrEmpty(postalCode) && 149 !string.IsNullOrEmpty(addressCountry)) 150 { 151 <script type="application/ld+json"> 152 { 153 "@@context": "http://schema.org", 154 "@@type": "Store", 155 "image": [ 156 "@siteURL/Admin/Public/GetImage.ashx?width=400&height=400&crop=0&Compression=75&DoNotUpscale=true&image=@businessPhotoPath", 157 "@siteURL/Admin/Public/GetImage.ashx?width=400&height=300&crop=0&Compression=75&DoNotUpscale=true&image=@businessPhotoPath", 158 "@siteURL/Admin/Public/GetImage.ashx?width=448&height=225&crop=0&Compression=75&DoNotUpscale=true&image=@businessPhotoPath" 159 ], 160 "@@id": "@siteURL", 161 "name": "@businessName", 162 "address": { 163 "@@type": "PostalAddress", 164 "streetAddress": "@streetAddress", 165 "addressLocality": "@addressLocality", 166 "addressRegion": "@addressRegion", 167 "postalCode": "@postalCode", 168 "addressCountry": "@addressCountry" 169 } 170 @if (!string.IsNullOrEmpty(contactEmail)) 171 { 172 <text>,"email": "@Model.Area.Item.GetString("ContactEmail")"</text> 173 } 174 @if (!string.IsNullOrEmpty(contactNumber)) 175 { 176 <text>,"telephone": "@Model.Area.Item.GetString("ContactNumber")"</text> 177 } 178 } 179 </script> 180 } 181 </head> 182 183 <body> 184 <!-- Google Tag Manager (noscript) --> 185 <noscript> 186 <iframe src="https://www.googletagmanager.com/ns.html?id=GTM-MMTZ3GD" 187 height="0" width="0" style="display:none;visibility:hidden"></iframe> 188 </noscript> 189 <!-- End Google Tag Manager (noscript) --> 190 191 @MobileNavigation(userInitials) 192 193 @LoginModal() 194 <main class="site dw-mod"> 195 <header class="top-container @stickyTop dw-mod" id="Top"> 196 @if (renderPagesInToolBar && Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 197 { 198 <div class="tools-navigation dw-mod"> 199 <div class="center-container grid top-container__center-container dw-mod"> 200 <div class="grid__cell"> 201 <div class="u-pull--left u-margin-top">@toolbarText</div> 202 <div class="u-pull--right"> 203 @RenderNavigation(new 204 { 205 id = "topToolsNavigation", 206 cssclass = "menu menu-tools dw-mod dwnavigation", 207 template = "TopMenu.xslt" 208 }) 209 </div> 210 </div> 211 </div> 212 </div> 213 } 214 215 @if (topLayout == "normal") 216 { 217 <!-- Header --> 218 <div class="header header-top dw-mod"> 219 <div class="center-container top-container__center-container dw-mod"> 220 <div class="grid"> 221 222 @* Logo *@ 223 @if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 224 { 225 <div class="grid__col-md-3 grid__col-sm-3 grid--align-self-center grid__col--bleed-y"> 226 <div class="logo dw-mod"> 227 <a href="/Default.aspx?ID=@firstPageId"> 228 <img class="grid__cell-img" src="@logo" alt="Logo" /> 229 </a> 230 </div> 231 </div> 232 } 233 @if (Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") 234 { 235 <div class="grid__col-12"> 236 <div class="grid__cell"> 237 <div class="logo u-max-w220px u-middle u-margin-bottom dw-mod"> 238 <a href="/Default.aspx?ID=@firstPageId"> 239 <img class="grid__cell-img" src="@logo" alt="Logo" /> 240 </a> 241 </div> 242 </div> 243 </div> 244 } 245 246 @if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 247 { 248 @* Search *@ 249 <div class="grid__col-6 grid__col--bleed-y grid--align-self-center"> 250 <div class="typeahead u-margin u-color-inherit js-typeahead" data-page-size="10" id="TopProductSearch" data-search-page-id="@productsSearchFeedId&feed=true" data-result-page-id="@productsPageId" data-groups-page-id="@productGroupsPageId"> 251 <button type="button" class="btn btn--condensed u-color-light-gray--bg typeahead-group-btn dw-mod js-typeahead-groups-btn" data-group-id="all">@Translate("All")</button> 252 <ul class="dropdown dropdown--absolute-position js-handlebars-root js-typeahead-groups-content u-min-w220px dw-mod" id="TopProductSearchGroupsContent" data-template="SearchGroupsTemplate" data-json-feed="/Default.aspx?ID=@productGroupsPageId&feedType=productGroups" data-init-onload="false" data-preloader="minimal"></ul> 253 <input type="text" class="typeahead-search-field u-no-margin js-typeahead-search-field" placeholder="@searchPlaceholder" value="@searchValue"> 254 <ul class="dropdown dropdown--absolute-position u-min-w220px u-full-width js-handlebars-root js-typeahead-search-content u-full-width dw-mod" id="TopProductSearchContent" data-template="SearchContentTemplate" data-json-feed="/Default.aspx?ID=@productsSearchFeedId&feedType=productsOnly&feed=true" data-init-onload="false" data-preloader="minimal"></ul> 255 <button type="button" class="btn btn--condensed btn--primary u-no-margin dw-mod js-typeahead-enter-btn"><i class="fa fa-search"></i></button> 256 </div> 257 </div> 258 259 <div class="grid__cell grid__cell--align-middle-right"> 260 <ul class="menu dw-mod u-pull--right"> 261 @RenderSignIn("outsideNavigation", userInitials) 262 @RenderLanguageSelector("outsideNavigation") 263 @RenderFavorites("outsideNavigation") 264 @if (!onlyPreview) 265 { 266 @RenderMiniCart("outsideNavigation") 267 } 268 </ul> 269 </div> 270 } 271 272 @* Mobile search *@ 273 @if (Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") 274 { 275 <div class="grid__col-12 grid__col--bleed-y grid--align-self-center"> 276 <div class="grid__cell"> 277 <div class="js-typeahead" data-page-size="10" id="MobileProductSearch" data-search-page-id="@productsSearchFeedId&feed=true" data-result-page-id="@productsPageId"> 278 <input type="text" class="u-full-width js-typeahead-search-field" placeholder="@searchPlaceholder" value="@searchValue"> 279 <ul class="dropdown dropdown--absolute-position u-min-w220px js-handlebars-root js-typeahead-search-content dw-mod" id="MobileProductSearchContent" data-template="SearchContentTemplate" data-json-feed="/Default.aspx?ID=@productsSearchFeedId&feedType=productsOnly&feed=true" data-init-onload="false"></ul> 280 </div> 281 </div> 282 </div> 283 } 284 </div> 285 </div> 286 </div> 287 288 <!-- Main navigation --> 289 <nav class="main-navigation dw-mod"> 290 <div class="center-container top-container__center-container dw-mod"> 291 <div class="grid"> 292 <div class="grid__col-12 grid--align-self-center grid__col--bleed"> 293 <div class="grid__cell"> 294 @MobileNavigationTrigger() 295 @RenderHeaderNavigation() 296 297 @if ((Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") && !onlyPreview) 298 { 299 <ul class="menu dw-mod u-pull--right"> 300 @RenderMiniCart() 301 </ul> 302 } 303 </div> 304 </div> 305 </div> 306 </div> 307 </nav> 308 } 309 310 @if (topLayout == "splitted") 311 { 312 <!-- Header --> 313 <div class="header header-top dw-mod"> 314 <div class="center-container top-container__center-container dw-mod"> 315 <div class="grid"> 316 317 @* Logo *@ 318 @if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 319 { 320 <div class="grid__col-md-3 grid__col-sm-3 grid--align-self-center grid__col--bleed-y"> 321 <div class="logo dw-mod"> 322 <a href="/Default.aspx?ID=@firstPageId"> 323 <img class="grid__cell-img" src="@logo" alt="Logo" /> 324 </a> 325 </div> 326 </div> 327 } 328 else 329 { 330 <div class="grid__col-xs-6"> 331 <div class="grid__cell"> 332 <div class="logo u-max-w220px dw-mod"> 333 <a href="/Default.aspx?ID=@firstPageId"> 334 <img class="grid__cell-img" src="@logo" alt="Logo" /> 335 </a> 336 </div> 337 </div> 338 </div> 339 } 340 341 @if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 342 { 343 @* Search *@ 344 <div class="grid__cell grid__cell--align-middle-right"> 345 <div class="grid__col-sm-8 grid__col--bleed"> 346 <div class="typeahead u-margin u-color-inherit js-typeahead" data-page-size="10" id="TopProductSearch" data-search-page-id="@productsSearchFeedId&feed=true" data-result-page-id="@productsPageId" data-groups-page-id="@productGroupsPageId"> 347 <button type="button" class="btn btn--condensed u-color-light-gray--bg typeahead-group-btn dw-mod js-typeahead-groups-btn" data-group-id="all">@Translate("All")</button> 348 <ul class="dropdown dropdown--absolute-position u-min-w220px js-handlebars-root js-typeahead-groups-content dw-mod" id="TopProductSearchGroupsContent" data-template="SearchGroupsTemplate" data-json-feed="/Default.aspx?ID=@productGroupsPageId&feedType=productGroups" data-init-onload="false" data-preloader="minimal"></ul> 349 <input type="text" class="typeahead-search-field u-no-margin js-typeahead-search-field" placeholder="@searchPlaceholder" value="@searchValue"> 350 <ul class="dropdown dropdown--absolute-position u-min-w220px u-full-width js-handlebars-root js-typeahead-search-content u-full-width dw-mod" id="TopProductSearchContent" data-template="SearchContentTemplate" data-json-feed="/Default.aspx?ID=@productsSearchFeedId&feedType=productsOnly&feed=true" data-init-onload="false" data-preloader="minimal"></ul> 351 <button type="button" class="btn btn--condensed btn--primary u-no-margin dw-mod js-typeahead-enter-btn"><i class="fa fa-search"></i></button> 352 </div> 353 </div> 354 </div> 355 } 356 else 357 { 358 @* Mobile search *@ 359 <div class="grid__col-xs-6"> 360 <div class="grid__cell"> 361 <div class="js-typeahead" data-page-size="10" id="MobileProductSearch" data-search-page-id="@productsSearchFeedId&feed=true" data-result-page-id="@productsPageId"> 362 <input type="text" class="u-full-width js-typeahead-search-field u-no-margin" placeholder="@searchPlaceholder" value="@searchValue"> 363 <ul class="dropdown dropdown--absolute-position u-min-w220px js-handlebars-root js-typeahead-search-content dw-mod" id="MobileProductSearchContent" data-template="SearchContentTemplate" data-json-feed="/Default.aspx?ID=@productsSearchFeedId&feedType=productsOnly&feed=true" data-init-onload="false"></ul> 364 </div> 365 </div> 366 </div> 367 } 368 </div> 369 </div> 370 </div> 371 372 <!-- Main navigation --> 373 <nav class="main-navigation dw-mod"> 374 <div class="center-container top-container__center-container dw-mod"> 375 <div class="grid"> 376 <div class="u-pull--left"> 377 @MobileNavigationTrigger() 378 @RenderHeaderNavigation() 379 </div> 380 <div class="grid__cell grid__cell--align-middle-right"> 381 <ul class="menu dw-mod u-pull--right"> 382 @if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 383 { 384 @RenderSignIn("inNavigation", userInitials) 385 @RenderLanguageSelector() 386 @RenderFavorites() 387 } 388 @if (!onlyPreview) 389 { 390 @RenderMiniCart() 391 } 392 </ul> 393 </div> 394 </div> 395 </div> 396 </nav> 397 } 398 399 @if (topLayout == "condensed") 400 { 401 <!-- Main navigation --> 402 <nav class="main-navigation dw-mod"> 403 <div class="center-container top-container__center-container dw-mod"> 404 <div class="grid"> 405 406 <div class="grid__col-md-3 grid--align-self-center grid__col--bleed-y"> 407 <div class="logo u-padding--xs dw-mod"> 408 <a href="/Default.aspx?ID=@firstPageId"> 409 <img class="grid__cell-img" src="@logo" alt="Logo" /> 410 </a> 411 </div> 412 </div> 413 414 @* Navigation *@ 415 <div class="u-pull--left"> 416 @MobileNavigationTrigger() 417 @RenderHeaderNavigation() 418 </div> 419 420 <div class="grid__cell grid__cell--align-middle-right"> 421 <ul class="menu dw-mod u-pull--right"> 422 @RenderSignIn("inNavigation", userInitials) 423 @RenderLanguageSelector() 424 @RenderFavorites() 425 @if (!onlyPreview) 426 { 427 @RenderMiniCart() 428 } 429 </ul> 430 </div> 431 </div> 432 </div> 433 </nav> 434 435 <!-- Searchbar --> 436 <div class="u-box-shadow u-color-light-gray--bg u-inline-block u-full-width"> 437 <div class="center-container top-container__center-container dw-mod"> 438 <div class="typeahead typeahead--centered u-color-inherit js-typeahead dw-mod" data-page-size="10" id="ProductSearchBar" data-search-page-id="@productsSearchFeedId&feed=true" data-result-page-id="@productsPageId" data-groups-page-id="@productGroupsPageId"> 439 <button type="button" class="btn btn--condensed u-color-light-gray--bg typeahead-group-btn dw-mod js-typeahead-groups-btn" data-group-id="all">@Translate("All")</button> 440 <ul class="dropdown dropdown--absolute-position u-min-w220px js-handlebars-root js-typeahead-groups-content dw-mod" id="ProductSearchBarGroupsContent" data-template="SearchGroupsTemplate" data-json-feed="/Default.aspx?ID=@productGroupsPageId&feedType=productGroups" data-init-onload="false" data-preloader="minimal"></ul> 441 <div class="typeahead-search-field"> 442 <input type="text" class="u-no-margin u-full-width js-typeahead-search-field" placeholder="@searchPlaceholder" value="@searchValue"> 443 <ul class="dropdown dropdown--absolute-position u-min-w220px u-full-width js-handlebars-root js-typeahead-search-content dw-mod" id="ProductSearchBarContent" data-template="SearchContentTemplate" data-json-feed="/Default.aspx?ID=@productsSearchFeedId&feedType=productsOnly&feed=true" data-init-onload="false"></ul> 444 </div> 445 <button type="button" class="btn btn--condensed btn--primary u-no-margin dw-mod js-typeahead-enter-btn"><i class="fa fa-search"></i></button> 446 </div> 447 </div> 448 </div> 449 } 450 @if (topLayout == "minimal") 451 { 452 <!-- Main navigation --> 453 <nav class="main-navigation dw-mod"> 454 <div class="center-container top-container__center-container dw-mod"> 455 <div class="grid"> 456 457 <div class="grid__col-md-3 grid--align-self-center grid__col--bleed-y"> 458 <div class="logo u-padding--xs dw-mod"> 459 <a href="/Default.aspx?ID=@firstPageId"> 460 <img class="grid__cell-img" src="@logo" alt="Logo" /> 461 </a> 462 </div> 463 </div> 464 465 @* Navigation *@ 466 <div class="u-pull--left"> 467 @MobileNavigationTrigger() 468 @RenderHeaderNavigation() 469 </div> 470 471 @{ 472 var searchBarWidthClass = "u-w340px"; 473 474 if (Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") 475 { 476 searchBarWidthClass = "u-w250px"; 477 } 478 } 479 480 <div class="grid__cell grid__cell--align-middle-right"> 481 <ul class="menu dw-mod u-pull--right"> 482 @* Search *@ 483 <li class="menu__item menu__item--horizontal menu__item--top-level dw-mod"> 484 <div class="menu__link u-w50px is-dropdown is-dropdown--no-icon dw-mod"> 485 <i class="fa fa-search fa-1_5x"></i> 486 <div class="menu menu--dropdown @searchBarWidthClass top-micro-search dw-mod"> 487 <div class="typeahead js-typeahead" data-page-size="10" id="ProductSearchBar" data-search-page-id="@productsSearchFeedId&feed=true" data-result-page-id="@productsPageId" data-groups-page-id="@productGroupsPageId"> 488 <div class="typeahead-search-field"> 489 <input type="text" class="u-no-margin u-full-width js-typeahead-search-field" placeholder="@searchPlaceholder" value="@searchValue"> 490 <ul class="dropdown dropdown--absolute-position u-min-w220px u-full-width js-handlebars-root js-typeahead-search-content" id="ProductSearchBarContent" data-template="SearchContentTemplate" data-json-feed="/Default.aspx?ID=@productsSearchFeedId&feedType=productsOnly&feed=true" data-init-onload="false" data-preloader="minimal"></ul> 491 </div> 492 </div> 493 </div> 494 </div> 495 </li> 496 @RenderSignIn("inNavigation", userInitials) 497 @RenderLanguageSelector() 498 @RenderFavorites() 499 @if (!onlyPreview) 500 { 501 @RenderMiniCart() 502 } 503 </ul> 504 </div> 505 </div> 506 </div> 507 </nav> 508 } 509 510 @* Impersonation bar *@ 511 @if (Model.CurrentUser.ID > 0 && Model.SecondaryUsers.Count > 0) 512 { 513 <div class="u-color-warning--bg"> 514 <div class="center-container top-container__center-container dw-mod"> 515 @*Impersonation*@ 516 <div class="grid"> 517 <div class="grid--align-self-center grid__col-x"> 518 @if (Model.CurrentSecondaryUser != null && Model.CurrentSecondaryUser.ID > 0) 519 { 520 string stopImpersonateTranslation = Translate("Stop impersonation"); 521 string username = ""; 522 if (!string.IsNullOrEmpty(Model.CurrentSecondaryUser.FirstName) && !string.IsNullOrEmpty(Model.CurrentSecondaryUser.LastName)) 523 { 524 username = Model.CurrentSecondaryUser.FirstName + " " + Model.CurrentSecondaryUser.LastName; 525 } 526 else if (!string.IsNullOrEmpty(Model.CurrentSecondaryUser.Name)) 527 { 528 username = Model.CurrentSecondaryUser.Name; 529 } 530 else if (!string.IsNullOrEmpty(Model.CurrentSecondaryUser.Email)) 531 { 532 username = Model.CurrentSecondaryUser.Email; 533 } 534 else 535 { 536 username = Model.CurrentSecondaryUser.UserName; 537 } 538 <div class="grid-cell"> 539 <div class="u-pull--left u-bold u-margin-top"> 540 <i class="fa fa-user-secret"></i> 541 @username<text>&nbsp;</text>@Translate("is impersonated by")<text>&nbsp;</text>@Pageview.User.UserName 542 </div> 543 <form method="post" class="u-pull--right u-no-margin"> 544 <input type="submit" class="btn btn--secondary dw-mod u-no-margin" name="DwExtranetRemoveSecondaryUser" value="@stopImpersonateTranslation"> 545 </form> 546 </div> 547 } 548 else 549 { 550 string viewListTranslation = Translate("View the list of users you can impersonate"); 551 <div class="grid-cell u-bold"> 552 <i class="fa fa-user-secret"></i> 553 <a href="/Default.aspx?ID=@impersonationPageId" title="@viewListTranslation" class="u-color-font-black">@viewListTranslation</a> 554 </div> 555 } 556 </div> 557 </div> 558 </div> 559 </div> 560 } 561 </header> 562 563 <!-- Floating mini cart --> 564 @if (!onlyPreview && !stickyMenu && pageId == productsPageId && Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 565 { 566 <div class="floating-mini-cart u-hidden dw-mod" id="FloatingMiniCart"> 567 <div class="mini-cart dw-mod"> 568 <a href="/Default.aspx?ID=@cartPageId&Purge=True" class="menu-tools__link menu__link--condensed dw-mod js-mini-cart-button" onmouseover="Cart.UpdateMiniCart(event, 'SecondaryMiniCart', '/Default.aspx?ID=@miniCartFeedPageId&feedType=MiniCart')"> 569 <i class="fa fa-shopping-cart fa-4x"></i> 570 <div class="mini-cart__counter mini-cart__counter--lg dw-mod"> 571 <div class="js-handlebars-root js-mini-cart-counter" id="FloatingCartCounter" data-template="MiniCartCounterContent" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=Counter" data-preloader="false" data-init-onload="false"> 572 <div class="js-mini-cart-counter-content"> 573 @Model.Cart.TotalProductsCount 574 </div> 575 </div> 576 </div> 577 </a> 578 579 <div class="mini-cart-dropdown js-handlebars-root js-mini-cart dw-mod" id="SecondaryMiniCart" data-template="MiniCartContent" data-cart-id="@miniCartFeedPageId" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=MiniCart" data-init-onload="false"></div> 580 </div> 581 </div> 582 } 583 584 <!-- Render the content --> 585 <div id="Page" class="page @pagePos"> 586 <section class="center-container content-container dw-mod" id="content"> 587 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 588 589 @using System.Text.RegularExpressions 590 591 @*This is an example implementation of a Case template. 592 You may want to re-configure the itemtype and adjust this template to the specific needs. *@ 593 594 @{ 595 string fullBackgroundImage = ""; 596 if (Model.Item.GetFile("Image") != null) 597 { 598 fullBackgroundImage = "background-image:url(/Admin/Public/GetImage.ashx?width=2500&amp;height=1100&amp;crop=0&amp;Compression=85&amp;DoNotUpscale=true&amp;image=" + Model.Item.GetFile("Image").Path + ");"; 599 fullBackgroundImage += " background-position: center center; background-size: cover; "; 600 } 601 602 string caseListPageId = GetPageIdByNavigationTag("CasesListFeed").ToString(); 603 string solutionTypes = ""; 604 string solutionTypesValues = ""; 605 string partnerLink = Model.Item.GetItem("PartnerLink") != null ? Model.Item.GetItem("PartnerLink").PageID.ToString() : ""; //This solution is wrong. We need the Item PageId here. 606 607 string cardClass = Pageview.Device.ToString() != "Tablet" ? "paragraph-card" : ""; 608 string cardFooterClass = Pageview.Device.ToString() != "Tablet" ? "paragraph-card-footer" : ""; 609 } 610 611 <div class="grid article"> 612 613 @* Escape the container and section *@ 614 </div> 615 </section> 616 @* ----------------------------------- *@ 617 618 @if (fullBackgroundImage != "") 619 { 620 <section class="multiple-paragraphs-container u-color-light" style="@fullBackgroundImage"> 621 <div class="center-container center-container--with-background-image dw-mod"> 622 <div class="grid center-container--with-background-image"> 623 <div class="grid__col-md-12 grid__col-xs-12 paragraph-container paragraph-container--height-lg u-no-padding"> 624 <div class="u-left-middle"> 625 <div> 626 <h1 class="article__header article__header--giant" style="color: @Model.Item.GetString("TextColor")">@Model.Item.GetString("BannerHeading")</h1> 627 <div class="article__subheader article__subheader--giant" style="color: @Model.Item.GetString("TextColor")">@Model.Item.GetString("BannerSubheading")</div> 628 </div> 629 </div> 630 </div> 631 </div> 632 </div> 633 </section> 634 } 635 else 636 { 637 <section class="center-container content-container dw-mod"> 638 <div class="grid"> 639 <div class="grid__col-12"> 640 <h1 class="article__header article__header--giant">@Model.Item.GetString("BannerHeading")</h1> 641 </div> 642 </div> 643 </section> 644 } 645 646 @* Re-enter the container and section *@ 647 <section class="content-container center-container dw-mod"> 648 <div class="grid"> 649 @* ----------------------------------- *@ 650 651 <div class="grid__col-12"></div> 652 653 @* The descriptions *@ 654 <article class="grid__col-md-8"> 655 @if (!String.IsNullOrEmpty(Model.Item.GetString("Challenge"))) 656 { 657 <h2 class="article__header">@Translate("Challenge")</h2> 658 <div class="article__paragraph">@Model.Item.GetString("Challenge")</div> 659 } 660 661 @if (!String.IsNullOrEmpty(Model.Item.GetString("Solution"))) 662 { 663 <h2 class="article__header">@Translate("Dynamicweb as a solution")</h2> 664 <div class="article__paragraph">@Model.Item.GetString("Solution")</div> 665 } 666 667 @if (!String.IsNullOrEmpty(Model.Item.GetString("Results"))) 668 { 669 <h2 class="article__header">@Translate("Results")</h2> 670 <div class="article__paragraph">@Model.Item.GetString("Results")</div> 671 } 672 673 @* Quote *@ 674 @if (!String.IsNullOrEmpty(Model.Item.GetString("QuoteDescription"))) 675 { 676 <div class="grid article__block"> 677 @if (Model.Item.GetFile("QuoteImage") != null) 678 { 679 <div class="grid__col-4"> 680 <div class="grid__cell-img"> 681 <img src="/Admin/Public/GetImage.ashx?width=160&amp;height=160&amp;crop=0&amp;Compression=85&amp;FillCanvas=True&amp;image=@Model.Item.GetFile("QuoteImage").Path" class="article__image article__image--ball" /> 682 </div> 683 </div> 684 } 685 <div class="grid__col-auto"> 686 <div class="article__summary u-italic"> 687 "@Model.Item.GetString("QuoteDescription")" 688 </div> 689 @if (!String.IsNullOrEmpty(Model.Item.GetString("QuoteAuthor"))) 690 { 691 <div> 692 - @Model.Item.GetString("QuoteAuthor") 693 </div> 694 } 695 </div> 696 </div> 697 } 698 </article> 699 700 @* Customer informations *@ 701 <div class="grid__col-md-4"> 702 <table class="table"> 703 @if (Model.Item.GetFile("CustomerLogo") != null) { 704 <tr class="table__row--no-border"> 705 <td colspan="2"> 706 <div class="grid__cell"> 707 <img src="/Admin/Public/GetImage.ashx?width=280&height=80&amp;crop=5&amp;Compression=85&amp;DoNotUpscale=true&amp;image=@Model.Item.GetFile("CustomerLogo").Path" /> 708 </div> 709 </td> 710 </tr> 711 } 712 @if (!String.IsNullOrEmpty(Model.Item.GetString("CustomerCompanyName"))) { 713 <tr> 714 <td width="32"><i class="fa fa-user fa-2x u-brand-color-two"></i></td> 715 <td> 716 <div class="u-bold">@Translate("Client")</div> 717 <div>@Model.Item.GetString("CustomerCompanyName")</div> 718 </td> 719 </tr> 720 } 721 @if (!String.IsNullOrEmpty(Model.Item.GetString("CustomerLocation"))) { 722 <tr> 723 <td width="32"><i class="fa fa-globe fa-2x u-brand-color-two"></i></td> 724 <td> 725 <div class="u-bold">@Translate("Location")</div> 726 <div>@Model.Item.GetString("CustomerLocation")</div> 727 </td> 728 </tr> 729 } 730 @if (!string.IsNullOrEmpty(Model.Item.GetList("Industry").SelectedName) || Model.Item.GetList("SolutionType") != null || !string.IsNullOrEmpty(Model.Item.GetList("Integration").SelectedName)) { 731 <tr> 732 <td width="32"><i class="fa fa-gear fa-2x u-brand-color-two"></i></td> 733 <td> 734 <div class="u-bold">@Translate("Segment")</div> 735 <div> 736 @{ 737 var arrayTypes = new List<string>(); 738 if (Model.Item.GetList("SolutionType") != null) 739 { 740 arrayTypes.AddRange(Model.Item.GetList("SolutionType").SelectedOptions.Select(s => s.Name)); 741 solutionTypesValues = string.Join(",", Model.Item.GetList("SolutionType").SelectedOptions.Select(s => s.Value)); 742 } 743 if (!string.IsNullOrEmpty(Model.Item.GetList("Industry").SelectedName)) 744 { 745 arrayTypes.Add(Model.Item.GetList("Industry").SelectedName); 746 } 747 if (!string.IsNullOrEmpty(Model.Item.GetList("Integration").SelectedName)) 748 { 749 arrayTypes.Add(Model.Item.GetList("Integration").SelectedName); 750 } 751 752 solutionTypes = string.Join(", ", arrayTypes); 753 } 754 @solutionTypes 755 </div> 756 </td> 757 </tr> 758 } 759 @if (!String.IsNullOrEmpty(Model.Item.GetString("CustomerWebsiteUrl"))) { 760 <tr> 761 <td width="32"><i class="fa fa-desktop fa-2x u-brand-color-two"></i></td> 762 <td> 763 <div class="u-bold">@Translate("Website")</div> 764 <a href="http://@Model.Item.GetString("CustomerWebsiteUrl")" target="_blank">@Model.Item.GetString("CustomerWebsiteUrl")</a> 765 </td> 766 </tr> 767 } 768 769 @if (Model.Item.GetItem("PartnerLink") != null) { 770 <tr> 771 <td width="32"><i class="fa fa-address-card fa-2x u-brand-color-two"></i></td> 772 <td> 773 <div class="u-bold">@Translate("Partner")</div> 774 <a href="/Default.aspx?ID=@partnerLink">@Model.Item.GetItem("PartnerLink").GetString("PartnerName")</a> 775 </td> 776 </tr> 777 } 778 </table> 779 </div> 780 781 @* Images *@ 782 @if (Model.Item.GetItems("Gallery") != null) 783 { 784 if (Model.Item.GetItems("Gallery").Count > 0) 785 { 786 string mainImage = Model.Item.GetItems("Gallery").FirstOrDefault().GetFile("ImagePath").Path; 787 int imagesCount = Model.Item.GetItems("Gallery").Count; 788 789 <div class="grid__col-md-8"> 790 <label class="gallery" for="GalleryModalTrigger"> 791 <span class="gallery__main-image"> 792 <img src="/Admin/Public/GetImage.ashx?width=992&amp;height=760&amp;crop=0&amp;Compression=75&amp;DoNotUpscale=1&amp;image=@mainImage" class="flex-img" /> 793 </span> 794 <span class="gallery__image-counter"> 795 <i class="fa fa-camera fa-2x"></i> <span class="gallery__image-counter__number">@imagesCount</span> 796 <span class="gallery__image-counter__text">@Translate("See all") <i class="fa fa-angle-right"></i></span> 797 </span> 798 </label> 799 </div> 800 801 <div class="grid__col-md-4"> 802 803 </div> 804 } 805 } 806 807 @* Related cases *@ 808 @* Escape the container and section *@ 809 </div> 810 </section> 811 @* ----------------------------------- *@ 812 813 <section class="multiple-paragraphs-container u-color-light-gray--bg"> 814 <div class="center-container dw-mod"> 815 <div class="grid"> 816 <div class="grid__col-md-12 grid__col-xs-12 paragraph-container"> 817 <h2 class="article__header u-no-margin">@Translate("Similar cases")</h2> 818 </div> 819 </div> 820 821 <div class="js-handlebars-root" id="RelatedCases" data-template="RelatedCasesTemplate" data-json-feed="/Default.aspx?ID=@caseListPageId&SolutionType=@solutionTypesValues&ExcludeCaseID=@Model.ID&PageSize=8"></div> 822 823 <script id="RelatedCasesTemplate" type="text/x-template"> 824 {{#.}} 825 <div class="grid u-no-margin"> 826 {{#Cases}} 827 <div class="grid__col-md-3 grid__col-sm-3 grid__col-xs-12"> 828 <div class="@cardClass"> 829 <div class="u-margin-bottom"> 830 <a href="{{link}}"> 831 <div class="layered-image {{tintedImage}}" style="background-image:url(/Admin/Public/GetImage.ashx?width=992&amp;height=760&amp;crop=0&amp;Compression=75&amp;DoNotUpscale=true&amp;image={{image}}); background-size: cover;"> 832 <img src="/Admin/Public/GetImage.ashx?width=240&amp;height=200&amp;crop=5&amp;Compression=75&amp;DoNotUpscale=true&amp;FillCanvas=True&amp;image={{logo}}" class="u-padding" /> 833 </div> 834 </a> 835 </div> 836 837 <a href="{{link}}" class="u-color-inherit u-bold u-margin-left u-margin-right"> 838 {{title}} 839 </a> 840 841 <p>{{summary}}</p> 842 </div> 843 <div class="grid__cell-footer @cardFooterClass"> 844 <div class="grid__cell"> 845 <div class="u-margin-top"> 846 <a href="{{link}}" class="btn btn--secondary btn--line-height btn--full dw-mod">@Translate("Read the case")</a> 847 </div> 848 </div> 849 </div> 850 </div> 851 {{/Cases}} 852 </div> 853 {{/.}} 854 </script> 855 </div> 856 </section> 857 858 @if (Model.Item.GetItems("Gallery").Count > 0) 859 { 860 string firstImage = Model.Item.GetItems("Gallery").FirstOrDefault().GetFile("ImagePath").Path; 861 int modalImagesCount = Model.Item.GetItems("Gallery").Count; 862 List<string> galleryImages = new List<string>(); 863 864 foreach (var item in Model.Item.GetItems("Gallery")) 865 { 866 if (item.GetFile("ImagePath") != null) { 867 galleryImages.Add(item.GetFile("ImagePath").Path); 868 } 869 } 870 string galleryImagesArray = string.Join(", ", galleryImages); 871 872 <!-- Trigger for the gallery modal --> 873 <input type="checkbox" id="GalleryModalTrigger" class="modal-trigger" /> 874 875 <!-- Gallery modal --> 876 <div class="modal-container"> 877 <label for="GalleryModalTrigger" id="GalleryModalOverlay" class="modal-overlay"></label> 878 <div class="modal modal--lg modal--full" id="GalleryModal"> 879 <div class="modal__body"> 880 <div class="gallery-slider js-gallery-slider" data-current-image="0" data-total-images="@modalImagesCount" data-images="@galleryImagesArray" > 881 <div class="gallery-slider__image"> 882 <img src="/Admin/Public/GetImage.ashx?width=1200&amp;height=820&amp;crop=5&amp;Compression=75&amp;DoNotUpscale=1&amp;image=@firstImage" class="modal--full__img js-gallery-image" /> 883 </div> 884 <div class="gallery-slider__image-counter"> 885 <span class="js-image-list-counter">1</span> / @modalImagesCount 886 </div> 887 <label class="gallery-slider__close-btn" for="GalleryModalTrigger"></label> 888 <button class="gallery-slider__previous-btn" onclick="ImageList.GetPreviousImage(this)"></button> 889 <button class="gallery-slider__next-btn" onclick="ImageList.GetNextImage(this)"></button> 890 </div> 891 </div> 892 </div> 893 </div> 894 } 895 896 @* Re-enter the container and section *@ 897 <section class="content-container center-container dw-mod"> 898 <div class="grid"> 899 @* ----------------------------------- *@ 900 </div> 901 902 </section> 903 </div> 904 </main> 905 906 @RenderFooter() 907 908 909 910 <!-- Content rendering helpers --> 911 912 @helper MobileNavigation(string userInitials) 913 { 914 int pageId = Model.TopPage.ID; 915 string mobileNavigationLevels = Model.Area.Item.GetBoolean("MobileNavigationLevels") ? Model.Area.Item.GetString("MobileNavigationLevels") : "3"; 916 917 bool showCreateAccountLink = Model.Area.Item.GetBoolean("ShowCreateAccountLink"); 918 919 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 920 int cartFeedPageId = GetPageIdByNavigationTag("CartOrderlinesFeed"); 921 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 922 923 string myProfilePageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerProfile").ToString() : GetPageIdByNavigationTag("CustomerProfile").ToString(); 924 string myOrdersPageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerOrders").ToString() : GetPageIdByNavigationTag("CustomerOrders").ToString(); 925 string myFavoritesPageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerFavorites").ToString() : GetPageIdByNavigationTag("CustomerFavorites").ToString(); 926 bool showMyProfileLink = Model.Area.Item.GetBoolean("ShowMyProfileLink"); 927 bool showMyOrdersLink = Model.Area.Item.GetBoolean("ShowMyOrdersLink"); 928 bool showMyFavoritesLink = Model.Area.Item.GetBoolean("ShowMyFavoritesLink"); 929 930 bool renderPagesInToolBar = Model.Area.Item.GetBoolean("RenderPagesInToolBar"); 931 int startLevel = renderPagesInToolBar ? 1 : 0; 932 933 bool onlyPreview = Model.Area.Item.GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 934 935 if (Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") 936 { 937 <!-- Trigger for mobile navigation --> 938 <input type="checkbox" id="MobileNavTrigger" class="mobile-nav-trigger" /> 939 940 <!-- Mobile navigation --> 941 <nav class="mobile-navigation dw-mod"> 942 @if (Model.CurrentUser.ID > 0) 943 { 944 string userName = Model.CurrentUser.FirstName != null ? Model.CurrentUser.FirstName : ""; 945 userName += " " + Model.CurrentUser.LastName != null ? Model.CurrentUser.LastName : ""; 946 userName += userName == "" && Model.CurrentUser.UserName != null ? Model.CurrentUser.UserName : ""; 947 948 <ul class="menu menu-mobile"> 949 <li class="menu-mobile__item"> 950 <a href="/default.aspx?ID=@myProfilePageId" class="menu-mobile__link dw-mod"><i class="fa fa-user menu-mobile__link-icon"></i> @userName</a> 951 </li> 952 </ul> 953 } 954 955 @RenderNavigation(new 956 { 957 id = "mobilenavigation", 958 cssclass = "menu menu-mobile dwnavigation", 959 startLevel = @startLevel, 960 ecomStartLevel = @startLevel + 1, 961 endlevel = @mobileNavigationLevels, 962 expandmode = "all", 963 template = "BaseMenuForMobile.xslt" 964 }) 965 966 @if (Model.Area.Item.GetBoolean("RenderPagesInToolBar")) 967 { 968 @RenderNavigation(new 969 { 970 id = "topToolsMobileNavigation", 971 cssclass = "menu menu-mobile dwnavigation", 972 template = "ToolsMenuForMobile.xslt" 973 }) 974 } 975 976 <ul class="menu menu-mobile"> 977 @if (Model.CurrentUser.ID <= 0) 978 { 979 <li class="menu-mobile__item"> 980 <label for="SignInModalTrigger" onclick="document.getElementById('MobileNavTrigger').checked = false;" class="menu-mobile__link dw-mod menu-mobile__link--highlighted"><i class="fa fa-user menu-mobile__link-icon"></i> @Translate("Sign in")</label> 981 </li> 982 if (showCreateAccountLink) 983 { 984 <li class="menu-mobile__item"> 985 <a class="menu-mobile__link menu-mobile__link--highlighted dw-mod" href="/Default.aspx?ID=@createAccountPageId"><i class="fa fa-user menu-mobile__link-icon"></i> @Translate("Create account")</a> 986 </li> 987 } 988 } 989 else 990 { 991 if (showMyProfileLink) 992 { 993 <li class="menu-mobile__item"> 994 <a href="/default.aspx?ID=@myProfilePageId" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"><i class="fa fa-user menu-mobile__link-icon"></i> @Translate("My Profile")</a> 995 </li> 996 } 997 if (showMyOrdersLink) 998 { 999 <li class="menu-mobile__item"> 1000 <a href="/default.aspx?ID=@myOrdersPageId" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"><i class="fa fa-list menu-mobile__link-icon"></i> @Translate("My Orders")</a> 1001 </li> 1002 } 1003 if (showMyFavoritesLink) 1004 { 1005 <li class="menu-mobile__item"> 1006 <a href="/default.aspx?ID=@myFavoritesPageId" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"><i class="fa fa-star menu-mobile__link-icon"></i> @Translate("My Favorites")</a> 1007 </li> 1008 } 1009 <li class="menu-mobile__item"> 1010 <a class="menu-mobile__link menu-mobile__link--highlighted dw-mod" href="/Admin/Public/ExtranetLogoff.aspx?ID=@pageId"><i class="fa fa-user menu-mobile__link-icon"></i> @Translate("Sign out")</a> 1011 </li> 1012 } 1013 @if (Model.Languages.Count > 0) 1014 { 1015 string selectedLanguage = ""; 1016 foreach (var lang in Model.Languages) 1017 { 1018 if (lang.IsCurrent) 1019 { 1020 selectedLanguage = lang.Name; 1021 } 1022 } 1023 1024 @*<li class="menu-mobile__item dw-mod"> 1025 <label for="MobileMenuCheck_Language" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"><i class="fa fa-globe menu-mobile__link-icon"></i> @selectedLanguage</label> 1026 <input id="MobileMenuCheck_Language" type="checkbox" class="expand-trigger"> 1027 <label for="MobileMenuCheck_Language" class="menu-mobile__trigger"></label> 1028 <ul class="menu-mobile menu-mobile__submenu expand-menu"> 1029 @foreach (var lang in Model.Languages) 1030 { 1031 <li class="menu-mobile__item dw-mod"> 1032 <a class="menu-mobile__link menu-mobile__link--highlighted dw-mod menu-mobile__link--level-1" href="/Default.aspx?ID=@lang.Page.ID&CurrencyCode=@Dynamicweb.Services.Areas.GetArea(lang.ID).EcomCurrencyId">@lang.Name</a> 1033 </li> 1034 } 1035 </ul> 1036 </li>*@ 1037 } 1038 </ul> 1039 </nav> 1040 <label class="mobile-nav-trigger-off" for="MobileNavTrigger"></label> 1041 1042 if (!onlyPreview) 1043 { 1044 <div class="u-visually-hidden js-handlebars-root js-mini-cart" id="miniCart" data-template="MiniCartContent" data-cart-id="@cartFeedPageId" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=MiniCart" data-init-onload="false"></div> 1045 } 1046 } 1047 } 1048 1049 @helper LoginModal() 1050 { 1051 int pageId = Model.TopPage.ID; 1052 string topLayout = Model.Area.Item.GetList("LayoutTop").SelectedValue; 1053 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 1054 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 1055 string forgotPasswordPageId = signInProfilePageId.ToString() + "&LoginAction=Recovery"; 1056 string userSignedInError = !Model.LogOnFailed ? "" : "checked"; 1057 string userSignedInErrorText = ""; 1058 1059 if (Model.LogOnFailed) 1060 { 1061 switch (Model.LogOnFailedReason) 1062 { 1063 case Dynamicweb.Security.UserManagement.LogOnFailedReason.PasswordLengthInvalid: 1064 userSignedInErrorText = Translate("Password length is invalid"); 1065 break; 1066 case Dynamicweb.Security.UserManagement.LogOnFailedReason.IncorrectLogin: 1067 userSignedInErrorText = Translate("Invalid email or password"); 1068 break; 1069 case Dynamicweb.Security.UserManagement.LogOnFailedReason.ExceededFailedLogOnLimit: 1070 userSignedInErrorText = Translate("You have exceeded the limit of allowed login attempts. The user account is temporarily locked"); 1071 break; 1072 case Dynamicweb.Security.UserManagement.LogOnFailedReason.LoginLocked: 1073 userSignedInErrorText = Translate("The user account is temporarily locked"); 1074 break; 1075 case Dynamicweb.Security.UserManagement.LogOnFailedReason.PasswordExpired: 1076 userSignedInErrorText = Translate("The password has expired and needs to be renewed"); 1077 break; 1078 default: 1079 userSignedInErrorText = Translate("An unknown error occured"); 1080 break; 1081 } 1082 } 1083 1084 <!-- Trigger for the login modal --> 1085 <input type="checkbox" id="SignInModalTrigger" class="modal-trigger @topLayout" @userSignedInError /> 1086 1087 <!-- Login modal --> 1088 <div class="modal-container"> 1089 <label for="SignInModalTrigger" id="SignInModalOverlay" class="modal-overlay"></label> 1090 <div class="modal modal--xs" id="SignInModal"> 1091 <div class="modal__header"> 1092 <h2>@Translate("Sign in")</h2> 1093 </div> 1094 <div class="modal__body"> 1095 <form method="post" id="LoginForm" class="u-no-margin"> 1096 <input type="hidden" name="ID" value="@pageId" /> 1097 <input type="hidden" name="DWExtranetUsernameRemember" value="True" /> 1098 <input type="hidden" name="DWExtranetPasswordRemember" value="True" /> 1099 <input type="text" class="u-full-width" id="LoginUsername" name="username" placeholder="@Translate("Email")" /> 1100 <input type="password" class="u-full-width" id="LoginPassword" name="password" placeholder="@Translate("Password")" /> 1101 <div class="field-error dw-mod">@userSignedInErrorText</div> 1102 1103 <label> 1104 <input type="checkbox" id="RememberMe" name="Autologin" checked="checked" value="True"> 1105 <span>@Translate("Remember me", "Remember me")</span> 1106 </label> 1107 1108 <button type="submit" class="btn btn--primary btn--full dw-mod" name="LoginAction" value="Login" onclick="Buttons.LockButton(event)">@Translate("Sign in")</button> 1109 1110 <a class="btn btn--link-clean dw-mod" href="/Default.aspx?id=@forgotPasswordPageId">@Translate("Forgot your password?", "Forgot your password?")</a> 1111 1112 <a class="btn btn--link-clean dw-mod" href="/default.aspx?ID=@createAccountPageId">@Translate("Create account")?</a> 1113 </form> 1114 </div> 1115 </div> 1116 </div> 1117 } 1118 @helper RenderHeaderNavigation() 1119 { 1120 bool megaMenu = Model.Area.Item.GetList("NavigationMegaMenu").SelectedValue.ToLower() == "true" ? true : false; 1121 string megamenuPromotionImage = Model.Area.Item.GetFile("NavigationMegamenuPromotionImage") != null ? Model.Area.Item.GetFile("NavigationMegamenuPromotionImage").Path : ""; 1122 bool renderPagesInToolBar = Model.Area.Item.GetBoolean("RenderPagesInToolBar"); 1123 int startLevel = renderPagesInToolBar ? 1 : 0; 1124 1125 if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 1126 { 1127 if (!megaMenu) 1128 { 1129 @RenderNavigation(new 1130 { 1131 id = "topnavigation", 1132 cssclass = "menu dw-mod dwnavigation", 1133 startLevel = @startLevel, 1134 ecomStartLevel = @startLevel + 1, 1135 endlevel = 5, 1136 expandmode = "all", 1137 template = "BaseMenuWithDropdown.xslt" 1138 }); 1139 } 1140 else 1141 { 1142 @RenderNavigation(new 1143 { 1144 id = "topnavigation", 1145 cssclass = "menu dw-mod dwnavigation", 1146 startLevel = @startLevel, 1147 ecomStartLevel = @startLevel + 1, 1148 endlevel = 5, 1149 promotionImage = megamenuPromotionImage, 1150 promotionLink = Model.Area.Item.GetString("NavigationMegamenuPromotionLink"), 1151 expandmode = "all", 1152 template = "BaseMegaMenu.xslt" 1153 }); 1154 } 1155 } 1156 } 1157 1158 @helper MobileNavigationTrigger() 1159 { 1160 @* Mobile navigation trigger *@ 1161 1162 if (Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") 1163 { 1164 <div class="menu dw-mod u-pull--left"> 1165 <div class="menu__item menu__item--horizontal menu__item--top-level dw-mod"> 1166 <label for="MobileNavTrigger" class="mobile-nav-trigger-button menu__link dw-mod"></label> 1167 </div> 1168 </div> 1169 } 1170 } 1171 1172 @helper RenderLanguageSelector(string type = "inNavigation") 1173 { 1174 string liClasses = type == "inNavigation" ? "menu__item menu__item--horizontal menu__item--top-level dw-mod u-hidden-xxs" : "menu__item menu__item--horizontal menu--clean u-w40px dw-mod"; 1175 string menuLinkClass = type == "inNavigation" ? "menu__link" : "header-menu__link"; 1176 1177 @* Language selector *@ 1178 if (Model.Languages.Count > 1) 1179 { 1180 <li class="@liClasses"> 1181 <div class="@menuLinkClass u-w40px is-dropdown is-dropdown--no-icon dw-mod"> 1182 <i class="fa fa-globe fa-1_5x"></i> 1183 <div class="menu menu--dropdown u-w100px dw-mod"> 1184 @foreach (var lang in Model.Languages) 1185 { 1186 <a href="/Default.aspx?ID=@lang.Page.ID&CurrencyCode=@Dynamicweb.Services.Areas.GetArea(lang.ID).EcomCurrencyId" class="menu-dropdown__item menu-dropdown__item--link dw-mod">@lang.Name</a> 1187 } 1188 </div> 1189 </div> 1190 </li> 1191 } 1192 } 1193 1194 @helper RenderMiniCart(string type = "inNavigation") 1195 { 1196 string liClasses = type == "inNavigation" ? "menu__item menu__item--horizontal menu__item--top-level dw-mod" : "menu__item menu__item--horizontal menu--clean dw-mod"; 1197 string menuLinkClass = type == "inNavigation" ? "menu__link" : "header-menu__link"; 1198 1199 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 1200 int cartFeedPageId = GetPageIdByNavigationTag("CartOrderlinesFeed"); 1201 int cartPageId = GetPageIdByNavigationTag("CartPage"); 1202 double cartProductsCount = Model.Cart.TotalProductsCount; 1203 int pageId = Model.TopPage.ID; 1204 string topLayout = Model.Area.Item.GetList("LayoutTop").SelectedValue; 1205 1206 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 1207 string firstPageId = Model.Area.FirstActivePage.ID.ToString(); 1208 string logo = Model.Area.Item.GetFile("LogoImage") != null ? Model.Area.Item.GetFile("LogoImage").Path : "/Files/Images/logo-dynamicweb.png"; 1209 if (Path.GetExtension(logo).ToLower() != ".svg") 1210 { 1211 logo = "/Admin/Public/GetImage.ashx?height=60&amp;crop=5&amp;Compression=75&amp;image=" + @logo; 1212 } 1213 string userSignedInErrorCart = !Model.LogOnFailed ? "" : "checked"; 1214 string userSignedInErrorTextCart = ""; 1215 1216 if (Model.LogOnFailed) 1217 { 1218 switch (Model.LogOnFailedReason) 1219 { 1220 case Dynamicweb.Security.UserManagement.LogOnFailedReason.PasswordLengthInvalid: 1221 userSignedInErrorTextCart = Translate("Password length is invalid"); 1222 break; 1223 case Dynamicweb.Security.UserManagement.LogOnFailedReason.IncorrectLogin: 1224 userSignedInErrorTextCart = Translate("Invalid email or password"); 1225 break; 1226 case Dynamicweb.Security.UserManagement.LogOnFailedReason.ExceededFailedLogOnLimit: 1227 userSignedInErrorTextCart = Translate("You have exceeded the limit of allowed login attempts. The user account is temporarily locked"); 1228 break; 1229 case Dynamicweb.Security.UserManagement.LogOnFailedReason.LoginLocked: 1230 userSignedInErrorTextCart = Translate("The user account is temporarily locked"); 1231 break; 1232 case Dynamicweb.Security.UserManagement.LogOnFailedReason.PasswordExpired: 1233 userSignedInErrorTextCart = Translate("The password has expired and needs to be renewed"); 1234 break; 1235 default: 1236 userSignedInErrorTextCart = Translate("An unknown error occured"); 1237 break; 1238 } 1239 } 1240 1241 if (Model.CurrentUser.ID <= 0) 1242 { 1243 1244 @* Mini cart *@ 1245 <li class="@liClasses"> 1246 <div class="mini-cart dw-mod"> 1247 <!-- Trigger for the login modal --> 1248 <label for="SignInModalCartTrigger" class="@menuLinkClass dw-mod js-mini-cart-button"> 1249 <i class="fa fa-shopping-cart fa-1_5x"></i> 1250 <div class="mini-cart__counter mini-cart__counter--inline dw-mod"> 1251 <div class="js-handlebars-root js-mini-cart-counter" id="cartCounter" data-template="MiniCartCounterContent" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=Counter" data-init-onload="false" data-preloader="false"> 1252 <div class="js-mini-cart-counter-content"> 1253 @cartProductsCount 1254 </div> 1255 </div> 1256 </div> 1257 </label> 1258 @if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 1259 { 1260 <div class="mini-cart-dropdown js-handlebars-root js-mini-cart dw-mod" id="miniCart" data-template="MiniCartContent" data-cart-id="@miniCartFeedPageId" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=MiniCart" data-init-onload="false"></div> 1261 } 1262 </div> 1263 </li> 1264 } 1265 else 1266 { 1267 @* Mini cart *@ 1268 <li class="@liClasses"> 1269 <div class="mini-cart dw-mod"> 1270 <a href="/Default.aspx?ID=@cartPageId&Purge=True" id="miniCartCounterWrap" class="@menuLinkClass dw-mod js-mini-cart-button" onmouseenter="Cart.UpdateMiniCart(event, 'miniCart', '/Default.aspx?ID=@miniCartFeedPageId&feedType=MiniCart')"> 1271 <i class="fa fa-shopping-cart fa-1_5x"></i> 1272 <div class="mini-cart__counter mini-cart__counter--inline dw-mod"> 1273 <div class="js-handlebars-root js-mini-cart-counter" id="cartCounter" data-template="MiniCartCounterContent" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=Counter" data-init-onload="false" data-preloader="false"> 1274 <div class="js-mini-cart-counter-content"> 1275 @cartProductsCount 1276 </div> 1277 </div> 1278 </div> 1279 </a> 1280 @if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 1281 { 1282 <div class="mini-cart-dropdown js-handlebars-root js-mini-cart dw-mod" id="miniCart" data-template="MiniCartContent" data-cart-id="@miniCartFeedPageId" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=MiniCart" data-init-onload="false"></div> 1283 } 1284 </div> 1285 </li> 1286 } 1287 <input type="checkbox" id="SignInModalCartTrigger" class="modal-trigger" @userSignedInErrorCart /> 1288 <!-- Login modal Cart --> 1289 if (Pageview.Device.ToString() != "Mobile") 1290 { 1291 <div class="modal-container"> 1292 <label for="SignInModalCartTrigger" id="SignInModalCartOverlay" class="modal-overlay"></label> 1293 <div class="modal modal--lg" id="SignInModalCart"> 1294 <div class="modal__header" style="padding:30px;"> 1295 1296 <h2>@Translate("Already a customer")?</h2> 1297 1298 </div> 1299 <div class="modal__body" style="padding:30px;"> 1300 1301 <div class="grid"> 1302 <div class="grid__col-md-5" style="padding:0"> 1303 <h5><strong>@Translate("Already a customer")</strong></h5> 1304 <form method="post" id="LoginFormCart" class="u-no-margin" action="/Default.aspx?ID=@GetPageIdByNavigationTag("SignInPage")"> 1305 1306 <input type="hidden" name="DWExtranetUsernameRemember" value="True" /> 1307 <input type="hidden" name="DWExtranetPasswordRemember" value="True" /> 1308 <input type="text" class="u-full-width" id="LoginUsername" name="username" placeholder="@Translate("Email")" /> 1309 <input type="password" class="u-full-width" id="LoginPassword" name="password" placeholder="@Translate("Password")" /> 1310 <div class="field-error dw-mod">@userSignedInErrorTextCart</div> 1311 1312 1313 1314 <button type="submit" class="btn btn--primary dw-mod" name="LoginAction" id="loginOverlay" value="Login">@Translate("Sign in")</button> 1315 1316 1317 </form> 1318 </div> 1319 <div class="grid__col-md-1"> 1320 </div> 1321 <div class="grid__col-md-6 " style="padding:0;position:relative"> 1322 <h5><strong>@Translate("New customer")</strong></h5> 1323 <p>@Translate("An account can be easily created after a transaction has been completed.")</p> 1324 @if (Pageview.Device.ToString() == "Desktop") 1325 { 1326 <a href="/Default.aspx?ID=@cartPageId&Purge=True" class="btn btn--secondary dw-mod" style="position:absolute;bottom:0">@Translate("Continue as guest")</a> 1327 1328 } 1329 else 1330 { 1331 <a href="/Default.aspx?ID=@cartPageId&Purge=True" class="btn btn--secondary dw-mod" style="position:relative;bottom:0">@Translate("Continue as guest")</a> 1332 1333 } 1334 </div> 1335 </div> 1336 </div> 1337 <div class="modal__footer footer dw-mod" style="padding:30px;"> 1338 <div class="grid"> 1339 <div class="grid__col-4" style="padding:0"> 1340 <div class="logo dw-mod"> 1341 <a href="/Default.aspx?ID=@firstPageId"> 1342 <img class="grid__cell-img" src="@logo" alt="Logo" /> 1343 </a> 1344 </div> 1345 </div> 1346 <div class="grid__col-8" style="padding:0"> 1347 <p style="margin-bottom:0;"> 1348 @Translate("Overlay First Line")<br /> 1349 @Translate("Overlay Second Line")<br /> 1350 @Translate("Overlay Third Line") 1351 </p> 1352 </div> 1353 </div> 1354 1355 1356 1357 </div> 1358 </div> 1359 </div> 1360 } 1361 else 1362 { 1363 <div class="modal-container"> 1364 <label for="SignInModalCartTrigger" id="SignInModalCartOverlay" class="modal-overlay"></label> 1365 <div class="modal modal--lg" id="SignInModalCart" style="overflow:auto;min-width:320px;"> 1366 <div class="modal__header" style="padding:15px;"> 1367 1368 <h2>@Translate("Already a customer")?</h2> 1369 1370 </div> 1371 <div class="modal__body" style="padding:15px;"> 1372 1373 <div class="grid"> 1374 <div class="grid__col-sm-12" style="padding:0"> 1375 <h5><strong>@Translate("Already a customer")</strong></h5> 1376 <form method="post" id="LoginFormCart" class="u-no-margin" action="/Default.aspx?ID=@GetPageIdByNavigationTag("SignInPage")"> 1377 1378 <input type="hidden" name="DWExtranetUsernameRemember" value="True" /> 1379 <input type="hidden" name="DWExtranetPasswordRemember" value="True" /> 1380 <input type="text" class="u-full-width" id="LoginUsername" name="username" placeholder="@Translate("Email")" /> 1381 <input type="password" class="u-full-width" id="LoginPassword" name="password" placeholder="@Translate("Password")" /> 1382 <div class="field-error dw-mod">@userSignedInErrorTextCart</div> 1383 1384 1385 1386 <button type="submit" class="btn btn--primary dw-mod" name="LoginAction" id="loginOverlay" value="Login">@Translate("Sign in")</button> 1387 1388 1389 </form> 1390 </div> 1391 <div class="grid__col-sm-1"> 1392 </div> 1393 <div class="grid__col-sm-6 " style="padding:0;position:relative"> 1394 <h5><strong>@Translate("New customer")</strong></h5> 1395 <p>@Translate("An account can be easily created after a transaction has been completed.")</p> 1396 <a href="/Default.aspx?ID=@cartPageId&Purge=True" class="btn btn--secondary dw-mod" >@Translate("Continue as guest")</a> 1397 </div> 1398 </div> 1399 </div> 1400 <div class="modal__footer footer dw-mod" style="padding:15px;"> 1401 <div class="grid"> 1402 <div class="grid__col-sm-12" style="padding:0"> 1403 <div class="logo dw-mod"> 1404 <a href="/Default.aspx?ID=@firstPageId"> 1405 <img class="grid__cell-img" src="@logo" alt="Logo" /> 1406 </a> 1407 </div> 1408 </div> 1409 <div class="grid__col-sm-12" style="padding:15px 0 0 0;"> 1410 <p> 1411 @Translate("OverlayFirstLine")<br /> 1412 @Translate("OverlaySecondLine")<br /> 1413 @Translate("OverlayThirdLine") 1414 </p> 1415 </div> 1416 </div> 1417 1418 1419 1420 </div> 1421 </div> 1422 </div> 1423 } 1424 } 1425 @helper RenderSignIn(string type = "inNavigation", string userInitials = "") 1426 { 1427 string liClasses = type == "inNavigation" ? "menu__item menu__item--horizontal menu__item--top-level dw-mod u-hidden-xxs" : "menu__item menu__item--horizontal menu__item--clean u-w40px dw-mod"; 1428 string menuLinkClass = type == "inNavigation" ? "menu__link" : "header-menu__link"; 1429 1430 int pageId = Model.TopPage.ID; 1431 string myProfilePageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerProfile").ToString() : GetPageIdByNavigationTag("CustomerProfile").ToString(); 1432 string myOrdersPageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerOrders").ToString() : GetPageIdByNavigationTag("CustomerOrders").ToString(); 1433 int myDashboardPageId = GetPageIdByNavigationTag("CustomerDashboard"); 1434 string myFavoritesPageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerFavorites").ToString() : GetPageIdByNavigationTag("CustomerFavorites").ToString(); 1435 string mySavedCardsPageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("SavedCards").ToString() : GetPageIdByNavigationTag("SavedCards").ToString(); 1436 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 1437 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 1438 string forgotPasswordPageId = signInProfilePageId.ToString() + "&LoginAction=Recovery"; 1439 1440 bool showCreateAccountLink = Model.Area.Item.GetBoolean("ShowCreateAccountLink"); 1441 bool showMyProfileLink = Model.Area.Item.GetBoolean("ShowMyProfileLink"); 1442 bool showMyOrdersLink = Model.Area.Item.GetBoolean("ShowMyOrdersLink"); 1443 bool showMyFavoritesLink = Model.Area.Item.GetBoolean("ShowMyFavoritesLink"); 1444 bool showMySavedCardsLink = Model.Area.Item.GetBoolean("ShowMySavedCardsLink"); 1445 1446 @* Sign in + Customer center links *@ 1447 <li class="@liClasses"> 1448 <div class="@menuLinkClass is-dropdown is-dropdown--no-icon u-w40px dw-mod"> 1449 @if (Model.CurrentUser.ID <= 0) 1450 { 1451 <i class="fa fa-user fa-1_5x"></i> 1452 } 1453 else 1454 { 1455 <a href="/default.aspx?ID=@myDashboardPageId" class="u-color-inherit"><div class="circle-icon-btn">@userInitials.ToUpper()</div></a> 1456 } 1457 1458 <div class="menu menu--dropdown sign-in-dropdown dw-mod"> 1459 <ul class="list list--clean dw-mod"> 1460 @if (Model.CurrentUser.ID <= 0) 1461 { 1462 <li> 1463 <label for="SignInModalTrigger" class="btn btn--primary btn--full u-no-margin sign-in-modal-trigger-button dw-mod" onclick="setTimeout(function () { document.getElementById('LoginUsername').focus() }, 10)">@Translate("Sign in")</label> 1464 </li> 1465 if (showCreateAccountLink) 1466 { 1467 <li> 1468 <a href="/default.aspx?ID=@createAccountPageId" class="list__link dw-mod">@Translate("Create account")</a> 1469 </li> 1470 } 1471 <li> 1472 <a href="/default.aspx?ID=@forgotPasswordPageId" class="list__link dw-mod">@Translate("Forgot your password?")</a> 1473 </li> 1474 if (showMyProfileLink || showMyOrdersLink || showMyFavoritesLink || showMySavedCardsLink) 1475 { 1476 <li class="list__seperator dw-mod"></li> 1477 } 1478 } 1479 @if (showMyProfileLink) 1480 { 1481 <li> 1482 <a href="/default.aspx?ID=@myProfilePageId" class="list__link dw-mod"><i class="fa fa-user"></i> @Translate("My Profile")</a> 1483 </li> 1484 } 1485 @if (showMyOrdersLink) 1486 { 1487 <li> 1488 <a href="/default.aspx?ID=@myOrdersPageId" class="list__link dw-mod"><i class="fa fa-list"></i> @Translate("My Orders")</a> 1489 </li> 1490 } 1491 @if (showMyFavoritesLink) 1492 { 1493 <li> 1494 <a href="/default.aspx?ID=@myFavoritesPageId" class="list__link dw-mod"><i class="fa fa-star"></i> @Translate("My Favorites")</a> 1495 </li> 1496 } 1497 @if (showMySavedCardsLink) 1498 { 1499 <li> 1500 <a href="/default.aspx?ID=@mySavedCardsPageId" class="list__link dw-mod"><i class="fa fa-credit-card"></i> @Translate("My Saved cards")</a> 1501 </li> 1502 } 1503 @if (Model.CurrentUser.ID > 0) 1504 { 1505 if (showMyProfileLink || showMyOrdersLink || showMyFavoritesLink || showMySavedCardsLink) 1506 { 1507 <li class="list__seperator dw-mod"></li> 1508 } 1509 <li> 1510 <a href="/Admin/Public/ExtranetLogoff.aspx?ID=@pageId" class="list__link dw-mod">@Translate("Sign out")</a> 1511 </li> 1512 } 1513 </ul> 1514 </div> 1515 </div> 1516 </li> 1517 } 1518 1519 @helper RenderFavorites(string type = "inNavigation") 1520 { 1521 string liClasses = type == "inNavigation" ? "menu__item menu__item--horizontal menu__item--top-level dw-mod u-hidden-xxs" : "menu__item menu__item--horizontal menu--clean u-w40px dw-mod"; 1522 string menuLinkClass = type == "inNavigation" ? "menu__link" : "header-menu__link"; 1523 1524 string myFavoritesPageId = GetPageIdByNavigationTag("CustomerFavorites").ToString(); 1525 1526 @* Favorites *@ 1527 if (Model.CurrentUser.ID > 0) 1528 { 1529 <li class="@liClasses"> 1530 <a href="/Default.aspx?ID=@myFavoritesPageId" class="@menuLinkClass dw-mod"> 1531 <i class="fa fa-star fa-1_5x"></i> 1532 </a> 1533 </li> 1534 } 1535 } 1536 1537 1538 @helper RenderFooter() 1539 { 1540 string footerColumnOneContent = !string.IsNullOrEmpty(Model.Area.Item.GetString("FooterColumnOne")) ? Model.Area.Item.GetString("FooterColumnOne") : ""; 1541 string footerColumnTwoContent = !string.IsNullOrEmpty(Model.Area.Item.GetString("FooterColumnTwo")) ? Model.Area.Item.GetString("FooterColumnTwo") : ""; 1542 string footerColumnThreeContent = !string.IsNullOrEmpty(Model.Area.Item.GetString("FooterColumnThree")) ? Model.Area.Item.GetString("FooterColumnThree") : ""; 1543 string footerColumnOneHeader = Model.Area.Item.GetString("FooterColumnOneHeader"); 1544 string footerColumnTwoHeader = Model.Area.Item.GetString("FooterColumnTwoHeader"); 1545 string footerColumnThreeHeader = Model.Area.Item.GetString("FooterColumnThreeHeader"); 1546 int newsletterSignUpPageId = GetPageIdByNavigationTag("NewsletterSignUp"); 1547 1548 <!-- Footer section --> 1549 <footer class="footer dw-mod"> 1550 <div class="center-container top-container__center-container dw-mod"> 1551 <div class="grid"> 1552 @if (!string.IsNullOrEmpty(footerColumnOneContent) || !string.IsNullOrEmpty(footerColumnOneHeader)) 1553 { 1554 <div class="grid__col-md-auto"> 1555 <h4 class="footer__heading dw-mod">@footerColumnOneHeader</h4> 1556 <div class="footer__content dw-mod"> 1557 @footerColumnOneContent 1558 </div> 1559 </div> 1560 } 1561 @if (!string.IsNullOrEmpty(footerColumnTwoContent) || !string.IsNullOrEmpty(footerColumnTwoHeader)) 1562 { 1563 <div class="grid__col-md-auto"> 1564 <h4 class="footer__heading dw-mod">@footerColumnTwoHeader</h4> 1565 <div class="footer__content dw-mod"> 1566 @footerColumnTwoContent 1567 </div> 1568 </div> 1569 } 1570 @if (!string.IsNullOrEmpty(footerColumnThreeContent) || !string.IsNullOrEmpty(footerColumnThreeHeader)) 1571 { 1572 <div class="grid__col-md-auto"> 1573 <h4 class="footer__heading dw-mod">@footerColumnThreeHeader</h4> 1574 <div class="footer__content dw-mod"> 1575 @footerColumnThreeContent 1576 </div> 1577 </div> 1578 } 1579 @if (Model.Area.Item.GetBoolean("FooterNewsletterSignUp")) 1580 { 1581 <div class="grid__col-md-auto"> 1582 <h4 class="footer__heading dw-mod">@Translate("Mailing list", "Mailing list")</h4> 1583 <div class="footer__content dw-mod"> 1584 <p>@Translate("Sign up if you would like to receive occasional treats from us", "Sign up if you would like to receive occasional treats from us").</p> 1585 <form class="form dw-mod" name="NewsletterRedirect" action='/Default.aspx' method="get" enctype="multipart/form-data"> 1586 <input name="ID" id="ID" value="@newsletterSignUpPageId" type="hidden" /> 1587 <div class="form__field-combi"> 1588 <input name="NewsletterEmail" id="NewsletterEmail" type="text" class="u-w160px" placeholder='@Translate("Your email address", "Your email address")' /> 1589 <input class="btn btn--primary btn--condensed dw-mod" type="submit" id="Submitter" value='@Translate("Go", "Go")' /> 1590 </div> 1591 </form> 1592 </div> 1593 </div> 1594 } 1595 @if (Model.Area.Item.GetItems("FooterSocialLinks").Count > 0) 1596 { 1597 <div class="grid__col-md-auto"> 1598 <h4 class="footer__heading dw-mod">@Translate("Social links", "Social links")</h4> 1599 <div class="footer__content dw-mod"> 1600 <div class="collection dw-mod"> 1601 @foreach (var socialitem in Model.Area.Item.GetItems("FooterSocialLinks")) 1602 { 1603 //Fields.FirstOrDefault(x => x.SystemName == "Icon").GetString() 1604 var socialIcon = socialitem.GetValue("Icon") as Dynamicweb.Frontend.ListViewModel; 1605 string socialIconClass = socialIcon.SelectedValue; 1606 string socialIconTitle = socialIcon.SelectedName; 1607 string socialLink = socialitem.GetString("Link"); 1608 1609 <a href="@socialLink" target="_blank" title="@socialIconTitle"><i class="fa @socialIconClass fa-2x"></i></a> 1610 } 1611 </div> 1612 </div> 1613 </div> 1614 } 1615 <div class="grid__col-12 footer__copyright dw-mod"> 1616 <p>@Model.Area.Item.GetString("FooterCopyrightText")</p> 1617 </div> 1618 </div> 1619 </div> 1620 </footer> 1621 } 1622 1623 1624 @* Templates for Typeahead *@ 1625 <script id="SearchGroupsTemplate" type="text/x-template"> 1626 {{#.}} 1627 <li class="dropdown__item dw-mod" onclick="Search.UpdateGroupSelection(this)" data-group-id="{{id}}">{{name}}</li> 1628 {{/.}} 1629 </script> 1630 1631 <script id="SearchContentTemplate" type="text/x-template"> 1632 {{#each .}} 1633 {{#Product}} 1634 {{#ifCond template "!==" "SearchMore"}} 1635 <li class="dropdown__item dropdown__item--seperator dw-mod"> 1636 <div> 1637 <a href="{{link}}" class="js-typeahead-link u-color-inherit u-pull--left"> 1638 <div class="u-margin-right u-pull--left {{noimage}} u-hidden-xs u-hidden-xxs"><img src="/Admin/Public/GetImage.ashx?width=45&height=36&crop=5&FillCanvas=True&Compression=75&image={{image}}" alt="{{name}}"></div> 1639 <div class="u-pull--left"> 1640 <div class="u-bold u-max-w220px u-truncate-text js-typeahead-name">{{name}}</div> 1641 @if (!onlyPreview) 1642 { 1643 <div class="{{onlyPreview}}">{{price}}</div> 1644 } 1645 </div> 1646 </a> 1647 @*<div class="u-margin-left u-pull--right u-w80px u-hidden-xs u-hidden-xxs"> 1648 <button class="btn btn--primary btn--condensed btn--full u-no-margin dw-mod {{hideBuyOptions}} js-ignore-click-outside" onclick="Cart.AddToCart(event, '{{productId}}', '1')"><i class="fa fa-shopping-cart js-ignore-click-outside"></i></button> 1649 <a href="{{link}}" class="btn btn--secondary btn--condensed btn--full u-no-margin dw-mod {{hideViewMore}} js-ignore-click-outside">@Translate("View")</a> 1650 </div>*@ 1651 </div> 1652 </li> 1653 {{/ifCond}} 1654 {{#ifCond template "===" "SearchMore"}} 1655 {{>SearchMore}} 1656 {{/ifCond}} 1657 {{/Product}} 1658 {{else}} 1659 <li class="dropdown__item dropdown__item--seperator dw-mod"> 1660 @Translate("No products found") 1661 </li> 1662 {{/each}} 1663 </script> 1664 1665 <script id="SearchMore" type="text/x-template"> 1666 <li class="dropdown__item dropdown__item--not-selectable dw-mod"> 1667 <a href="/Default.aspx?ID=@productsPageId&Search={{searchParameter}}&GroupID={{groupId}}" class="btn btn--primary btn--full u-no-margin dw-mod js-typeahead-link"> 1668 @Translate("View all") 1669 </a> 1670 </li> 1671 </script> 1672 1673 @* Templates for the mini cart *@ 1674 <script id="MiniCartCounterContent" type="text/x-template"> 1675 {{#.}} 1676 <div class="js-mini-cart-counter-content dw-mod"> 1677 {{numberofproducts}} 1678 </div> 1679 {{/.}} 1680 </script> 1681 1682 <script id="MiniCartContent" type="text/x-template"> 1683 {{#.}} 1684 <div class="mini-cart-dropdown__inner {{isempty}} dw-mod"> 1685 <h4 class="u-ta-center u-no-margin u-margin-bottom u-margin-top">@Translate("Shopping cart")</h4> 1686 <div class="mini-cart-dropdown__body dw-mod"> 1687 <table class="table mini-cart-table dw-mod"> 1688 <thead> 1689 <tr> 1690 <td>&nbsp;</td> 1691 <td>@Translate("Product")</td> 1692 <td class="u-ta-right">@Translate("Qty")</td> 1693 {{#ifCond isB2B "===" true}} 1694 <td class="u-ta-right" width="120">@Translate("Price without VAT")</td> 1695 {{/ifCond}} 1696 {{#ifCond isB2B "!==" true}} 1697 <td class="u-ta-right" width="120">@Translate("Price")</td> 1698 {{/ifCond}} 1699 </tr> 1700 </thead> 1701 1702 {{#OrderLines}} 1703 {{#ifCond template "===" "CartOrderline"}} 1704 {{>MiniCartOrderline}} 1705 {{/ifCond}} 1706 {{#ifCond template "===" "CartOrderlineMobile"}} 1707 {{>MiniCartOrderlineMobile}} 1708 {{/ifCond}} 1709 {{#ifCond template "===" "CartOrderlineDiscount"}} 1710 {{>MiniCartOrderlineDiscount}} 1711 {{/ifCond}} 1712 {{/OrderLines}} 1713 1714 <tr> 1715 <td><i class="fa fa-credit-card"></i></td> 1716 <td>{{paymentmethod}}</td> 1717 <td colspan="2" class="u-ta-right" width="130">{{paymentfee}}</td> 1718 </tr> 1719 <tr> 1720 <td><i class="fa fa-truck"></i></td> 1721 <td>{{shippingmethod}}</td> 1722 <td colspan="2" class="u-ta-right" width="130">{{shippingfee}}</td> 1723 </tr> 1724 1725 {{#ifCond isB2B "===" true}} 1726 {{>IsB2B}} 1727 {{/ifCond}} 1728 {{#ifCond isB2B "!==" true}} 1729 {{>IsNotB2B}} 1730 {{/ifCond}} 1731 1732 </table> 1733 </div> 1734 1735 <table class="table mini-cart-table dw-mod"> 1736 <tr class="mini-cart-orderlines__footer dw-mod"> 1737 <td colspan="2"><button type="button" class="btn btn--secondary u-pull--left u-no-margin dw-mod btn--sm" onclick="Cart.EmptyCart(event)">@Translate("Empty cart")</button></td> 1738 <td colspan="2" class="u-ta-right"><a href="/Default.aspx?ID=@cartPageId" class="btn btn--primary u-pull--right u-no-margin dw-mod btn--sm">@Translate("Proceed to checkout")</a></td> 1739 </tr> 1740 </table> 1741 </div> 1742 {{/.}} 1743 </script> 1744 1745 <script id="IsB2B" type="text/x-template"> 1746 <tr class="mini-cart-totals"> 1747 <td colspan="2">@Translate("Total without VAT")</td> 1748 <td class="u-ta-right">{{numberofproducts}}</td> 1749 <td class="u-ta-right" width="130">{{priceWithoutVat}}</td> 1750 </tr> 1751 <tr> 1752 <td colspan="2">@Translate("VAT")</td> 1753 <td class="u-ta-right"></td> 1754 <td class="u-ta-right" width="130">{{totalvat}}</td> 1755 </tr> 1756 <tr class="mini-cart-totals dw-mod"> 1757 <td colspan="2">@Translate("Total with VAT")</td> 1758 <td class="u-ta-right">{{numberofproducts}}</td> 1759 <td class="u-ta-right" width="130">{{totalprice}}</td> 1760 </tr> 1761 </script> 1762 1763 <script id="IsNotB2B" type="text/x-template"> 1764 <tr class="mini-cart-totals dw-mod"> 1765 <td colspan="2">@Translate("Total")</td> 1766 <td class="u-ta-right">{{numberofproducts}}</td> 1767 <td class="u-ta-right" width="130">{{totalprice}}</td> 1768 </tr> 1769 <tr> 1770 <td colspan="2">@Translate("VAT of this")</td> 1771 <td class="u-ta-right"></td> 1772 <td class="u-ta-right" width="130">{{totalvat}}</td> 1773 </tr> 1774 </script> 1775 1776 <script id="MiniCartOrderline" type="text/x-template"> 1777 <tr class="{{isempty}}"> 1778 <td><a href="{{link}}" class="{{hideimage}}"><img src="/Admin/Public/GetImage.ashx?width=50&height=50&crop=5&Compression=75&image={{image}}" alt="{{name}}"></a></td> 1779 <td> 1780 <a href="{{link}}" class="mini-cart-orderlines__name" title="{{name}}">{{name}}</a> 1781 <a href="{{link}}" class="mini-cart-orderlines__name item-number">{{variantname}}</a> 1782 <div class="item-number">{{unitname}}</div> 1783 </td> 1784 <td class="u-ta-right">{{quantity}}</td> 1785 <td class="u-ta-right">{{totalprice}}</td> 1786 </tr> 1787 </script> 1788 1789 <script id="MiniCartOrderlineMobile" type="text/x-template"> 1790 <tr class="{{isempty}}"> 1791 <td><a href="{{link}}" class="{{hideimage}}"><img src="/Admin/Public/GetImage.ashx?width=50&height=50&crop=5&Compression=75&image={{image}}" alt="{{name}}"></a></td> 1792 <td> 1793 <a href="{{link}}" class="mini-cart-orderlines__name">{{name}}</a> 1794 <a href="{{link}}" class="mini-cart-orderlines__name item-number">{{variantname}}</a> 1795 <div class="item-number">{{unitname}}</div> 1796 </td> 1797 <td class="u-ta-right">{{quantity}}</td> 1798 <td class="u-ta-right">{{totalprice}}</td> 1799 </tr> 1800 </script> 1801 1802 <script id="MiniCartOrderlineDiscount" type="text/x-template"> 1803 <tr class="table__row--no-border {{isempty}}"> 1804 <td>&nbsp;</td> 1805 <td><div class="mini-cart-orderlines__name dw-mod">{{name}}</div></td> 1806 <td class="u-ta-right">&nbsp;</td> 1807 <td class="u-ta-right">{{totalprice}}</td> 1808 </tr> 1809 </script> 1810 1811 <!-- Javascript --> 1812 <script src="/Files/Templates/Designs/Rapido/js/handlebars-v4.0.11.js"></script> 1813 <script src="/Files/Templates/Designs/Rapido/js/master.min.js"></script> 1814 1815 @if (Model.Area.Item.GetBoolean("UseCustomJavascript")) 1816 { 1817 <script src="/Files/Templates/Designs/Rapido/js/custom.js"></script> 1818 } 1819 1820 <script> 1821 Wireframe.Init(@wireframeMode.ToLower()); 1822 function myFunction() { 1823 1824 document.getElementById("SignInModalCartTrigger").checked = true; 1825 1826 } 1827 document.getElementById("LoginFormCart").addEventListener('submit', event => { 1828 event.preventDefault(); 1829 const formdata = new FormData(document.getElementById("LoginFormCart")); 1830 const url = document.getElementById("LoginFormCart").getAttribute("action")+""; 1831 const params = new URLSearchParams(formdata); 1832 1833 const opts = { 1834 method: 'POST', 1835 body: params 1836 } 1837 1838 fetch(url, opts).then(res => { 1839 if (!res.ok) { 1840 throw new Error('Network response was not ok'); 1841 } 1842 return res.text(); 1843 }).then(data => { 1844 const parser = new DOMParser(); 1845 const htmlDocument = parser.parseFromString(data, "text/html"); 1846 var section = htmlDocument.getElementById("LoginForm").querySelector(".field-error"); 1847 if (section.innerHTML!="") { 1848 1849 var newError = document.getElementById("LoginFormCart").querySelectorAll(".field-error"); 1850 for (e = 0; e < newError.length; e++) { 1851 newError[e].innerHTML = section.textContent; 1852 1853 } 1854 1855 1856 } 1857 else { 1858 location.href = "Default.apsx?ID=@GetPageIdByNavigationTag("CartPage")"; 1859 } 1860 }).catch(err => console.log(err)) 1861 }); 1862 1863 </script> 1864 @RenderSnippet("JavaScriptBottom") 1865 </body> 1866 1867 </html> 1868 1869