Exception in template (Designs/Rapido/_parsed/Page.parsed.cshtml): System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.aabecbcefafeeb.Execute()
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context)
   at RazorEngine.Templating.TemplateService.Run(ITemplate template, DynamicViewBag viewBag)
   at RazorEngine.Templating.TemplateService.Parse(String razorTemplate, Object model, DynamicViewBag viewBag, String cacheName)
   at RazorEngine.Razor.Parse[T](String razorTemplate, T model, String cacheName)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()
@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> @using Dynamicweb.Frontend.Devices @using Dynamicweb.Extensibility @using Dynamicweb.Content @using Dynamicweb.Ecommerce @using System @using System.Linq @using System.Web @using System.IO @{ //General settings string favicon = Model.Area.Item.GetFile("LogoFavicon") != null ? Model.Area.Item.GetFile("LogoFavicon").Path : "/Files/Images/favicon.png"; string logo = Model.Area.Item.GetFile("LogoImage") != null ? Model.Area.Item.GetFile("LogoImage").Path : "/Files/Images/logo-dynamicweb.png"; if (Path.GetExtension(logo).ToLower() != ".svg") { logo = "/Admin/Public/GetImage.ashx?height=65&amp;crop=5&amp;Compression=75&amp;image=" + @logo; } string searchPlaceholder = Translate("Search products", "Search products"); string searchValue = HttpContext.Current.Request.QueryString.Get("Search") != null ? HttpContext.Current.Request.QueryString.Get("Search") : ""; string wireframeMode = Model.Area.Item.GetBoolean("WireframeMode").ToString(); //Font settings string navigationFont = Model.Area.Item.GetItem("NavigationFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); string mobileNavigationFont = Model.Area.Item.GetItem("MobileNavigationFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); string headerFont = Model.Area.Item.GetItem("ContentLayoutHeaderFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); string subHeaderFont = Model.Area.Item.GetItem("ContentLayoutSubheaderFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); string contentFont = Model.Area.Item.GetItem("ContentLayoutBodyText").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); //Page IDs for use in the template int pageId = Model.TopPage.ID; string firstPageId = Model.Area.FirstActivePage.ID.ToString(); int cartPageId = GetPageIdByNavigationTag("CartPage"); int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); int cartFeedPageId = GetPageIdByNavigationTag("CartOrderlinesFeed"); int productsPageId = GetPageIdByNavigationTag("ProductsPage"); int productSearchPageId = GetPageIdByNavigationTag("ProductSearchFeed"); int productGroupsPageId = GetPageIdByNavigationTag("ProductGroupsFeed"); int impersonationPageId = GetPageIdByNavigationTag("Impersonation"); bool stickyMenu = Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet" ? false : Model.Area.Item.GetBoolean("NavigationStickyMenu"); string stickyTop = stickyMenu ? "top-container--sticky" : ""; string pagePos = stickyMenu ? "js-page-pos" : ""; string topLayout = Model.Area.Item.GetList("LayoutTop").SelectedValue; bool renderPagesInToolBar = Model.Area.Item.GetBoolean("RenderPagesInToolBar"); string autoCssLink = "/Files/Templates/Designs/Rapido/css/rapido/rapido_" + Model.Area.ID.ToString() + ".min.css?ticks=" + Model.Area.UpdatedDate.Ticks; string userInitials = ""; if (Model.CurrentUser.ID != 0) { if (!String.IsNullOrEmpty(Model.CurrentUser.Name)) { string[] names = Model.CurrentUser.Name.Split(' '); userInitials += Model.CurrentUser.Name.Substring(0, 1); if (names.Length > 0) { userInitials += names[names.Length - 1].Substring(0, 1); } } else { userInitials += Model.CurrentUser.FirstName != null && Model.CurrentUser.FirstName != "" ? Model.CurrentUser.FirstName.Substring(0, 1) : ""; userInitials += Model.CurrentUser.LastName != null && Model.CurrentUser.LastName != "" ? Model.CurrentUser.LastName.Substring(0, 1) : ""; userInitials += userInitials.Length == 1 && Model.CurrentUser.FirstName != null && Model.CurrentUser.FirstName.Length > 1 ? Model.CurrentUser.FirstName.Substring(1, 2) : ""; userInitials += userInitials == "" && Model.CurrentUser.Email != null && Model.CurrentUser.Email.Length > 1 ? Model.CurrentUser.Email.Substring(0, 2) : ""; } } // Meta title //Default to CMS page title string metaTitle = Model.Title; // If Ecom group in URL, override with group name var groupid = HttpContext.Current.Request.QueryString.Get("GroupID"); if (!string.IsNullOrEmpty(groupid)) { var group = Services.ProductGroups.GetGroup(groupid); metaTitle = group.Name.ToString(); } // If Ecom product in URL, override with group name var productid = HttpContext.Current.Request.QueryString.Get("ProductID"); if (!string.IsNullOrEmpty(productid)) { var product = Services.Products.GetProductById(productid, "", ""); metaTitle = product.Name.ToString(); } } <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>@metaTitle</title> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1"> <meta name="robots" content="index, follow"> <meta name="keywords" content="@Model.Description" /> <meta name="description" content="@Model.Keywords" /> <!-- Favicon --> <link href="@favicon" rel="icon" type="image/png"> <!-- Font awesome --> <link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/rapido/font-awesome.min.css" type="text/css"> <!-- Base (Default, wireframe) styles --> <link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/base/base.css" type="text/css"> <!-- Rapido Css from Website Settings --> <link id="rapidoCss" rel="stylesheet" href="@autoCssLink" type="text/css"> <!-- Ignite Css (Custom site specific styles) --> <link id="igniteCss" type="text/css" href="/Files/Templates/Designs/Rapido/css/ignite/ignite.min.css" rel="stylesheet"> <!-- Google fonts --> @{ var fonts = new string[5] { @navigationFont, @mobileNavigationFont, @headerFont, @subHeaderFont, @contentFont }; var family = string.Join("|", fonts.Distinct().Select(x => string.Format("{0}:100,200,300,400,500,600,700,800,900", x))); } <link href="https://fonts.googleapis.com/css?family=@family" rel="stylesheet"> </head> <body> @MobileNavigation(userInitials) @LoginModal() <main class="site dw-mod"> <header class="top-container @stickyTop dw-mod" id="Top"> @if (renderPagesInToolBar) { <div class="tools-navigation dw-mod"> <div class="center-container grid top-container__center-container dw-mod"> <div class="grid__col-xs-12 grid__col--bleed-y"> <div class="grid__cell grid__cell--align-middle-right"> @RenderNavigation(new { id = "topnavigation", cssclass = "menu menu-tools dw-mod dwnavigation", template = "TopMenu.xslt" }) </div> </div> </div> </div> } @if (topLayout == "normal") { <!-- Header --> <div class="header header-top dw-mod"> <div class="center-container top-container__center-container dw-mod"> <div class="grid"> @* Logo *@ @if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") { <div class="grid__col-md-3 grid__col-sm-3 grid--align-self-center grid__col--bleed-y"> <div class="logo dw-mod"> <a href="/Default.aspx?ID=@firstPageId"> <img class="grid__cell-img" src="@logo" alt="Logo" /> </a> </div> </div> } @if (Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") { <div class="grid__col-12"> <div class="grid__cell"> <div class="logo u-max-w220px u-middle u-margin-bottom dw-mod"> <a href="/Default.aspx?ID=@firstPageId"> <img class="grid__cell-img" src="@logo" alt="Logo" /> </a> </div> </div> </div> } @if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") { @* Search *@ <div class="grid__col-6 grid__col--bleed-y grid--align-self-center"> <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"> <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> <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> <input type="text" class="typeahead-search-field u-no-margin js-typeahead-search-field" placeholder="@searchPlaceholder" value="@searchValue"> <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> <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> </div> </div> } @* Mobile search *@ @if (Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") { <div class="grid__col-12 grid__col--bleed-y grid--align-self-center"> <div class="grid__cell"> <div class="js-typeahead" data-page-size="10" id="MobileProductSearch" data-search-page-id="@productSearchPageId" data-result-page-id="@productsPageId"> <input type="text" class="u-full-width js-typeahead-search-field" placeholder="@searchPlaceholder" value="@searchValue"> <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> </div> </div> </div> } </div> </div> </div> <!-- Main navigation --> <nav class="main-navigation dw-mod"> <div class="center-container top-container__center-container dw-mod"> <div class="grid"> <div class="grid__col-12 grid--align-self-center grid__col--bleed"> <div class="grid__cell"> @MobileNavigationTrigger() @RenderHeaderNavigation() </div> </div> </div> </div> </nav> } @if (topLayout == "condensed") { <!-- Main navigation --> <nav class="main-navigation dw-mod"> <div class="center-container top-container__center-container dw-mod"> <div class="grid"> <div class="grid__col-md-3 grid--align-self-center grid__col--bleed-y"> <div class="logo u-padding--xs dw-mod"> <a href="/Default.aspx?ID=@firstPageId"> <img class="grid__cell-img" src="@logo" alt="Logo" /> </a> </div> </div> @* Navigation *@ <div class="u-pull--left"> @MobileNavigationTrigger() @RenderHeaderNavigation() </div> </div> </div> </nav> <!-- Searchbar --> <div class="u-box-shadow u-color-light-gray--bg u-inline-block u-full-width"> <div class="center-container top-container__center-container dw-mod"> <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"> <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> <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> <div class="typeahead-search-field"> <input type="text" class="u-no-margin u-full-width js-typeahead-search-field" placeholder="@searchPlaceholder" value="@searchValue"> <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> </div> <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> </div> </div> </div> } @if (topLayout == "minimal") { <!-- Main navigation --> <nav class="main-navigation dw-mod"> <div class="center-container top-container__center-container dw-mod"> <div class="grid"> <div class="grid__col-md-3 grid--align-self-center grid__col--bleed-y logo-container"> <div class="logo u-padding--xs dw-mod"> <a href="/Default.aspx?ID=@firstPageId"> <img class="grid__cell-img" src="@logo" alt="Logo" /> </a> </div> </div> @* Navigation *@ <div class="menu-nav"> @MobileNavigationTrigger() @RenderHeaderNavigation() </div> <div class="search"> <ul class="menu dw-mod"> @* Search *@ <li class="menu__item menu__item--horizontal menu__item--top-level dw-mod"> <div class="menu__link is-dropdown--no-icon dropdown-search dw-mod"> <i class="fa fa-search fa-1_5x"></i> </div> </li> </ul> </div> </div> <div class="menu menu--dropdown top-micro-search dw-mod"> <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"> <div class="typeahead-search-field"> <input type="text" class="u-no-margin u-full-width js-typeahead-search-field" placeholder="@searchPlaceholder" value="@searchValue"> <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> </div> </div> </div> </div> </nav> } @* Impersonation bar *@ @if (Model.CurrentUser.ID > 0 && Model.SecondaryUsers.Count > 0) { <div class="u-color-warning--bg"> <div class="center-container top-container__center-container dw-mod"> @*Impersonation*@ <div class="grid"> <div class="grid--align-self-center grid__col-x"> @if (Model.CurrentSecondaryUser != null && Model.CurrentSecondaryUser.ID > 0) { string stopImpersonateTranslation = Translate("Stop impersonation"); string username = ""; if (!string.IsNullOrEmpty(Model.CurrentSecondaryUser.FirstName) && !string.IsNullOrEmpty(Model.CurrentSecondaryUser.LastName)) { username = Model.CurrentSecondaryUser.FirstName + " " + Model.CurrentSecondaryUser.LastName; } else if (!string.IsNullOrEmpty(Model.CurrentSecondaryUser.Name)) { username = Model.CurrentSecondaryUser.Name; } else if (!string.IsNullOrEmpty(Model.CurrentSecondaryUser.Email)) { username = Model.CurrentSecondaryUser.Email; } else { username = Model.CurrentSecondaryUser.UserName; } <div class="grid-cell"> <div class="u-pull--left u-bold u-margin-top"> <i class="fa fa-user-secret"></i> @username<text>&nbsp;</text>@Translate("is impersonated by")<text>&nbsp;</text>@Pageview.User.UserName </div> <form method="post" class="u-pull--right u-no-margin"> <input type="submit" class="btn btn--secondary dw-mod u-no-margin" name="DwExtranetRemoveSecondaryUser" value="@stopImpersonateTranslation"> </form> </div> } else { string viewListTranslation = Translate("View the list of users you can impersonate"); <div class="grid-cell u-bold"> <i class="fa fa-user-secret"></i> <a href="/Default.aspx?ID=@impersonationPageId" title="@viewListTranslation" class="u-color-font-black">@viewListTranslation</a> </div> } </div> </div> </div> </div> } </header> <!-- Floating mini cart --> @if (!stickyMenu && pageId == productsPageId && Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") { <div class="floating-mini-cart u-hidden dw-mod" id="FloatingMiniCart"> <div class="mini-cart dw-mod"> <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')"> <i class="fa fa-shopping-cart fa-4x"></i> <div class="mini-cart__counter mini-cart__counter--lg dw-mod"> <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"> <div class="js-mini-cart-counter-content"> @Model.Cart.TotalProductsCount </div> </div> </div> </a> <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> </div> </div> } <!-- Render the content --> <div id="Page" class="page @pagePos"> <section class="center-container content-container dw-mod" id="content"> @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> @if (Model.PropertyItem.GetBoolean("ShowBreadcrumb")) { <div class="grid__col-12 grid__col--bleed-y"> @RenderNavigation(new { id = "breadcrumb", template = "breadcrumb.xslt" }) </div> } <div class="grid"> @if (Model.PropertyItem.GetBoolean("LeftMenu") && RenderNavigation(new { }) != null) { <nav class="grid__col-md-3 grid__col-sm-12 grid__col-xs-12 paragraph-container"> <div class="grid__cell"> @RenderNavigation(new { id = "leftnav", cssclass = "menu dwnavigation", endlevel = 5, template = "LeftNavigation.xslt" }) </div> </nav> } <div class="grid__col-auto grid__col--bleed"> <div class="grid"> @Model.Placeholder("dwcontent", "content", "default:true;sort:1") </div> </div> </div> </section> </div> </main> @RenderFooter() <!-- Content rendering helpers --> @helper MobileNavigation(string userInitials) { int pageId = Model.TopPage.ID; string signInPage = GetPageIdByNavigationTag("SignInPage").ToString(); string myProfilePageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerProfile").ToString() : GetPageIdByNavigationTag("CustomerProfile").ToString(); string myOrdersPageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerOrders").ToString() : GetPageIdByNavigationTag("CustomerOrders").ToString(); string myFavoritesPageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerFavorites").ToString() : GetPageIdByNavigationTag("CustomerFavorites").ToString(); string mobileNavigationLevels = Model.Area.Item.GetBoolean("MobileNavigationLevels") ? Model.Area.Item.GetString("MobileNavigationLevels") : "3"; int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); int cartFeedPageId = GetPageIdByNavigationTag("CartOrderlinesFeed"); int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); if (Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") { <!-- Trigger for mobile navigation --> <input type="checkbox" id="MobileNavTrigger" class="mobile-nav-trigger" /> <!-- Mobile navigation --> <nav class="mobile-navigation dw-mod"> <div class="grid"> <div class="grid__col-12"> <div class="grid__cell"> <div class="u-pull--left"> @if (Model.Languages.Count > 0) { string selectedLanguage = ""; foreach (var lang in Model.Languages) { if (lang.IsCurrent) { selectedLanguage = lang.Name; } } <div class="btn btn--clean btn--condensed u-no-margin is-dropdown is-dropdown--no-icon dw-mod"> <i class="fa fa-globe"></i> @selectedLanguage <div class="menu menu--dropdown u-w100px u-ta-left dw-mod"> @foreach (var lang in Model.Languages) { <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> } </div> </div> } </div> </div> </div> <div class="grid__col-12 grid__col--line-top u-no-padding"></div> <input type="checkbox" id="mobileSignIn" class="expand-trigger" /> @if (Model.CurrentUser.ID <= 0) { <div class="grid__col-12 u-no-padding expand-container"> <div class="expand-container__content u-padding dw-mod"> <form method="post" id="MobileLoginForm"> <input type="hidden" name="ID" value="@pageId" /> <input type="hidden" name="DWExtranetUsernameRemember" value="True" /> <input type="hidden" name="DWExtranetPasswordRemember" value="True" /> <input type="text" class="u-full-width" id="login-username" name="username" placeholder="@Translate("Email")" /> <input type="password" class="u-full-width" id="login-password" name="password" placeholder="@Translate("Password")" /> <label> <input type="checkbox" id="rememberMe" name="Autologin" checked="checked" value="True"> <span>@Translate("Remember me", "Remember me")</span> </label> <button type="submit" class="btn btn--primary btn--full dw-mod" name="LoginAction" value="Login" onclick="Buttons.LockButton(event)">@Translate("Sign in")</button> <a class="btn btn--link u-ta-left" href="/Default.aspx?id=@signInPage&LoginAction=Recovery">@Translate("Forgot your password?", "Forgot your password?")</a> <a class="btn btn--link-clean dw-mod" href="/default.aspx?ID=@createAccountPageId">@Translate("Create account")?</a> </form> </div> </div> } else { <div class="grid__col-12 u-no-padding expand-container dw-mod"> <div class="expand-container__content u-padding dw-mod"> <ul class="list list--clean dw-mod"> <li> <a href="/default.aspx?ID=@myProfilePageId" class="mobile-navigation__link list__link dw-mod"><i class="fa fa-user"></i> @Translate("My Profile")</a> </li> <li> <a href="/default.aspx?ID=@myOrdersPageId" class="mobile-navigation__link list__link dw-mod"><i class="fa fa-list"></i> @Translate("My Orders")</a> </li> <li> <a href="/default.aspx?ID=@myFavoritesPageId" class="mobile-navigation__link list__link dw-mod"><i class="fa fa-star"></i> @Translate("My Favorites")</a> </li> <li class="list__seperator dw-mod"></li> <li> <a href="/Admin/Public/ExtranetLogoff.aspx?ID=@pageId" class="mobile-navigation__link list__link dw-mod">@Translate("Sign out")</a> </li> <li class="list__seperator dw-mod"></li> </ul> </div> </div> } <div class="grid__col-12"> @RenderNavigation(new { id = "mobilenavigation", cssclass = "menu menu-mobile dwnavigation", startLevel = 1, endlevel = @mobileNavigationLevels, template = "BaseMenuForMobile.xslt", expandmode = "All" }) </div> </div> </nav> <label class="mobile-nav-trigger-off" for="MobileNavTrigger"></label> <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> } } @helper LoginModal() { int pageId = Model.TopPage.ID; string topLayout = Model.Area.Item.GetList("LayoutTop").SelectedValue; int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); string forgotPasswordPageId = signInProfilePageId.ToString() + "&LoginAction=Recovery"; string userSignedInError = !Model.LogOnFailed ? "" : "checked"; string userSignedInErrorText = ""; if (Model.LogOnFailed) { switch (Model.LogOnFailedReason) { case Dynamicweb.Security.UserManagement.LogOnFailedReason.PasswordLengthInvalid: userSignedInErrorText = Translate("Password length is invalid"); break; case Dynamicweb.Security.UserManagement.LogOnFailedReason.IncorrectLogin: userSignedInErrorText = Translate("Invalid email or password"); break; case Dynamicweb.Security.UserManagement.LogOnFailedReason.ExceededFailedLogOnLimit: userSignedInErrorText = Translate("You have exceeded the limit of allowed login attempts. The user account is temporarily locked"); break; case Dynamicweb.Security.UserManagement.LogOnFailedReason.LoginLocked: userSignedInErrorText = Translate("The user account is temporarily locked"); break; case Dynamicweb.Security.UserManagement.LogOnFailedReason.PasswordExpired: userSignedInErrorText = Translate("The password has expired and needs to be renewed"); break; default: userSignedInErrorText = Translate("An unknown error occured"); break; } } <!-- Trigger for the login modal --> <input type="checkbox" id="SignInModalTrigger" class="modal-trigger @topLayout" @userSignedInError /> <!-- Login modal --> <div class="modal-container"> <label for="SignInModalTrigger" id="SignInModalOverlay" class="modal-overlay"></label> <div class="modal modal--xs" id="SignInModal"> <div class="modal__header"> <h2>@Translate("Sign in")</h2> </div> <div class="modal__body"> <form method="post" id="LoginForm" class="u-no-margin"> <input type="hidden" name="ID" value="@pageId" /> <input type="hidden" name="DWExtranetUsernameRemember" value="True" /> <input type="hidden" name="DWExtranetPasswordRemember" value="True" /> <input type="text" class="u-full-width" id="LoginUsername" name="username" placeholder="@Translate("Email")" /> <input type="password" class="u-full-width" id="LoginPassword" name="password" placeholder="@Translate("Password")" /> <div class="field-error dw-mod">@userSignedInErrorText</div> <label> <input type="checkbox" id="RememberMe" name="Autologin" checked="checked" value="True"> <span>@Translate("Remember me", "Remember me")</span> </label> <button type="submit" class="btn btn--primary btn--full dw-mod" name="LoginAction" value="Login" onclick="Buttons.LockButton(event)">@Translate("Sign in")</button> <a class="btn btn--link-clean dw-mod" href="/Default.aspx?id=@forgotPasswordPageId">@Translate("Forgot your password?", "Forgot your password?")</a> <a class="btn btn--link-clean dw-mod" href="/default.aspx?ID=@createAccountPageId">@Translate("Create account")?</a> </form> </div> </div> </div> } @helper RenderHeaderNavigation() { bool megaMenu = Model.Area.Item.GetList("NavigationMegaMenu").SelectedValue.ToLower() == "true" ? true : false; string megamenuPromotionImage = Model.Area.Item.GetFile("NavigationMegamenuPromotionImage") != null ? Model.Area.Item.GetFile("NavigationMegamenuPromotionImage").Path : ""; bool renderPagesInToolBar = Model.Area.Item.GetBoolean("RenderPagesInToolBar"); int startLevel = renderPagesInToolBar ? 1 : 0; if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") { if (!megaMenu) { @RenderNavigation(new { id = "topnavigation", cssclass = "menu dw-mod dwnavigation", startLevel = @startLevel, ecomStartLevel = @startLevel + 1, endlevel = 5, template = "BaseMenuWithDropdown.xslt", expandmode = "All" }); } else { @RenderNavigation(new { id = "topnavigation", cssclass = "menu dw-mod dwnavigation", startLevel = @startLevel, ecomStartLevel = @startLevel + 1, endlevel = 5, promotionImage = megamenuPromotionImage, promotionLink = Model.Area.Item.GetString("NavigationMegamenuPromotionLink"), template = "BaseMegaMenu.xslt", expandmode = "All" }); } } } @helper MobileNavigationTrigger() { @* Mobile navigation trigger *@ if (Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") { <div class="menu dw-mod u-pull--left"> <div class="menu__item menu__item--horizontal menu__item--top-level dw-mod"> <label for="MobileNavTrigger" class="mobile-nav-trigger-button menu__link dw-mod"></label> </div> </div> } } @helper RenderLanguageSelector(string type = "inNavigation") { 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"; string menuLinkClass = type == "inNavigation" ? "menu__link" : "header-menu__link"; @* Language selector *@ if (Model.Languages.Count > 1) { <li class="@liClasses"> <div class="@menuLinkClass u-w40px is-dropdown is-dropdown--no-icon dw-mod"> <i class="fa fa-globe fa-1_5x"></i> <div class="menu menu--dropdown u-w100px dw-mod"> @foreach (var lang in Model.Languages) { <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> } </div> </div> </li> } } @helper RenderMiniCart(string type = "inNavigation") { string liClasses = type == "inNavigation" ? "menu__item menu__item--horizontal menu__item--top-level dw-mod" : "menu__item menu__item--horizontal menu--clean dw-mod"; string menuLinkClass = type == "inNavigation" ? "menu__link" : "header-menu__link"; int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); int cartFeedPageId = GetPageIdByNavigationTag("CartOrderlinesFeed"); int cartPageId = GetPageIdByNavigationTag("CartPage"); double cartProductsCount = Model.Cart.TotalProductsCount; @* Mini cart *@ <li class="@liClasses"> <div class="mini-cart dw-mod"> <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')"> <i class="fa fa-shopping-cart fa-1_5x"></i> <div class="mini-cart__counter mini-cart__counter--inline dw-mod"> <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"> <div class="js-mini-cart-counter-content"> @cartProductsCount </div> </div> </div> </a> @if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") { <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> } </div> </li> } @helper RenderSignIn(string type = "inNavigation", string userInitials = "") { 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"; string menuLinkClass = type == "inNavigation" ? "menu__link" : "header-menu__link"; int pageId = Model.TopPage.ID; string myProfilePageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerProfile").ToString() : GetPageIdByNavigationTag("CustomerProfile").ToString(); string myOrdersPageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerOrders").ToString() : GetPageIdByNavigationTag("CustomerOrders").ToString(); int myDashboardPageId = GetPageIdByNavigationTag("CustomerDashboard"); string myFavoritesPageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerFavorites").ToString() : GetPageIdByNavigationTag("CustomerFavorites").ToString(); int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); string forgotPasswordPageId = signInProfilePageId.ToString() + "&LoginAction=Recovery"; @* Sign in + Customer center links *@ <li class="@liClasses"> <div class="@menuLinkClass is-dropdown is-dropdown--no-icon u-w40px dw-mod"> @if (Model.CurrentUser.ID <= 0) { <i class="fa fa-user fa-1_5x"></i> } else { <a href="/default.aspx?ID=@myDashboardPageId" class="u-color-inherit"><div class="circle-icon-btn">@userInitials.ToUpper()</div></a> } <div class="menu menu--dropdown sign-in-dropdown dw-mod"> <ul class="list list--clean dw-mod"> @if (Model.CurrentUser.ID <= 0) { <li> <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> </li> <li> <a href="/default.aspx?ID=@createAccountPageId" class="list__link dw-mod">@Translate("Create account")</a> </li> <li> <a href="/default.aspx?ID=@forgotPasswordPageId" class="list__link dw-mod">@Translate("Forgot your password?")</a> </li> <li class="list__seperator dw-mod"></li> } <li> <a href="/default.aspx?ID=@myProfilePageId" class="list__link dw-mod"><i class="fa fa-user"></i> @Translate("My Profile")</a> </li> <li> <a href="/default.aspx?ID=@myOrdersPageId" class="list__link dw-mod"><i class="fa fa-list"></i> @Translate("My Orders")</a> </li> <li> <a href="/default.aspx?ID=@myFavoritesPageId" class="list__link dw-mod"><i class="fa fa-star"></i> @Translate("My Favorites")</a> </li> @if (Model.CurrentUser.ID > 0) { <li class="list__seperator dw-mod"></li> <li> <a href="/Admin/Public/ExtranetLogoff.aspx?ID=@pageId" class="list__link dw-mod">@Translate("Sign out")</a> </li> } </ul> </div> </div> </li> } @helper RenderFavorites(string type = "inNavigation") { 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"; string menuLinkClass = type == "inNavigation" ? "menu__link" : "header-menu__link"; string myFavoritesPageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerFavorites").ToString() : GetPageIdByNavigationTag("CustomerFavorites").ToString(); @* Favorites *@ if (Model.CurrentUser.ID > 0) { <li class="@liClasses"> <a href="/Default.aspx?ID=@myFavoritesPageId" class="@menuLinkClass dw-mod"> <i class="fa fa-star fa-1_5x"></i> </a> </li> } } @helper RenderFooter() { string footerColumnOneContent = !string.IsNullOrEmpty(Model.Area.Item.GetString("FooterColumnOne")) ? Model.Area.Item.GetString("FooterColumnOne") : ""; string footerColumnTwoContent = !string.IsNullOrEmpty(Model.Area.Item.GetString("FooterColumnTwo")) ? Model.Area.Item.GetString("FooterColumnTwo") : ""; string footerColumnOneHeader = Model.Area.Item.GetString("FooterColumnOneHeader"); string footerColumnTwoHeader = Model.Area.Item.GetString("FooterColumnTwoHeader"); string footerColumnThreeHeader = Model.Area.Item.GetString("FooterColumnThreeHeader"); int newsletterSignUpPageId = GetPageIdByNavigationTag("NewsletterSignUp"); <!-- Footer section --> <footer class="footer dw-mod"> <div class="center-container top-container__center-container dw-mod"> <div class="grid"> @if (!string.IsNullOrEmpty(footerColumnOneContent) || !string.IsNullOrEmpty(footerColumnOneHeader)) { <div class="grid__col-md-2 grid__col-sm-3"> <h4 class="footer__heading dw-mod">@footerColumnOneHeader</h4> @footerColumnOneContent </div> } @if (!string.IsNullOrEmpty(footerColumnTwoContent) || !string.IsNullOrEmpty(footerColumnTwoHeader)) { <div class="grid__col-md-2 grid__col-sm-3"> <h4 class="footer__heading dw-mod">@footerColumnTwoHeader</h4> @footerColumnTwoContent </div> } @if (Model.Area.Item.GetItems("BrandList").Count > 0) { <div class="grid__col-sm-3 grid__col-lg-5"> <h4 class="footer__heading dw-mod brand-list-heading">@footerColumnThreeHeader</h4> <div class="brands-list"> @foreach (var linkitem in Model.Area.Item.GetItems("BrandList")) { string link = string.Empty; string linkImage = string.Empty; if (linkitem.GetFile("Image") != null) { link = linkitem.GetString("Link"); linkImage = linkitem.GetFile("Image").Path; } <div class="brand-images"> <a href="@link"><img src="/Admin/Public/GetImage.ashx?width=175h&amp;height=175&amp;Compression=15&amp;DoNotUpscale=true&amp;image=@linkImage" /></a> </div> } </div> </div> } @if (Model.Area.Item.GetBoolean("FooterNewsletterSignUp")) { <div class="grid__col-md-auto"> <h4 class="footer__heading dw-mod">@Translate("Mailing list", "Mailing list")</h4> <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> <form class="form dw-mod" name="NewsletterRedirect" action='/Default.aspx' method="get" enctype="multipart/form-data"> <input name="ID" id="ID" value="@newsletterSignUpPageId" type="hidden" /> <div class="form__field-combi"> <input name="NewsletterEmail" id="NewsletterEmail" type="text" placeholder='@Translate("Your email address", "Your email address")' /> <input class="btn btn--primary dw-mod" type="submit" id="Submitter" value='@Translate("Go", "Go")' /> </div> </form> </div> } @if (Model.Area.Item.GetItems("FooterSocialLinks").Count > 0) { <div class="grid__col-md-2 grid__col-sm-3 social-media-links"> <h4 class="footer__heading dw-mod">@Translate("Social links", "Social links")</h4> <div class="collection dw-mod"> @foreach (var socialitem in Model.Area.Item.GetItems("FooterSocialLinks")) { //Fields.FirstOrDefault(x => x.SystemName == "Icon").GetString() var socialIcon = socialitem.GetValue("Icon") as Dynamicweb.Frontend.ListViewModel; string socialIconClass = socialIcon.SelectedValue; string socialIconTitle = socialIcon.SelectedName; string socialLink = socialitem.GetString("Link"); <a href="@socialLink" title="@socialIconTitle"><i class="fa @socialIconClass fa-2x"></i></a> } </div> </div> } </div> </div> <div class="grid__col-12 grid--align-center footer-bottom"> <p>@Model.Area.Item.GetString("FooterCopyrightText")</p> </div> </footer> } @* Templates for Typeahead *@ <script id="SearchGroupsTemplate" type="text/x-template"> <li class="dropdown__item dw-mod" onclick="Search.UpdateGroupSelection(this)" data-group-id="{{id}}">{{name}}</li> </script> <script id="SearchContentTemplate" type="text/x-template"> <li class="dropdown__item dropdown__item--seperator dw-mod"> <a href="{{link}}" class="js-typeahead-link u-color-inherit u-pull--left"> <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> <div class="u-pull--left"> <div class="u-max-w220px u-truncate-text js-typeahead-name">{{name}}</div> </div> </a> <div class="u-margin-left u-pull--right u-hidden-xs u-hidden-xxs"> @*<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>*@ <a href="{{link}}" class="btn btn--primary btn--condensed u-no-margin dw-mod js-ignore-click-outside"><i class="fa fa-angle-double-right"></i></a> </div> </li> </script> <script id="SearchMore" type="text/x-template"> <li class="dropdown__item dropdown__item--not-selectable dw-mod"> <a href="/Default.aspx?ID=@productsPageId&Search={{searchParameter}}&GroupID={{groupId}}" class="btn btn--primary btn--full u-no-margin dw-mod js-typeahead-link"> @Translate("Se fler") </a> </li> </script> <script id="SearchEmpty" type="text/x-template"> <li class="u-margin u-padding-left no-results"> @Translate("Din sökning gav inga resultat!") </li> </script> @* Templates for the mini cart *@ <script id="MiniCartCounterContent" type="text/x-template"> <div class="js-mini-cart-counter-content dw-mod"> {{numberofproducts}} </div> </script> <script id="MiniCartContent" type="text/x-template"> <div class="mini-cart-dropdown__inner {{isempty}} dw-mod"> <h4 class="u-ta-center u-no-margin u-margin-bottom u-margin-top">@Translate("Shopping cart")</h4> <div class="mini-cart-dropdown__body dw-mod"> <table class="table mini-cart-table dw-mod"> <thead> <tr> <td>&nbsp;</td> <td>@Translate("Product")</td> <td class="u-ta-right">@Translate("Qty")</td> <td class="u-ta-right" width="120">@Translate("Price")</td> </tr> </thead> <tbody id="MiniCartOrderLines"></tbody> <tr> <td><i class="fa fa-credit-card"></i></td> <td>{{paymentmethod}}</td> <td colspan="2" class="u-ta-right" width="130">{{paymentfee}}</td> </tr> <tr> <td><i class="fa fa-truck"></i></td> <td>{{shippingmethod}}</td> <td colspan="2" class="u-ta-right" width="130">{{shippingfee}}</td> </tr> <tr class="mini-cart-totals dw-mod"> <td colspan="2">@Translate("Total")</td> <td class="u-ta-right">{{numberofproducts}}</td> <td class="u-ta-right" width="130">{{totalprice}}</td> </tr> </table> </div> <table class="table mini-cart-table dw-mod"> <tr class="mini-cart-orderlines__footer dw-mod"> <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> <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> </tr> </table> </div> </script> <script id="MiniCartOrderline" type="text/x-template"> <tr class="{{isempty}}"> <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> <td> <a href="{{link}}" class="mini-cart-orderlines__name">{{name}}</a> <a href="{{link}}" class="mini-cart-orderlines__name">{{variantname}}</a> </td> <td class="u-ta-right">{{quantity}}</td> <td class="u-ta-right">{{totalprice}}</td> </tr> </script> <script id="MiniCartOrderlineDiscount" type="text/x-template"> <tr class="table__row--no-border {{isempty}}"> <td>&nbsp;</td> <td><div class="mini-cart-orderlines__name dw-mod">{{name}}</div></td> <td class="u-ta-right">&nbsp;</td> <td class="u-ta-right">{{totalprice}}</td> </tr> </script> <!-- Javascript --> <script src="/Files/Templates/Designs/Rapido/js/master.min.js"></script> @if (Model.Area.Item.GetBoolean("UseCustomJavascript")) { <script src="/Files/Templates/Designs/Rapido/js/custom.min.js"></script> } <script> Wireframe.Init(@wireframeMode.ToLower()); </script> </body> </html>