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