Error executing template "Designs/Rapido/_parsed/Page.parsed.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_5f7c68e52b544aed8932a1e9b78a9133.Execute() in D:\Dynamicweb.net\Solutions\Peritus\ferno.staging.dynamicweb-cms.com\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 463
   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 8 @using System 9 @using System.Linq 10 @using System.Web 11 @using System.IO 12 13 @{ 14 //General settings 15 string favicon = Model.Area.Item.GetFile("LogoFavicon") != null ? Model.Area.Item.GetFile("LogoFavicon").Path : "/Files/Images/favicon.png"; 16 string logo = Model.Area.Item.GetFile("LogoImage") != null ? Model.Area.Item.GetFile("LogoImage").Path : "/Files/Images/logo-dynamicweb.png"; 17 if (Path.GetExtension(logo).ToLower() != ".svg") 18 { 19 logo = "/Admin/Public/GetImage.ashx?height=40&amp;crop=5&amp;Compression=75&amp;image=" + @logo; 20 } 21 string searchPlaceholder = Translate("Search products", "Search products"); 22 string searchValue = HttpContext.Current.Request.QueryString.Get("Search") != null ? HttpContext.Current.Request.QueryString.Get("Search") : ""; 23 string wireframeMode = Model.Area.Item.GetBoolean("WireframeMode").ToString(); 24 25 26 //bool paymentIncoice = false; 27 //var paymentInvoiceHidden = Dynamicweb.Core.Converter.ToBoolean(customSettings["Payment_Invoice"]); 28 29 //Font settings 30 string navigationFont = Model.Area.Item.GetItem("NavigationFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 31 string mobileNavigationFont = Model.Area.Item.GetItem("MobileNavigationFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 32 string headerFont = Model.Area.Item.GetItem("ContentLayoutHeaderFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 33 string subHeaderFont = Model.Area.Item.GetItem("ContentLayoutSubheaderFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 34 string contentFont = Model.Area.Item.GetItem("ContentLayoutBodyText").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 35 36 //Page IDs for use in the template 37 int pageId = Model.TopPage.ID; 38 string firstPageId = Model.Area.FirstActivePage.ID.ToString(); 39 int cartPageId = GetPageIdByNavigationTag("CartPage"); 40 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 41 int cartFeedPageId = GetPageIdByNavigationTag("CartOrderlinesFeed"); 42 int productsPageId = GetPageIdByNavigationTag("ProductsPage"); 43 int productSearchPageId = GetPageIdByNavigationTag("ProductSearchFeed"); 44 int productGroupsPageId = GetPageIdByNavigationTag("ProductGroupsFeed"); 45 46 int impersonationPageId = GetPageIdByNavigationTag("Impersonation"); 47 48 bool stickyMenu = Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet" ? false : Model.Area.Item.GetBoolean("NavigationStickyMenu"); 49 string stickyTop = stickyMenu ? "top-container--sticky" : ""; 50 string pagePos = stickyMenu ? "js-page-pos" : ""; 51 string topLayout = Model.Area.Item.GetList("LayoutTop").SelectedValue; 52 bool renderPagesInToolBar = Model.Area.Item.GetBoolean("RenderPagesInToolBar"); 53 54 string autoCssLink = "/Files/Templates/Designs/Rapido/css/rapido/rapido_" + Model.Area.ID.ToString() + ".min.css?ticks=" + Model.Area.UpdatedDate.Ticks; 55 56 string userInitials = ""; 57 if (Model.CurrentUser.ID != 0) 58 { 59 if (!String.IsNullOrEmpty(Model.CurrentUser.Name)) 60 { 61 string[] names = Model.CurrentUser.Name.Split(' '); 62 userInitials += Model.CurrentUser.Name.Substring(0, 1); 63 64 if (names.Length > 0) 65 { 66 userInitials += names[names.Length - 1].Substring(0, 1); 67 } 68 } 69 else 70 { 71 userInitials += Model.CurrentUser.FirstName != null && Model.CurrentUser.FirstName != "" ? Model.CurrentUser.FirstName.Substring(0, 1) : ""; 72 userInitials += Model.CurrentUser.LastName != null && Model.CurrentUser.LastName != "" ? Model.CurrentUser.LastName.Substring(0, 1) : ""; 73 userInitials += userInitials.Length == 1 && Model.CurrentUser.FirstName != null && Model.CurrentUser.FirstName.Length > 1 ? Model.CurrentUser.FirstName.Substring(1, 2) : ""; 74 userInitials += userInitials == "" && Model.CurrentUser.Email != null && Model.CurrentUser.Email.Length > 1 ? Model.CurrentUser.Email.Substring(0, 2) : ""; 75 } 76 } 77 78 string url = HttpContext.Current.Request.Url.Host; 79 80 81 82 } 83 <!DOCTYPE html> 84 85 <html lang="@Pageview.Area.CultureInfo.TwoLetterISOLanguageName"> 86 <head> 87 <meta charset="utf-8" /> 88 <title>@Model.TopPage.Name</title> 89 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1"> 90 <meta name="robots" content="index, follow"> 91 @System.Net.WebUtility.HtmlDecode(Model.MetaTags) 92 @RenderSnippet("FBImage") 93 94 <!-- Favicon --> 95 <link href="@favicon" rel="icon" type="image/png"> 96 97 <!-- Font awesome --> 98 <link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/rapido/font-awesome.min.css" type="text/css"> 99 100 <!-- Base (Default, wireframe) styles --> 101 <link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/base/base.css" type="text/css"> 102 103 <!-- Rapido Css from Website Settings --> 104 <link id="rapidoCss" rel="stylesheet" href="@autoCssLink" type="text/css"> 105 106 <!-- Ignite Css (Custom site specific styles) --> 107 <link id="igniteCss" type="text/css" href="/Files/Templates/Designs/Rapido/css/ignite/ignite.min.css" rel="stylesheet"> 108 109 <!-- Google fonts --> 110 @{ 111 var fonts = new string[5] { @navigationFont, @mobileNavigationFont, @headerFont, @subHeaderFont, @contentFont }; 112 var family = string.Join("|", fonts.Distinct().Select(x => string.Format("{0}:100,200,300,400,500,600,700,800,900", x))); 113 } 114 <link href="https://fonts.googleapis.com/css?family=@family" rel="stylesheet"> 115 116 @RenderSnippet("TagManager") 117 <!--Google Tag Manager--> 118 @if (true) //!url.Contains("dev") && !url.Contains("staging") 119 { 120 <script> 121 (function (w, d, s, l, i) { 122 w[l] = w[l] || []; 123 w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' }); 124 var f = d.getElementsByTagName(s)[0], 125 j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; 126 j.async = true; 127 j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; 128 f.parentNode.insertBefore(j, f); 129 })(window, document, 'script', 'dataLayer', 'GTM-MVHFK2B');</script> 130 } 131 <!--END Google Tag Manager--> 132 <!-- Global site tag (gtag.js) - Google Analytics --> 133 134 <script async src="https://www.googletagmanager.com/gtag/js?id=UA-125792852-1"></script> 135 136 <script> 137 window.dataLayer = window.dataLayer || []; 138 function gtag() { dataLayer.push(arguments); } 139 gtag('js', new Date()); 140 141 gtag('config', 'UA-125792852-1'); 142 </script> 143 144 </head> 145 146 <body> 147 <!--Google Tag Manager (noscript)--> 148 @if (true) //!url.Contains("dev") && !url.Contains("staging") 149 { 150 <noscript> 151 <iframe src="https://www.googletagmanager.com/ns.html?id=GTM-MVHFK2B" 152 height="0" width="0" style="display:none;visibility:hidden"></iframe> 153 </noscript> 154 } 155 <!---End Google Tag Manager (noscript)--> 156 @MobileNavigation(userInitials) 157 158 @LoginModal() 159 160 <main class="site dw-mod"> 161 <header class="top-container @stickyTop dw-mod" id="Top"> 162 @if (renderPagesInToolBar) 163 { 164 <div class="tools-navigation dw-mod"> 165 <div class="center-container grid top-container__center-container dw-mod"> 166 <div class="grid__col-xs-12 grid__col--bleed-y"> 167 <div class="grid__cell grid__cell--align-middle-right"> 168 @RenderNavigation(new 169 { 170 id = "topnavigation", 171 cssclass = "menu menu-tools dw-mod dwnavigation", 172 template = "TopMenu.xslt" 173 }) 174 </div> 175 </div> 176 </div> 177 </div> 178 } 179 <div class="tools-navigation dw-mod"> 180 <div class="center-container grid top-container__center-container dw-mod"> 181 <div class="grid__col-xs-12 grid__col--bleed-y"> 182 <div class="grid__cell grid__cell--align-middle-right"> 183 @RenderNavigation(new 184 { 185 id = "toolsnavigation", 186 cssclass = "menu menu-tools dw-mod dwnavigation", 187 template = "ToolsMenu.xslt", 188 parenttag = "toolMenuPage" 189 190 191 }) 192 </div> 193 </div> 194 </div> 195 </div> 196 @if (topLayout == "normal") 197 { 198 <!-- Header --> 199 <div class="header header-top dw-mod"> 200 <div class="center-container top-container__center-container dw-mod"> 201 <div class="grid"> 202 203 @* Logo *@ 204 @if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 205 { 206 <div class="grid__col-md-3 grid__col-sm-3 grid--align-self-center grid__col--bleed-y"> 207 <div class="logo dw-mod"> 208 <a href="/Default.aspx?ID=@firstPageId"> 209 <img class="grid__cell-img" src="@logo" alt="Logo" /> 210 </a> 211 </div> 212 </div> 213 } 214 @if (Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") 215 { 216 <div class="grid__col-12"> 217 <div class="grid__cell"> 218 <div class="logo u-max-w220px u-middle u-margin-bottom dw-mod"> 219 <a href="/Default.aspx?ID=@firstPageId"> 220 <img class="grid__cell-img" src="@logo" alt="Logo" /> 221 </a> 222 </div> 223 </div> 224 </div> 225 } 226 227 @if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 228 { 229 @* Search *@ 230 <div class="grid__col-6 grid__col--bleed-y grid--align-self-center"> 231 <div class="typeahead u-margin u-color-inherit js-typeahead" data-page-size="10" id="TopProductSearch" data-search-page-id="@productSearchPageId" data-result-page-id="@productsPageId" data-groups-page-id="@productGroupsPageId"> 232 <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> 233 <ul class="dropdown dropdown--absolute-position js-ajax-container js-typeahead-groups-content dw-mod" id="TopProductSearchGroupsContent" data-template="SearchGroupsTemplate" data-json-feed="/Default.aspx?ID=@productGroupsPageId&feedType=productGroups" data-init-onload="false"></ul> 234 <input type="text" class="typeahead-search-field u-no-margin js-typeahead-search-field" placeholder="@searchPlaceholder" value="@searchValue"> 235 <ul class="dropdown dropdown--absolute-position u-full-width js-ajax-container js-typeahead-search-content u-full-width dw-mod" id="TopProductSearchContent" data-template="SearchContentTemplate" data-no-result-template="SearchEmpty" data-json-feed="/Default.aspx?ID=@productSearchPageId&feedType=productsOnly" data-init-onload="false" data-preloader="minimal"></ul> 236 <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> 237 </div> 238 </div> 239 240 <div class="grid__cell grid__cell--align-middle-right"> 241 <ul class="menu dw-mod u-pull--right"> 242 @RenderSignIn("outsideNavigation", userInitials) 243 @RenderLanguageSelector("outsideNavigation") 244 @RenderFavorites("outsideNavigation") 245 @RenderMiniCart("outsideNavigation") 246 </ul> 247 </div> 248 } 249 250 @* Mobile search *@ 251 @if (Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") 252 { 253 <div class="grid__col-12 grid__col--bleed-y grid--align-self-center"> 254 <div class="grid__cell"> 255 <div class="js-typeahead" data-page-size="10" id="MobileProductSearch" data-search-page-id="@productSearchPageId" data-result-page-id="@productsPageId"> 256 <input type="text" class="u-full-width js-typeahead-search-field" placeholder="@searchPlaceholder" value="@searchValue"> 257 <ul class="dropdown dropdown--absolute-position js-ajax-container js-typeahead-search-content dw-mod" id="MobileProductSearchContent" data-template="SearchContentTemplate" data-no-result-template="SearchEmpty" data-json-feed="/Default.aspx?ID=@productSearchPageId&feedType=productsOnly" data-init-onload="false"></ul> 258 </div> 259 </div> 260 </div> 261 } 262 </div> 263 </div> 264 </div> 265 266 <!-- Main navigation --> 267 <nav class="main-navigation dw-mod"> 268 <div class="center-container top-container__center-container dw-mod"> 269 <div class="grid"> 270 <div class="grid__col-12 grid--align-self-center grid__col--bleed"> 271 <div class="grid__cell"> 272 @MobileNavigationTrigger() 273 @RenderHeaderNavigation() 274 275 @if (Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") 276 { 277 <ul class="menu dw-mod u-pull--right"> 278 @RenderMiniCart() 279 </ul> 280 } 281 </div> 282 </div> 283 </div> 284 </div> 285 </nav> 286 } 287 288 @if (topLayout == "condensed") 289 { 290 <!-- Main navigation --> 291 <nav class="main-navigation dw-mod"> 292 <div class="center-container top-container__center-container dw-mod"> 293 <div class="grid"> 294 295 <div class="grid__col-md-3 grid--align-self-center grid__col--bleed-y"> 296 <div class="logo u-padding--xs dw-mod"> 297 <a href="/Default.aspx?ID=@firstPageId"> 298 <img class="grid__cell-img" src="@logo" alt="Logo" /> 299 </a> 300 </div> 301 </div> 302 303 @* Navigation *@ 304 <div class="u-pull--left"> 305 @MobileNavigationTrigger() 306 @RenderHeaderNavigation() 307 </div> 308 309 <div class="grid__cell grid__cell--align-middle-right"> 310 <ul class="menu dw-mod u-pull--right"> 311 @RenderSignIn("inNavigation", userInitials) 312 @RenderLanguageSelector() 313 @RenderFavorites() 314 @RenderMiniCart() 315 </ul> 316 </div> 317 </div> 318 </div> 319 </nav> 320 321 <!-- Searchbar --> 322 <div class="u-box-shadow u-color-light-gray--bg u-inline-block u-full-width"> 323 <div class="center-container top-container__center-container dw-mod"> 324 <div class="typeahead typeahead--centered u-color-inherit js-typeahead dw-mod" data-page-size="10" id="ProductSearchBar" data-search-page-id="@productSearchPageId" data-result-page-id="@productsPageId" data-groups-page-id="@productGroupsPageId"> 325 <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> 326 <ul class="dropdown dropdown--absolute-position js-ajax-container js-typeahead-groups-content dw-mod" id="ProductSearchBarGroupsContent" data-template="SearchGroupsTemplate" data-json-feed="/Default.aspx?ID=@productGroupsPageId&feedType=productGroups" data-init-onload="false"></ul> 327 <div class="typeahead-search-field"> 328 <input type="text" class="u-no-margin u-full-width js-typeahead-search-field" placeholder="@searchPlaceholder" value="@searchValue"> 329 <ul class="dropdown dropdown--absolute-position u-full-width js-ajax-container js-typeahead-search-content dw-mod" id="ProductSearchBarContent" data-template="SearchContentTemplate" data-no-result-template="SearchEmpty" data-json-feed="/Default.aspx?ID=@productSearchPageId&feedType=productsOnly" data-init-onload="false"></ul> 330 </div> 331 <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> 332 </div> 333 </div> 334 </div> 335 } 336 @if (topLayout == "minimal") 337 { 338 <!-- Main navigation --> 339 <nav class="main-navigation dw-mod"> 340 <div class="center-container top-container__center-container dw-mod"> 341 <div class="grid"> 342 343 <div class="grid__col-md-3 grid--align-self-center grid__col--bleed-y"> 344 <div class="logo u-padding--xs dw-mod"> 345 <a href="/Default.aspx?ID=@firstPageId"> 346 <img class="grid__cell-img" src="@logo" alt="Logo" /> 347 </a> 348 </div> 349 </div> 350 351 @* Navigation *@ 352 <div class="u-pull--left"> 353 @MobileNavigationTrigger() 354 @RenderHeaderNavigation() 355 </div> 356 357 <div class="grid__cell grid__cell--align-middle-right"> 358 <ul class="menu dw-mod u-pull--right"> 359 @* Search *@ 360 <li class="menu__item menu__item--horizontal menu__item--top-level u-hidden-xxs dw-mod"> 361 <div class="menu__link u-w50px is-dropdown is-dropdown--no-icon dw-mod"> 362 <i class="fa fa-search fa-1_5x"></i> 363 <div class="menu menu--dropdown u-w340px top-micro-search dw-mod"> 364 <div class="typeahead js-typeahead" data-page-size="10" id="ProductSearchBar" data-search-page-id="@productSearchPageId" data-result-page-id="@productsPageId" data-groups-page-id="@productGroupsPageId"> 365 <div class="typeahead-search-field"> 366 <input type="text" class="u-no-margin u-full-width js-typeahead-search-field" placeholder="@searchPlaceholder" value="@searchValue"> 367 <ul class="dropdown dropdown--absolute-position u-full-width js-ajax-container js-typeahead-search-content" id="ProductSearchBarContent" data-template="SearchContentTemplate" data-no-result-template="SearchEmpty" data-json-feed="/Default.aspx?ID=@productSearchPageId&feedType=productsOnly" data-init-onload="false" data-preloader="minimal"></ul> 368 </div> 369 </div> 370 </div> 371 </div> 372 </li> 373 @RenderSignIn("inNavigation", userInitials) 374 @RenderLanguageSelector() 375 @RenderFavorites() 376 @RenderMiniCart() 377 </ul> 378 </div> 379 </div> 380 </div> 381 </nav> 382 } 383 384 @* Impersonation bar *@ 385 @if (Model.CurrentUser.ID > 0 && Model.SecondaryUsers.Count > 0) 386 { 387 <div class="u-color-warning--bg"> 388 <div class="center-container top-container__center-container dw-mod"> 389 @*Impersonation*@ 390 <div class="grid"> 391 <div class="grid--align-self-center grid__col-x"> 392 @if (Model.CurrentSecondaryUser != null && Model.CurrentSecondaryUser.ID > 0) 393 { 394 string stopImpersonateTranslation = Translate("Stop impersonation"); 395 string username = ""; 396 if (!string.IsNullOrEmpty(Model.CurrentSecondaryUser.FirstName) && !string.IsNullOrEmpty(Model.CurrentSecondaryUser.LastName)) 397 { 398 username = Model.CurrentSecondaryUser.FirstName + " " + Model.CurrentSecondaryUser.LastName; 399 } 400 else if (!string.IsNullOrEmpty(Model.CurrentSecondaryUser.Name)) 401 { 402 username = Model.CurrentSecondaryUser.Name; 403 } 404 else if (!string.IsNullOrEmpty(Model.CurrentSecondaryUser.Email)) 405 { 406 username = Model.CurrentSecondaryUser.Email; 407 } 408 else 409 { 410 username = Model.CurrentSecondaryUser.UserName; 411 } 412 <div class="grid-cell"> 413 <div class="u-pull--left u-bold u-margin-top"> 414 <i class="fa fa-user-secret"></i> 415 @Pageview.User.UserName<text>&nbsp;</text>@Translate("is impersonated by")<text>&nbsp;</text>@username 416 </div> 417 <form method="post" class="u-pull--right u-no-margin"> 418 <input type="submit" class="btn btn--secondary dw-mod u-no-margin" name="DwExtranetRemoveSecondaryUser" value="@stopImpersonateTranslation"> 419 </form> 420 </div> 421 } 422 else 423 { 424 string viewListTranslation = Translate("View the list of users you can impersonate"); 425 <div class="grid-cell u-bold"> 426 <i class="fa fa-user-secret"></i> 427 <a href="/Default.aspx?ID=@impersonationPageId" title="@viewListTranslation" class="u-color-font-black">@viewListTranslation</a> 428 </div> 429 } 430 </div> 431 </div> 432 </div> 433 </div> 434 } 435 </header> 436 <!-- Floating mini cart --> 437 @if (!stickyMenu && pageId == productsPageId && Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 438 { 439 <div class="floating-mini-cart u-hidden dw-mod" id="FloatingMiniCart"> 440 <div class="mini-cart dw-mod"> 441 <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')"> 442 <i class="fa fa-shopping-cart fa-4x"></i> 443 <div class="mini-cart__counter mini-cart__counter--lg dw-mod"> 444 <div class="js-ajax-container 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"> 445 <div class="js-mini-cart-counter-content"> 446 @Model.Cart.TotalProductsCount 447 </div> 448 </div> 449 </div> 450 </a> 451 452 <div class="mini-cart-dropdown js-ajax-container 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> 453 </div> 454 </div> 455 } 456 457 <!-- Render the content --> 458 <div id="Page" class="page @pagePos"> 459 <section class="center-container content-container dw-mod" id="content"> 460 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 461 462 463 @if (Model.PropertyItem.GetBoolean("ShowBreadcrumb")) { 464 <div class="grid__col-12 grid__col--bleed-y"> 465 @RenderNavigation(new 466 { 467 id = "breadcrumb", 468 template = "breadcrumb.xslt" 469 }) 470 </div> 471 } 472 473 <div class="grid"> 474 @if (Model.PropertyItem.GetBoolean("LeftMenu") && RenderNavigation(new { }) != null) 475 { 476 <nav class="grid__col-md-3 grid__col-sm-12 grid__col-xs-12 paragraph-container"> 477 <div class="grid__cell"> 478 @RenderNavigation(new 479 { 480 id = "leftnav", 481 cssclass = "menu dwnavigation", 482 endlevel = 5, 483 template = "LeftNavigation.xslt" 484 }) 485 </div> 486 </nav> 487 } 488 <div class="grid__col-auto grid__col--bleed"> 489 <div class="grid"> 490 @Model.Placeholder("dwcontent", "content", "default:true;sort:1") 491 </div> 492 </div> 493 </div> 494 </section> 495 </div> 496 </main> 497 498 @RenderFooter() 499 500 501 <!-- Content rendering helpers --> 502 503 @helper MobileNavigation(string userInitials) 504 { 505 int pageId = Model.TopPage.ID; 506 string mobileNavigationLevels = Model.Area.Item.GetBoolean("MobileNavigationLevels") ? Model.Area.Item.GetString("MobileNavigationLevels") : "3"; 507 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 508 int cartFeedPageId = GetPageIdByNavigationTag("CartOrderlinesFeed"); 509 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 510 string myProfilePageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerProfile").ToString() : GetPageIdByNavigationTag("CustomerProfile").ToString(); 511 string myOrdersPageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerOrders").ToString() : GetPageIdByNavigationTag("CustomerOrders").ToString(); 512 string myFavoritesPageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerFavorites").ToString() : GetPageIdByNavigationTag("CustomerFavorites").ToString(); 513 bool renderPagesInToolBar = Model.Area.Item.GetBoolean("RenderPagesInToolBar"); 514 string menuTemplate = "BaseMenuForMobileExpandable.xslt"; 515 int startLevel = renderPagesInToolBar ? 1 : 0; 516 517 bool showRequestProfileLink = false; 518 var customSettings = Dynamicweb.Content.Items.Item.GetItemById("CustomWebsiteSettings", Pageview.Area.Item["CustomSettings"].ToString()); 519 showRequestProfileLink = Dynamicweb.Core.Converter.ToBoolean(customSettings["RequestProfileLink"]); 520 521 if (Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") 522 { 523 <!-- Trigger for mobile navigation --> 524 <input type="checkbox" id="MobileNavTrigger" class="mobile-nav-trigger" autocomplete="off" /> 525 526 <!-- Mobile navigation --> 527 <nav class="mobile-navigation dw-mod"> 528 @if (Model.CurrentUser.ID > 0) 529 { 530 string userName = Model.CurrentUser.FirstName != null ? Model.CurrentUser.FirstName : ""; 531 userName += " " + Model.CurrentUser.LastName != null ? Model.CurrentUser.LastName : ""; 532 userName += userName == "" && Model.CurrentUser.UserName != null ? Model.CurrentUser.UserName : ""; 533 534 <ul class="menu menu-mobile"> 535 <li class="menu-mobile__item"> 536 <a href="/default.aspx?ID=@myProfilePageId" class="menu-mobile__link dw-mod"><i class="fa fa-user menu-mobile__link-icon"></i> @userName</a> 537 </li> 538 </ul> 539 } 540 541 @RenderNavigation(new 542 { 543 id = "mobilenavigation", 544 cssclass = "menu menu-mobile dwnavigation", 545 startLevel = @startLevel, 546 ecomStartLevel = @startLevel+1, 547 endlevel = @mobileNavigationLevels, 548 expandmode = "all", 549 template = @menuTemplate 550 }) 551 552 @if (renderPagesInToolBar) 553 { 554 @RenderNavigation(new 555 { 556 id = "topToolsMobileNavigation", 557 cssclass = "menu menu-mobile dwnavigation", 558 template = "ToolsMenuForMobile.xslt" 559 }) 560 } 561 562 <ul class="menu menu-mobile"> 563 @if (Model.CurrentUser.ID <= 0) 564 { 565 <li class="menu-mobile__item"> 566 <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> 567 </li> 568 569 if (showRequestProfileLink) 570 { 571 <li class="menu-mobile__item"> 572 <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> 573 </li> 574 } 575 } 576 else 577 { 578 <li class="menu-mobile__item"> 579 <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> 580 </li> 581 <li class="menu-mobile__item"> 582 <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> 583 </li> 584 <li class="menu-mobile__item"> 585 <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> 586 </li> 587 <li class="menu-mobile__item"> 588 <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> 589 </li> 590 } 591 592 @if (Model.Languages.Count > 0) 593 { 594 string selectedLanguage = ""; 595 foreach (var lang in Model.Languages) 596 { 597 if (lang.IsCurrent) 598 { 599 selectedLanguage = lang.Name; 600 } 601 } 602 603 604 605 <li class="menu-mobile__item dw-mod"> 606 <input id="MobileMenuCheck_Language" type="checkbox" class="expand-trigger"> 607 <div class="menu-mobile__link__wrap"> 608 <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> 609 <label for="MobileMenuCheck_Language" class="menu-mobile__trigger"></label> 610 </div> 611 <ul class="menu-mobile menu-mobile__submenu expand-menu"> 612 @foreach (var lang in Model.Languages) 613 { 614 615 <li class="menu-mobile__item dw-mod"> 616 <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> 617 </li> 618 619 620 } 621 </ul> 622 </li> 623 } 624 </ul> 625 </nav> 626 <label class="mobile-nav-trigger-off" for="MobileNavTrigger"></label> 627 628 <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> 629 } 630 } 631 632 @helper LoginModal() 633 { 634 int pageId = Model.TopPage.ID; 635 string topLayout = Model.Area.Item.GetList("LayoutTop").SelectedValue; 636 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 637 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 638 string forgotPasswordPageId = signInProfilePageId.ToString() + "&LoginAction=Recovery"; 639 string userSignedInError = !Model.LogOnFailed ? "" : "checked"; 640 string userSignedInErrorText = ""; 641 642 bool showRequestProfileLink = false; 643 var customSettings = Dynamicweb.Content.Items.Item.GetItemById("CustomWebsiteSettings", Pageview.Area.Item["CustomSettings"].ToString()); 644 showRequestProfileLink = Dynamicweb.Core.Converter.ToBoolean(customSettings["RequestProfileLink"]); 645 646 647 if (Model.LogOnFailed) 648 { 649 switch (Model.LogOnFailedReason) 650 { 651 case Dynamicweb.Security.UserManagement.LogOnFailedReason.PasswordLengthInvalid: 652 userSignedInErrorText = Translate("Password length is invalid"); 653 break; 654 case Dynamicweb.Security.UserManagement.LogOnFailedReason.IncorrectLogin: 655 userSignedInErrorText = Translate("Invalid email or password"); 656 break; 657 case Dynamicweb.Security.UserManagement.LogOnFailedReason.ExceededFailedLogOnLimit: 658 userSignedInErrorText = Translate("You have exceeded the limit of allowed login attempts. The user account is temporarily locked"); 659 break; 660 case Dynamicweb.Security.UserManagement.LogOnFailedReason.LoginLocked: 661 userSignedInErrorText = Translate("The user account is temporarily locked"); 662 break; 663 case Dynamicweb.Security.UserManagement.LogOnFailedReason.PasswordExpired: 664 userSignedInErrorText = Translate("The password has expired and needs to be renewed"); 665 break; 666 default: 667 userSignedInErrorText = Translate("An unknown error occured"); 668 break; 669 } 670 } 671 672 <!-- Trigger for the login modal --> 673 <input type="checkbox" id="SignInModalTrigger" class="modal-trigger @topLayout" @userSignedInError /> 674 675 <!-- Login modal --> 676 <div class="modal-container"> 677 <label for="SignInModalTrigger" id="SignInModalOverlay" class="modal-overlay"></label> 678 <div class="modal modal--xs" id="SignInModal"> 679 <div class="modal__header"> 680 <h2>@Translate("Sign in")</h2> 681 </div> 682 <div class="modal__body"> 683 <form method="post" id="LoginForm" class="u-no-margin"> 684 <input type="hidden" name="ID" value="@pageId" /> 685 <input type="hidden" name="DWExtranetUsernameRemember" value="True" /> 686 <input type="hidden" name="DWExtranetPasswordRemember" value="True" /> 687 <input type="text" class="u-full-width" id="LoginUsername" name="username" placeholder="@Translate("Email")" /> 688 <input type="password" class="u-full-width" id="LoginPassword" name="password" placeholder="@Translate("Password")" /> 689 <div class="field-error dw-mod">@userSignedInErrorText</div> 690 691 <label> 692 <input type="checkbox" id="RememberMe" name="Autologin" checked="checked" value="True"> 693 <span>@Translate("Remember me", "Remember me")</span> 694 </label> 695 696 <button type="submit" class="btn btn--primary btn--full dw-mod" name="LoginAction" value="Login" onclick="Buttons.LockButton(event)">@Translate("Sign in")</button> 697 698 <a class="btn btn--link-clean dw-mod" href="/Default.aspx?id=@forgotPasswordPageId">@Translate("Forgot your password?", "Forgot your password?")</a> 699 700 @if (showRequestProfileLink) 701 { 702 <a class="btn btn--link-clean dw-mod" href="/default.aspx?ID=@createAccountPageId">@Translate("Create account")?</a> 703 } 704 </form> 705 </div> 706 </div> 707 </div> 708 } 709 710 @helper RenderHeaderNavigation() 711 { 712 bool megaMenu = Model.Area.Item.GetList("NavigationMegaMenu").SelectedValue.ToLower() == "true" ? true : false; 713 string megamenuPromotionImage = Model.Area.Item.GetFile("NavigationMegamenuPromotionImage") != null ? Model.Area.Item.GetFile("NavigationMegamenuPromotionImage").Path : ""; 714 bool renderPagesInToolBar = Model.Area.Item.GetBoolean("RenderPagesInToolBar"); 715 int startLevel = renderPagesInToolBar ? 1 : 0; 716 717 if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 718 { 719 if (!megaMenu) 720 { 721 @RenderNavigation(new 722 { 723 id = "topnavigation", 724 cssclass = "menu dw-mod dwnavigation", 725 startLevel = @startLevel, 726 ecomStartLevel = @startLevel + 1, 727 endlevel = 5, 728 expandmode= "all", 729 template = "BaseMenuWithDropdown.xslt" 730 }); 731 } 732 else 733 { 734 @RenderNavigation(new 735 { 736 id = "topnavigation", 737 cssclass = "menu dw-mod dwnavigation", 738 startLevel = @startLevel, 739 ecomStartLevel = @startLevel + 1, 740 endlevel = 5, 741 promotionImage = megamenuPromotionImage, 742 promotionLink = Model.Area.Item.GetString("NavigationMegamenuPromotionLink"), 743 template = "BaseMegaMenu.xslt" 744 }); 745 } 746 } 747 } 748 749 @helper MobileNavigationTrigger() 750 { 751 @* Mobile navigation trigger *@ 752 753 if (Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") 754 { 755 <div class="menu dw-mod u-pull--left"> 756 <div class="menu__item menu__item--horizontal menu__item--top-level dw-mod"> 757 <label for="MobileNavTrigger" class="mobile-nav-trigger-button menu__link dw-mod"></label> 758 </div> 759 </div> 760 } 761 } 762 763 @helper RenderLanguageSelector(string type = "inNavigation") 764 { 765 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"; 766 string menuLinkClass = type == "inNavigation" ? "menu__link" : "header-menu__link"; 767 768 @* Language selector *@ 769 if (Model.Languages.Count > 1) 770 { 771 772 <li class="@liClasses"> 773 <div class="@menuLinkClass u-w40px is-dropdown is-dropdown--no-icon dw-mod"> 774 <i class="fa fa-flag fa-1_5x"></i> 775 <div class="menu menu--dropdown u-w100px dw-mod"> 776 @foreach (var lang in Model.Languages) 777 { 778 779 <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> 780 781 } 782 </div> 783 </div> 784 </li> 785 } 786 } 787 788 @helper RenderMiniCart(string type = "inNavigation") 789 { 790 string liClasses = type == "inNavigation" ? "menu__item menu__item--horizontal menu__item--top-level dw-mod" : "menu__item menu__item--horizontal menu--clean dw-mod"; 791 string menuLinkClass = type == "inNavigation" ? "menu__link" : "header-menu__link"; 792 793 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 794 int cartFeedPageId = GetPageIdByNavigationTag("CartOrderlinesFeed"); 795 int cartPageId = GetPageIdByNavigationTag("CartPage"); 796 double cartProductsCount = Model.Cart.TotalProductsCount; 797 798 @* Mini cart *@ 799 <li class="@liClasses"> 800 <div class="mini-cart dw-mod"> 801 <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')"> 802 <i class="fa fa-shopping-cart fa-1_5x"></i> 803 <div class="mini-cart__counter mini-cart__counter--inline dw-mod"> 804 <div class="js-ajax-container 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"> 805 <div class="js-mini-cart-counter-content"> 806 @cartProductsCount 807 </div> 808 </div> 809 </div> 810 </a> 811 @if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 812 { 813 <div class="mini-cart-dropdown js-ajax-container 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> 814 } 815 </div> 816 </li> 817 } 818 819 @helper RenderSignIn(string type = "inNavigation", string userInitials = "") 820 { 821 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"; 822 string menuLinkClass = type == "inNavigation" ? "menu__link" : "header-menu__link"; 823 824 int pageId = Model.TopPage.ID; 825 string myProfilePageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerProfile").ToString() : GetPageIdByNavigationTag("CustomerProfile").ToString(); 826 string myOrdersPageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerOrders").ToString() : GetPageIdByNavigationTag("CustomerOrders").ToString(); 827 int myDashboardPageId = GetPageIdByNavigationTag("CustomerDashboard"); 828 string myFavoritesPageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerFavorites").ToString() : GetPageIdByNavigationTag("CustomerFavorites").ToString(); 829 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 830 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 831 string forgotPasswordPageId = signInProfilePageId.ToString() + "&LoginAction=Recovery"; 832 833 bool showRequestProfileLink = false; 834 var customSettings = Dynamicweb.Content.Items.Item.GetItemById("CustomWebsiteSettings", Pageview.Area.Item["CustomSettings"].ToString()); 835 showRequestProfileLink = Dynamicweb.Core.Converter.ToBoolean(customSettings["RequestProfileLink"]); 836 837 @* Sign in + Customer center links *@ 838 <li class="@liClasses"> 839 <div class="@menuLinkClass is-dropdown is-dropdown--no-icon u-w40px dw-mod"> 840 @if (Model.CurrentUser.ID <= 0) 841 { 842 <i class="fa fa-user fa-1_5x"></i> 843 } 844 else 845 { 846 <a href="/default.aspx?ID=@myDashboardPageId" class="u-color-inherit"><div class="circle-icon-btn">@userInitials.ToUpper()</div></a> 847 } 848 849 <div class="menu menu--dropdown sign-in-dropdown dw-mod"> 850 <ul class="list list--clean dw-mod"> 851 @if (Model.CurrentUser.ID <= 0) 852 { 853 <li> 854 <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> 855 </li> 856 857 if (showRequestProfileLink) 858 { 859 <li> 860 <a href="/default.aspx?ID=@createAccountPageId" class="list__link dw-mod">@Translate("Create account")</a> 861 </li> 862 } 863 864 <li> 865 <a href="/default.aspx?ID=@forgotPasswordPageId" class="list__link dw-mod">@Translate("Forgot your password?")</a> 866 </li> 867 @*<li class="list__seperator dw-mod"></li>*@ 868 } 869 870 @if (Model.CurrentUser.ID > 0) 871 { 872 <li> 873 <a href="/default.aspx?ID=@myProfilePageId" class="list__link dw-mod"><i class="fa fa-user"></i> @Translate("My Profile")</a> 874 </li> 875 <li> 876 <a href="/default.aspx?ID=@myOrdersPageId" class="list__link dw-mod"><i class="fa fa-list"></i> @Translate("My Orders")</a> 877 </li> 878 <li> 879 <a href="/default.aspx?ID=@myFavoritesPageId" class="list__link dw-mod"><i class="fa fa-star"></i> @Translate("My Favorites")</a> 880 </li> 881 <li class="list__seperator dw-mod"></li> 882 <li> 883 <a href="/Admin/Public/ExtranetLogoff.aspx?ID=@pageId" class="list__link dw-mod">@Translate("Sign out")</a> 884 </li> 885 } 886 </ul> 887 </div> 888 </div> 889 </li> 890 } 891 892 @helper RenderFavorites(string type = "inNavigation") 893 { 894 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"; 895 string menuLinkClass = type == "inNavigation" ? "menu__link" : "header-menu__link"; 896 897 string myFavoritesPageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerFavorites").ToString() : GetPageIdByNavigationTag("CustomerFavorites").ToString(); 898 899 @* Favorites *@ 900 if (Model.CurrentUser.ID > 0) 901 { 902 <li class="@liClasses"> 903 <a href="/Default.aspx?ID=@myFavoritesPageId" class="@menuLinkClass dw-mod"> 904 <i class="fa fa-star fa-1_5x"></i> 905 </a> 906 </li> 907 } 908 } 909 910 911 @helper RenderFooter() 912 { 913 string footerColumnOneContent = !string.IsNullOrEmpty(Model.Area.Item.GetString("FooterColumnOne")) ? Model.Area.Item.GetString("FooterColumnOne") : ""; 914 string footerColumnTwoContent = !string.IsNullOrEmpty(Model.Area.Item.GetString("FooterColumnTwo")) ? Model.Area.Item.GetString("FooterColumnTwo") : ""; 915 string footerColumnOneHeader = Model.Area.Item.GetString("FooterColumnOneHeader"); 916 string footerColumnTwoHeader = Model.Area.Item.GetString("FooterColumnTwoHeader"); 917 int newsletterSignUpPageId = GetPageIdByNavigationTag("NewsletterSignUp"); 918 919 <!-- Footer section --> 920 <footer class="footer dw-mod"> 921 <div class="center-container top-container__center-container dw-mod"> 922 <div class="grid"> 923 @if (!string.IsNullOrEmpty(footerColumnOneContent) || !string.IsNullOrEmpty(footerColumnOneHeader)) 924 { 925 <div class="grid__col-md-auto"> 926 <h4 class="footer__heading dw-mod">@footerColumnOneHeader</h4> 927 @footerColumnOneContent 928 </div> 929 } 930 @if (!string.IsNullOrEmpty(footerColumnTwoContent) || !string.IsNullOrEmpty(footerColumnTwoHeader)) 931 { 932 <div class="grid__col-md-auto"> 933 <h4 class="footer__heading dw-mod">@footerColumnTwoHeader</h4> 934 @footerColumnTwoContent 935 </div> 936 } 937 @if (Model.Area.Item.GetBoolean("FooterNewsletterSignUp")) 938 { 939 <div class="grid__col-md-auto"> 940 <h4 class="footer__heading dw-mod">@Translate("Mailing list", "Mailing list")</h4> 941 <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> 942 <form class="form dw-mod" name="NewsletterRedirect" action='/Default.aspx' method="get" enctype="multipart/form-data"> 943 <input name="ID" id="ID" value="@newsletterSignUpPageId" type="hidden" /> 944 <div class="form__field-combi"> 945 <input name="NewsletterEmail" id="NewsletterEmail" type="text" placeholder='@Translate("Your email address", "Your email address")' /> 946 <input class="btn btn--primary dw-mod" type="submit" id="Submitter" value='@Translate("Go", "Go")' /> 947 </div> 948 </form> 949 </div> 950 } 951 @if (Model.Area.Item.GetItems("FooterSocialLinks").Count > 0) 952 { 953 <div class="grid__col-md-auto"> 954 <h4 class="footer__heading dw-mod">@Translate("Social links", "Social links")</h4> 955 956 <div class="collection dw-mod"> 957 @foreach (var socialitem in Model.Area.Item.GetItems("FooterSocialLinks")) 958 { 959 //Fields.FirstOrDefault(x => x.SystemName == "Icon").GetString() 960 var socialIcon = socialitem.GetValue("Icon") as Dynamicweb.Frontend.ListViewModel; 961 string socialIconClass = socialIcon.SelectedValue; 962 string socialIconTitle = socialIcon.SelectedName; 963 string socialLink = socialitem.GetString("Link"); 964 965 <a href="@socialLink" title="@socialIconTitle"><i class="fa @socialIconClass fa-2x"></i></a> 966 } 967 </div> 968 </div> 969 } 970 <div class="grid__col-12 grid--align-center"> 971 <p>@Model.Area.Item.GetString("FooterCopyrightText")</p> 972 </div> 973 </div> 974 </div> 975 </footer> 976 } 977 978 979 @* Templates for Typeahead *@ 980 <script id="SearchGroupsTemplate" type="text/x-template"> 981 <li class="dropdown__item dw-mod" onclick="Search.UpdateGroupSelection(this)" data-group-id="{{id}}">{{name}}</li> 982 </script> 983 984 <script id="SearchContentTemplate" type="text/x-template"> 985 <li class="dropdown__item dropdown__item--seperator dw-mod"> 986 <a href="{{link}}" class="js-typeahead-link u-color-inherit u-pull--left"> 987 <div class="u-margin-right u-pull--left {{noimage}} u-hidden-xs u-hidden-xxs"><img src="/Admin/Public/GetImage.ashx?width=45&height=38&crop=1&Compression=75&image={{image}}" alt="{{name}}"></div> 988 <div class="u-pull--left"> 989 <div class="u-bold u-max-w220px u-truncate-text js-typeahead-name">{{name}}</div> 990 <div>{{price}}</div> @Translate("inkl. MVA") <span class="stock-icon {{stockState}} dw-mod" title=""></span> 991 </div> 992 </a> 993 994 <div class="u-margin-left u-pull--right u-hidden-xs u-hidden-xxs"> 995 <button class="{{hasBuyOption}}-hibe-buy btn btn--primary btn--condensed u-no-margin dw-mod {{hideBuyOptions}} js-ignore-click-outside " onclick="Cart.AddToCart(event, '{{id}}', '1')"><i class="fa fa-shopping-cart js-ignore-click-outside"></i></button> 996 <a href="{{link}}" class="{{hasBuyOption}}-view btn btn--secondary btn--condensed u-no-margin dw-mod js-ignore-click-outside">@Translate("View")</a> 997 </div> 998 999 </li> 1000 </script> 1001 1002 <script id="SearchMore" type="text/x-template"> 1003 <li class="dropdown__item dropdown__item--not-selectable dw-mod"> 1004 <a href="/Default.aspx?ID=@productsPageId&Search={{searchParameter}}&GroupID={{groupId}}" class="btn btn--primary btn--full u-no-margin dw-mod js-typeahead-link"> 1005 @Translate("View all") 1006 </a> 1007 </li> 1008 </script> 1009 1010 <script id="SearchEmpty" type="text/x-template"> 1011 <li class="u-margin u-padding-left"> 1012 @Translate("Your search gave 0 results") 1013 </li> 1014 </script> 1015 1016 @* Templates for the mini cart *@ 1017 <script id="MiniCartCounterContent" type="text/x-template"> 1018 <div class="js-mini-cart-counter-content dw-mod"> 1019 {{numberofproducts}} 1020 </div> 1021 </script> 1022 1023 <script id="MiniCartContent" type="text/x-template"> 1024 <div class="mini-cart-dropdown__inner {{isempty}} dw-mod"> 1025 <h4 class="u-ta-center u-no-margin u-margin-bottom u-margin-top">@Translate("Shopping cart")</h4> 1026 <div class="mini-cart-dropdown__body dw-mod"> 1027 <table class="table mini-cart-table dw-mod"> 1028 <thead> 1029 <tr> 1030 <td>&nbsp;</td> 1031 <td>@Translate("Product")</td> 1032 <td class="u-ta-right">@Translate("Qty")</td> 1033 <td class="u-ta-right" width="120">@Translate("Price")</td> 1034 </tr> 1035 </thead> 1036 1037 <tbody id="MiniCartOrderLines"></tbody> 1038 1039 @*<tr> 1040 <td><i class="fa fa-credit-card"></i></td> 1041 <td>{{paymentmethod}}</td> 1042 <td colspan="2" class="u-ta-right" width="130">{{paymentfee}}</td> 1043 </tr>*@ 1044 <tr> 1045 <td><i class="fa fa-truck"></i></td> 1046 <td>{{shippingmethod}}</td> 1047 <td colspan="2" class="u-ta-right" width="130">{{shippingfee}}</td> 1048 </tr> 1049 <tr class="mini-cart-totals dw-mod"> 1050 <td colspan="2">@Translate("Total")</td> 1051 <td class="u-ta-right">{{numberofproducts}}</td> 1052 <td class="u-ta-right" width="130">{{totalprice}}</td> 1053 </tr> 1054 </table> 1055 </div> 1056 1057 <table class="table mini-cart-table dw-mod"> 1058 <tr class="mini-cart-orderlines__footer dw-mod"> 1059 <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> 1060 <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> 1061 </tr> 1062 </table> 1063 </div> 1064 </script> 1065 1066 <script id="MiniCartOrderline" type="text/x-template"> 1067 <tr class="{{isempty}}"> 1068 <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> 1069 <td> 1070 <a href="{{link}}" class="mini-cart-orderlines__name">{{name}}</a> 1071 <a href="{{link}}" class="mini-cart-orderlines__name">{{variantname}}</a> 1072 </td> 1073 <td class="u-ta-right">{{quantity}}</td> 1074 <td class="u-ta-right">{{totalprice}}</td> 1075 </tr> 1076 </script> 1077 1078 <script id="MiniCartOrderlineDiscount" type="text/x-template"> 1079 <tr class="table__row--no-border {{isempty}}"> 1080 <td>&nbsp;</td> 1081 <td><div class="mini-cart-orderlines__name dw-mod">{{name}}</div></td> 1082 <td class="u-ta-right">&nbsp;</td> 1083 <td class="u-ta-right">{{totalprice}}</td> 1084 </tr> 1085 </script> 1086 1087 <!-- Javascript --> 1088 <script src="/Files/Templates/Designs/Rapido/js/master.min.js"></script> 1089 1090 @if (Model.Area.Item.GetBoolean("UseCustomJavascript")) 1091 { 1092 <script src="/Files/Templates/Designs/Rapido/js/custom.min.js"></script> 1093 } 1094 1095 <script> 1096 Wireframe.Init(@wireframeMode.ToLower()); 1097 </script> 1098 <script> 1099 // Master.cshtml Scripts 1100 // Change navigation Frontpage button with Font Awesome Icon 1101 var mobileHome = document.getElementById("home"), 1102 desktopHome = document.querySelector("ul#topnavigation > li > a"), 1103 homeIcon = "<i class='fa fa-home fa-1_5x'></i>"; 1104 // For Mobile 1105 mobileHome ? mobileHome.innerHTML = homeIcon : 0; 1106 // For Desktop 1107 desktopHome ? desktopHome.innerHTML = homeIcon : 0; 1108 1109 // Remove Product category button from the TopProductSearch input field 1110 var typeAheadSearchInput = document.getElementById("TopProductSearch"), 1111 typeAheadCategoryButton = typeAheadSearchInput.childNodes; 1112 // Remove the button 1113 typeAheadCategoryButton[1].remove(); 1114 </script> 1115 </body> 1116 </html> 1117 1118