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_d4186a5cc5bb4cc58d177d37b538112e.Execute() in E:\Dynamicweb.net\Solutions\Buchs\citylift.dw9.dynamicweb-cms.com\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 532
at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)
at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 2 3 @* Rapido version 2.0.1 *@ 4 5 @using Dynamicweb.Frontend.Devices 6 @using Dynamicweb.Extensibility 7 @using Dynamicweb.Content 8 @using Dynamicweb.Security 9 @using System 10 @using System.Linq 11 @using System.Web 12 @using System.IO 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 { 20 logo = @*"/Admin/Public/GetImage.ashx?height=40&amp;crop=5&amp;Compression=00&amp;image=" + *@ @logo; 21 } 22 string searchPlaceholder = Translate("Search products", "Search products"); 23 string searchValue = HttpContext.Current.Request.QueryString.Get("Search") != null ? HttpContext.Current.Request.QueryString.Get("Search") : ""; 24 string wireframeMode = Model.Area.Item.GetBoolean("WireframeMode").ToString(); 25 26 //Font settings 27 string navigationFont = Model.Area.Item.GetItem("NavigationFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 28 string mobileNavigationFont = Model.Area.Item.GetItem("MobileNavigationFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 29 string headerFont = Model.Area.Item.GetItem("ContentLayoutHeaderFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 30 string subHeaderFont = Model.Area.Item.GetItem("ContentLayoutSubheaderFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 31 string contentFont = Model.Area.Item.GetItem("ContentLayoutBodyText").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 32 string newStickersFont = Model.Area.Item.GetItem("NewStickersFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 33 string customStickersFont = Model.Area.Item.GetItem("CustomStickersFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 34 string toolsMenuFont = Model.Area.Item.GetItem("ToolsMenuFont").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 productsSearchFeedId = productsPageId; 44 int productGroupsPageId = GetPageIdByNavigationTag("ProductGroupsFeed"); 45 int impersonationPageId = GetPageIdByNavigationTag("Impersonation"); 46 47 bool stickyMenu = Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet" ? false : Model.Area.Item.GetBoolean("NavigationStickyMenu"); 48 string stickyTop = stickyMenu ? "top-container--sticky" : ""; 49 string pagePos = stickyMenu ? "js-page-pos" : ""; 50 string topLayout = Model.Area.Item.GetList("LayoutTop").SelectedValue; 51 bool renderPagesInToolBar = Model.Area.Item.GetBoolean("RenderPagesInToolBar"); 52 string toolbarText = Model.Area.Item.GetString("ToolbarText"); 53 bool onlyPreview = Model.Area.Item.GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 54 55 string autoCssLink = "/Files/Templates/Designs/Rapido/css/rapido/rapido_" + Model.Area.ID.ToString() + ".min.css?ticks=" + Model.Area.UpdatedDate.Ticks; 56 57 string userInitials = ""; 58 if (Model.CurrentUser.ID != 0) 59 { 60 if (!String.IsNullOrEmpty(Model.CurrentUser.Name)) 61 { 62 string[] names = Model.CurrentUser.Name.Split(' '); 63 userInitials += Model.CurrentUser.Name.Substring(0, 1); 64 65 if (names.Length > 1) 66 { 67 userInitials += names[names.Length - 1].Substring(0, 1); 68 } 69 } 70 else 71 { 72 userInitials += Model.CurrentUser.FirstName != null && Model.CurrentUser.FirstName != "" ? Model.CurrentUser.FirstName.Substring(0, 1) : ""; 73 userInitials += Model.CurrentUser.LastName != null && Model.CurrentUser.LastName != "" ? Model.CurrentUser.LastName.Substring(0, 1) : ""; 74 userInitials += userInitials.Length == 1 && Model.CurrentUser.FirstName != null && Model.CurrentUser.FirstName.Length > 1 ? Model.CurrentUser.FirstName.Substring(1, 2) : ""; 75 userInitials += userInitials == "" && Model.CurrentUser.Email != null && Model.CurrentUser.Email.Length > 1 ? Model.CurrentUser.Email.Substring(0, 2) : ""; 76 userInitials += userInitials == "" ? Model.CurrentUser.UserName.Substring(0, 2) : ""; 77 } 78 } 79 80 string siteURL = Dynamicweb.Context.Current.Request.Url.Scheme + "://" + Dynamicweb.Context.Current.Request.Url.Host; 81 string businessPhotoPath = Model.Area.Item.GetFile("BusinessPhoto") != null ? Model.Area.Item.GetFile("BusinessPhoto").Path : ""; 82 string businessName = Model.Area.Item.GetString("BusinessName"); 83 var address = Model.Area.Item.GetItem("Address"); 84 string streetAddress = ""; 85 string addressLocality = ""; 86 string addressRegion = ""; 87 string postalCode = ""; 88 string addressCountry = ""; 89 if (address != null) 90 { 91 streetAddress = address.GetString("StreetAddress"); 92 addressLocality = address.GetString("City"); 93 addressRegion = address.GetString("Region"); 94 postalCode = address.GetString("PostalCode"); 95 addressCountry = address.GetString("Country"); 96 } 97 string contactEmail = Model.Area.Item.GetString("ContactEmail"); 98 string contactNumber = Model.Area.Item.GetString("ContactNumber"); 99 } 100 <!DOCTYPE html> 101102 <html lang="@Pageview.Area.CultureInfo.TwoLetterISOLanguageName"> 103 <head> 104 <meta charset="utf-8" /> 105 <title>@Model.Title</title> 106 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1"> 107 <meta name="robots" content="index, follow"> 108 @Model.MetaTags 109110 <!-- Favicon --> 111 <link href="@favicon" rel="icon" type="image/png"> 112113 <!-- Font awesome --> 114 <link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/rapido/font-awesome.min.css" type="text/css"> 115116 <!-- Base (Default, wireframe) styles --> 117 <link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/base/base.min.css" type="text/css"> 118119 <!-- Rapido Css from Website Settings --> 120 <link id="rapidoCss" rel="stylesheet" href="@autoCssLink" type="text/css"> 121122 <!-- Ignite Css (Custom site specific styles) --> 123 <link id="igniteCss" type="text/css" href="/Files/Templates/Designs/Rapido/css/ignite/ignite.min.css" rel="stylesheet"> 124125 <!-- Google fonts --> 126 @{ 127 var fonts = new string[8] { navigationFont, mobileNavigationFont, headerFont, subHeaderFont, contentFont, newStickersFont, customStickersFont, toolsMenuFont }; 128 var family = string.Join("%7C", fonts.Distinct().Select(x => string.Format("{0}:100,200,300,400,500,600,700,800,900", x))); 129 } 130 <link href="https://fonts.googleapis.com/css?family=@family" rel="stylesheet"> 131 @if(Model.Area.ID == 1){ 132 <!-- Google Tag Manager --> 133 <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': 134 new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], 135 j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 136 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); 137 })(window,document,'script','dataLayer','GTM-KLKN3R7');</script> 138 <!-- End Google Tag Manager --> 139 } else { 140 <!-- Google Tag Manager --> 141 <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': 142 new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], 143 j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 144 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); 145 })(window,document,'script','dataLayer','GTM-5FHSNZ3');</script> 146 <!-- End Google Tag Manager --> 147 } 148149150 @if (!string.IsNullOrEmpty(businessPhotoPath) && 151 !string.IsNullOrEmpty(businessName) && 152 !string.IsNullOrEmpty(streetAddress) && 153 !string.IsNullOrEmpty(addressLocality) && 154 !string.IsNullOrEmpty(addressRegion) && 155 !string.IsNullOrEmpty(postalCode) && 156 !string.IsNullOrEmpty(addressCountry)) 157 { 158 <script type="application/ld+json"> 159 { 160 "@@context": "http://schema.org", 161 "@@type": "Store", 162 "image": [ 163 "@siteURL/Admin/Public/GetImage.ashx?width=400&height=400&crop=0&Compression=75&DoNotUpscale=true&image=@businessPhotoPath", 164 "@siteURL/Admin/Public/GetImage.ashx?width=400&height=300&crop=0&Compression=75&DoNotUpscale=true&image=@businessPhotoPath", 165 "@siteURL/Admin/Public/GetImage.ashx?width=448&height=225&crop=0&Compression=75&DoNotUpscale=true&image=@businessPhotoPath" 166 ], 167 "@@id": "@siteURL", 168 "name": "@businessName", 169 "address": { 170 "@@type": "PostalAddress", 171 "streetAddress": "@streetAddress", 172 "addressLocality": "@addressLocality", 173 "addressRegion": "@addressRegion", 174 "postalCode": "@postalCode", 175 "addressCountry": "@addressCountry" 176 } 177 @if (!string.IsNullOrEmpty(contactEmail)) 178 { 179 <text>,"email": "@Model.Area.Item.GetString("ContactEmail")"</text> 180 } 181 @if (!string.IsNullOrEmpty(contactNumber)) 182 { 183 <text>,"telephone": "@Model.Area.Item.GetString("ContactNumber")"</text> 184 } 185 } 186 </script> 187 } 188 </head> 189190 <body> 191 @if(Model.Area.ID == 1){ 192 <!-- Google Tag Manager (noscript) --> 193 <noscript> 194 <iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KLKN3R7" 195 height="0" width="0" style="display:none;visibility:hidden"></iframe> 196 </noscript> 197 <!-- End Google Tag Manager (noscript) --> 198 } else { 199 <!-- Google Tag Manager (noscript) --> 200 <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-5FHSNZ3" 201 height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> 202 <!-- End Google Tag Manager (noscript) --> 203 } 204 @MobileNavigation(userInitials) 205206 @LoginModal() 207208 <main class="site dw-mod"> 209 <header class="top-container @stickyTop dw-mod" id="Top"> 210 @if(renderPagesInToolBar && Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") { 211 <div class="tools-navigation dw-mod"> 212 <div class="center-container grid top-container__center-container dw-mod"> 213 <div class="grid__cell"> 214 <div class="u-pull--left u-margin-top">@toolbarText</div> 215 <div class="u-pull--right"> 216 @RenderNavigation(new 217 { 218 id = "topToolsNavigation", 219 cssclass = "menu menu-tools dw-mod dwnavigation", 220 template = "TopMenu.xslt" 221 }) 222 </div> 223 </div> 224 </div> 225 </div> 226 } 227228 @if(Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") { 229 switch(topLayout) { 230 case "condensed": //2 231 <!-- Main navigation --> 232 <nav class="main-navigation dw-mod"> 233 <div class="center-container top-container__center-container dw-mod"> 234 <div class="grid"> 235236 <div class="grid__col-md-3 grid--align-self-center grid__col--bleed-y"> 237 <div class="logo u-padding--xs dw-mod"> 238 <a href="/Default.aspx?ID=@firstPageId"> 239 <img class="grid__cell-img" src="@logo" alt="@businessName" /> 240 </a> 241 </div> 242 </div> 243244 @* Navigation *@ 245 <div class="u-pull--left"> 246 @RenderHeaderNavigation() 247 </div> 248249 <div class="grid__cell grid__cell--align-middle-right"> 250 <ul class="menu dw-mod u-pull--right"> 251 @RenderSignIn("inNavigation", userInitials) 252 @RenderLanguageSelector() 253 @RenderFavorites() 254 @RenderMiniCart() 255 </ul> 256 </div> 257 </div> 258 </div> 259 </nav> 260261 <!-- Searchbar --> 262 <div class="u-box-shadow u-color-light-gray--bg u-inline-block u-full-width"> 263 <div class="center-container top-container__center-container dw-mod"> 264 <div class="typeahead typeahead--centered u-color-inherit js-typeahead dw-mod" data-page-size="10" id="ProductSearchBar" data-search-page-id="@productsSearchFeedId&feed=true" data-result-page-id="@productsPageId" data-groups-page-id="@productGroupsPageId"> 265 <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> 266 <ul class="dropdown dropdown--absolute-position u-min-w220px js-handlebars-root js-typeahead-groups-content dw-mod" id="ProductSearchBarGroupsContent" data-template="SearchGroupsTemplate" data-json-feed="/Default.aspx?ID=@productGroupsPageId&feedType=productGroups" data-init-onload="false" data-preloader="minimal"></ul> 267 <div class="typeahead-search-field"> 268 <input type="text" class="u-no-margin u-full-width js-typeahead-search-field" placeholder="@searchPlaceholder" value="@searchValue"> 269 <ul class="dropdown dropdown--absolute-position u-min-w220px u-full-width js-handlebars-root js-typeahead-search-content dw-mod" id="ProductSearchBarContent" data-template="SearchContentTemplate" data-json-feed="/Default.aspx?ID=@productsSearchFeedId&feedType=productsOnly&feed=true" data-init-onload="false"></ul> 270 </div> 271 <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> 272 </div> 273 </div> 274 </div> 275276 break; 277 case "minimal": //3 278 <!-- Main navigation --> 279 <nav class="main-navigation dw-mod"> 280 <div class="center-container top-container__center-container dw-mod"> 281 <div class="grid"> 282283 <div class="grid__col-md-3 grid--align-self-center grid__col--bleed-y"> 284 <div class="logo u-padding--xs dw-mod"> 285 <a href="/Default.aspx?ID=@firstPageId"> 286 <img class="grid__cell-img" src="@logo" alt="@businessName" /> 287 </a> 288 </div> 289 </div> 290291 @* Navigation *@ 292 <div class="u-pull--left"> 293 @RenderHeaderNavigation() 294 </div> 295296 <div class="grid__cell grid__cell--align-middle-right"> 297 <ul class="menu dw-mod u-pull--right"> 298299 @* Search *@ 300 <li class="menu__item menu__item--horizontal menu__item--top-level dw-mod" onmouseover="document.getElementById('headerSearch').focus()"> 301 <div class="menu__link u-w50px is-dropdown is-dropdown--no-icon dw-mod"> 302 <i class="fa fa-search fa-1_5x"></i> 303 <div class="menu menu--dropdown u-w340px top-micro-search dw-mod"> 304 <div class="typeahead js-typeahead" data-page-size="10" id="ProductSearchBar" data-search-page-id="@productsSearchFeedId&feed=true" data-result-page-id="@productsPageId" data-groups-page-id="@productGroupsPageId"> 305 <div class="typeahead-search-field"> 306 <input type="text" class="u-no-margin u-full-width js-typeahead-search-field" id="headerSearch" placeholder="@searchPlaceholder" value="@searchValue"> 307 <ul class="dropdown dropdown--absolute-position u-min-w220px u-full-width js-handlebars-root js-typeahead-search-content" id="ProductSearchBarContent" data-template="SearchContentTemplate" data-json-feed="/Default.aspx?ID=@productsSearchFeedId&feedType=productsOnly&feed=true" data-init-onload="false" data-preloader="minimal"></ul> 308 </div> 309 </div> 310 </div> 311 </div> 312 </li> 313314 @* @RenderSignIn("inNavigation", userInitials) *@ 315 @RenderLanguageSelector() 316 @* @RenderFavorites() 317 @RenderMiniCart() *@ 318 </ul> 319 </div> 320 </div> 321 </div> 322 </nav> 323 break; 324 case "splitted": //4 325 <!-- Header --> 326 <div class="header header-top dw-mod"> 327 <div class="center-container top-container__center-container dw-mod"> 328 <div class="grid"> 329330 @* Logo *@ 331 <div class="grid__col-md-6 grid__col-sm-6 grid--align-self-center grid__col--bleed-y"> 332 <div class="grid__cell"> 333 <div class="logo u-max-w220px u-margin-top u-margin-bottom dw-mod"> 334 <a href="/Default.aspx?ID=@firstPageId"> 335 <img class="grid__cell-img" src="@logo" alt="@businessName" /> 336 </a> 337 </div> 338 </div> 339 </div> 340341 @* Search *@ 342 <div class="grid__col-md-6 grid__col-sm-6 grid__col-xs-12 grid--align-self-center grid__col--bleed"> 343 <div class="grid__cell"> 344 <div class="typeahead u-no-margin u-margin-top u-margin-bottom u-color-inherit js-typeahead" data-page-size="10" id="TopProductSearch" data-search-page-id="@productsSearchFeedId&feed=true" data-result-page-id="@productsPageId" data-groups-page-id="@productGroupsPageId"> 345 <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> 346 <ul class="dropdown dropdown--absolute-position u-min-w220px js-handlebars-root js-typeahead-groups-content dw-mod" id="TopProductSearchGroupsContent" data-template="SearchGroupsTemplate" data-json-feed="/Default.aspx?ID=@productGroupsPageId&feedType=productGroups" data-init-onload="false" data-preloader="minimal"></ul> 347 <input type="text" class="typeahead-search-field u-no-margin js-typeahead-search-field" placeholder="@searchPlaceholder" value="@searchValue"> 348 <ul class="dropdown dropdown--absolute-position u-min-w220px u-full-width js-handlebars-root js-typeahead-search-content u-full-width dw-mod" id="TopProductSearchContent" data-template="SearchContentTemplate" data-json-feed="/Default.aspx?ID=@productsSearchFeedId&feedType=productsOnly&feed=true" data-init-onload="false" data-preloader="minimal"></ul> 349 <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> 350 </div> 351 </div> 352 </div> 353 </div> 354 </div> 355 </div> 356 <!-- Main navigation --> 357 <nav class="main-navigation dw-mod"> 358 <div class="center-container top-container__center-container dw-mod"> 359 <div class="grid"> 360 <div class="u-pull--left"> 361 @RenderHeaderNavigation() 362 </div> 363 <div class="grid__cell grid__cell--align-middle-right"> 364 <ul class="menu dw-mod u-pull--right"> 365 @RenderSignIn("inNavigation", userInitials) 366 @RenderLanguageSelector() 367 @RenderFavorites() 368 @if(!onlyPreview) { 369 @RenderMiniCart() 370 } 371 </ul> 372 </div> 373 </div> 374 </div> 375 </nav> 376377 break; 378 case "normal": //1 379 default: 380 <!-- Header --> 381 <div class="header header-top dw-mod"> 382 <div class="center-container top-container__center-container dw-mod"> 383 <div class="grid"> 384385 @* Logo *@ 386 <div class="grid__col-md-3 grid__col-sm-3 grid__col-xs-12 grid--align-self-center grid__col--bleed-y"> 387 <div class="logo dw-mod"> 388 <a href="/Default.aspx?ID=@firstPageId"> 389 <img class="grid__cell-img" src="@logo" alt="@businessName" /> 390 </a> 391 </div> 392 </div> 393394 @* Search *@ 395 <div class="grid__col-md-4 grid__col-sm-4 grid__col-xs-12 grid__col--bleed-y grid--align-self-center"> 396 <div class="typeahead u-margin u-color-inherit js-typeahead" data-page-size="10" id="TopProductSearch" data-search-page-id="@productsSearchFeedId&feed=true" data-result-page-id="@productsPageId" data-groups-page-id="@productGroupsPageId"> 397 <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> 398 <ul class="dropdown dropdown--absolute-position js-handlebars-root js-typeahead-groups-content u-min-w220px dw-mod" id="TopProductSearchGroupsContent" data-template="SearchGroupsTemplate" data-json-feed="/Default.aspx?ID=@productGroupsPageId&feedType=productGroups" data-init-onload="false" data-preloader="minimal"></ul> 399 <input type="text" class="typeahead-search-field u-no-margin js-typeahead-search-field" placeholder="@searchPlaceholder" value="@searchValue"> 400 <ul class="dropdown dropdown--absolute-position u-min-w220px u-full-width js-handlebars-root js-typeahead-search-content u-full-width dw-mod" id="TopProductSearchContent" data-template="SearchContentTemplate" data-json-feed="/Default.aspx?ID=@productsSearchFeedId&feedType=productsOnly&feed=true" data-init-onload="false" data-preloader="minimal"></ul> 401 <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> 402 </div> 403 </div> 404405 <div class="grid__col-md-4 grid__col-sm-4 grid__col-xs-12 grid__col--bleed-y grid--align-self-center"> 406 <div class="grid__cell grid__cell--align-middle-right"> 407 <ul class="menu dw-mod u-pull--right"> 408 @RenderSignIn("outsideNavigation", userInitials) 409 @RenderLanguageSelector("outsideNavigation") 410 @RenderFavorites("outsideNavigation") 411 @if(!onlyPreview) { 412 @RenderMiniCart("outsideNavigation") 413 } 414 </ul> 415 </div> 416 </div> 417 </div> 418 </div> 419 </div> 420421 <!-- Main navigation --> 422 <nav class="main-navigation dw-mod"> 423 <div class="center-container top-container__center-container dw-mod"> 424 <div class="grid"> 425 @RenderHeaderNavigation() 426 </div> 427 </div> 428 </nav> 429430 break; 431 } 432 } else { 433 string style = (topLayout == "normal" || topLayout == "splitted" ? "main-navigation--top-style" : "main-navigation--nav-style"); 434 <!-- Main navigation --> 435 <nav class="main-navigation dw-mod @style"> 436 <div class="center-container top-container__center-container dw-mod"> 437 <div class="grid"> 438 @MobileNavigationTrigger() 439440 <div class="logo u-max-w220px u-middle dw-mod"> 441 <a href="/Default.aspx?ID=@firstPageId"> 442 <img class="grid__cell-img u-w-100prc" src="@logo" alt="@businessName" /> 443 </a> 444 </div> 445446 @if(!onlyPreview) { 447 <ul class="menu dw-mod u-pull--right"> 448 @RenderMiniCart() 449 </ul> 450 } 451 </div> 452 </div> 453 </nav> 454455 @* Mobile search *@ 456 <div class="u-padding"> 457 <div class="js-typeahead" data-page-size="10" id="MobileProductSearch" data-search-page-id="@productsSearchFeedId&feed=true" data-result-page-id="@productsPageId"> 458 <input type="text" class="u-full-width js-typeahead-search-field u-no-margin" placeholder="@searchPlaceholder" value="@searchValue"> 459 <ul class="dropdown dropdown--absolute-position u-min-w220px js-handlebars-root js-typeahead-search-content dw-mod" id="MobileProductSearchContent" data-template="SearchContentTemplate" data-json-feed="/Default.aspx?ID=@productsSearchFeedId&feedType=productsOnly&feed=true" data-init-onload="false"></ul> 460 </div> 461 </div> 462 } 463464 @* Impersonation bar *@ 465 @if(Model.CurrentUser.ID > 0 && Model.SecondaryUsers.Count > 0) { 466 <div class="u-color-warning--bg"> 467 <div class="center-container top-container__center-container dw-mod"> 468 @*Impersonation*@ 469 <div class="grid"> 470 <div class="grid--align-self-center grid__col-x"> 471 @if(Model.CurrentSecondaryUser != null && Model.CurrentSecondaryUser.ID > 0) { 472 string stopImpersonateTranslation = Translate("Stop impersonation"); 473 string username = ""; 474 if(!string.IsNullOrEmpty(Model.CurrentSecondaryUser.FirstName) && !string.IsNullOrEmpty(Model.CurrentSecondaryUser.LastName)) { 475 username = Model.CurrentSecondaryUser.FirstName + " " + Model.CurrentSecondaryUser.LastName; 476 } else if(!string.IsNullOrEmpty(Model.CurrentSecondaryUser.Name)) { 477 username = Model.CurrentSecondaryUser.Name; 478 } else if(!string.IsNullOrEmpty(Model.CurrentSecondaryUser.Email)) { 479 username = Model.CurrentSecondaryUser.Email; 480 } else { 481 username = Model.CurrentSecondaryUser.UserName; 482 } 483 <div class="grid-cell"> 484 <div class="u-pull--left u-bold u-margin-top"> 485 <i class="fa fa-user-secret"></i> 486 @username<text>&nbsp;</text>@Translate("is impersonated by")<text>&nbsp;</text>@Pageview.User.UserName 487 </div> 488 <form method="post" class="u-pull--right u-no-margin"> 489 <input type="submit" class="btn btn--secondary dw-mod u-no-margin" name="DwExtranetRemoveSecondaryUser" value="@stopImpersonateTranslation"> 490 </form> 491 </div> 492 } else { 493 string viewListTranslation = Translate("View the list of users you can impersonate"); 494 <div class="grid-cell u-bold"> 495 <i class="fa fa-user-secret"></i> 496 <a href="/Default.aspx?ID=@impersonationPageId" title="@viewListTranslation" class="u-color-font-black">@viewListTranslation</a> 497 </div> 498 } 499 </div> 500 </div> 501 </div> 502 </div> 503 } 504 </header> 505506 <!-- Floating mini cart --> 507 @if(!onlyPreview && !stickyMenu && pageId == productsPageId && Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") { 508 <div class="floating-mini-cart u-hidden dw-mod" id="FloatingMiniCart"> 509 <div class="mini-cart dw-mod"> 510 <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')"> 511 <i class="fa fa-shopping-cart fa-4x"></i> 512 <div class="mini-cart__counter mini-cart__counter--lg dw-mod"> 513 <div class="js-handlebars-root js-mini-cart-counter" id="FloatingCartCounter" data-template="MiniCartCounterContent" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=Counter" data-preloader="false" data-init-onload="false"> 514 <div class="js-mini-cart-counter-content"> 515 @Model.Cart.TotalProductsCount 516 </div> 517 </div> 518 </div> 519 </a> 520521 <div class="mini-cart-dropdown js-handlebars-root js-mini-cart dw-mod" id="SecondaryMiniCart" data-template="MiniCartContent" data-cart-id="@miniCartFeedPageId" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=MiniCart" data-init-onload="false"></div> 522 </div> 523 </div> 524 } 525526 <!-- Render the content --> 527 <div id="Page" class="page @pagePos"> 528 <section class="center-container content-container dw-mod" id="content"> 529 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 530531532 @if (Model.PropertyItem.GetList("ShowBreadcrumb").SelectedValue == "True") 533 { 534 <div class="grid__col-12 grid__col--bleed-y"> 535 @RenderNavigation(new 536 { 537 id = "breadcrumb", 538 template = "Breadcrumb.xslt" 539 }) 540 </div> 541 } 542543 <div class="grid"> 544 @if (Model.PropertyItem.GetList("LeftMenu").SelectedValue == "True") 545 { 546 var navigationMarkup = RenderNavigation(new 547 { 548 id = "leftnav", 549 cssclass = "menu dwnavigation", 550 startLevel = 2, 551 endlevel = 5, 552 template = "LeftNavigation.xslt" 553 }); 554 if (!string.IsNullOrEmpty(navigationMarkup)) 555 { 556 <nav class="grid__col-md-3 grid__col-sm-12 grid__col-xs-12"> 557 <div class="grid"> 558 <div class="grid__col-12"> 559 <div class="grid__cell"> 560 @navigationMarkup 561 </div> 562 </div> 563 </div> 564 </nav> 565 } 566 } 567 <div class="grid__col-auto grid__col--bleed"> 568 <div class="grid"> 569 @* Divs count is equal divs in ParagraphContainer.cshtml *@ 570 @Model.Placeholder("dwcontent", "content", "default:true;sort:1") 571 </div> 572 </div> 573 </div> 574 </section> 575 </div> 576 </main> 577578 @RenderFooter() 579580581 <!-- Content rendering helpers --> 582583 @helper MobileNavigation(string userInitials) { 584 int pageId = Model.TopPage.ID; 585 string mobileNavigationLevels = Model.Area.Item.GetBoolean("MobileNavigationLevels") ? Model.Area.Item.GetString("MobileNavigationLevels") : "3"; 586587 bool showCreateAccountLink = Model.Area.Item.GetBoolean("ShowCreateAccountLink"); 588589 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 590 int cartFeedPageId = GetPageIdByNavigationTag("CartOrderlinesFeed"); 591 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 592593 string myProfilePageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerProfile").ToString() : GetPageIdByNavigationTag("CustomerProfile").ToString(); 594 string myOrdersPageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerOrders").ToString() : GetPageIdByNavigationTag("CustomerOrders").ToString(); 595 string myFavoritesPageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerFavorites").ToString() : GetPageIdByNavigationTag("CustomerFavorites").ToString(); 596 bool showMyProfileLink = Model.Area.Item.GetBoolean("ShowMyProfileLink"); 597 bool showMyOrdersLink = Model.Area.Item.GetBoolean("ShowMyOrdersLink"); 598 bool showMyFavoritesLink = Model.Area.Item.GetBoolean("ShowMyFavoritesLink"); 599600 bool renderPagesInToolBar = Model.Area.Item.GetBoolean("RenderPagesInToolBar"); 601 int startLevel = renderPagesInToolBar ? 1 : 0; 602603 bool onlyPreview = Model.Area.Item.GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 604605 if(Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") { 606 <!-- Trigger for mobile navigation --> 607 <input type="checkbox" id="MobileNavTrigger" class="mobile-nav-trigger" /> 608609 <!-- Mobile navigation --> 610 <nav class="mobile-navigation dw-mod"> 611 @if(Model.CurrentUser.ID > 0) { 612 string userName = Model.CurrentUser.FirstName != null ? Model.CurrentUser.FirstName : ""; 613 userName += " " + Model.CurrentUser.LastName != null ? Model.CurrentUser.LastName : ""; 614 userName += userName == "" && Model.CurrentUser.UserName != null ? Model.CurrentUser.UserName : ""; 615616 <ul class="menu menu-mobile"> 617 <li class="menu-mobile__item"> 618 <a href="/default.aspx?ID=@myProfilePageId" class="menu-mobile__link dw-mod"><i class="fa fa-user menu-mobile__link-icon"></i> @userName</a> 619 </li> 620 </ul> 621 } 622623 @RenderNavigation(new 624 { 625 id = "mobilenavigation", 626 cssclass = "menu menu-mobile dwnavigation", 627 startLevel = @startLevel, 628 ecomStartLevel = @startLevel+1, 629 endlevel = @mobileNavigationLevels, 630 expandmode = "all", 631 template = "BaseMenuForMobile.xslt" 632 }) 633634 @if(Model.Area.Item.GetBoolean("RenderPagesInToolBar")) { 635 @RenderNavigation(new 636 { 637 id = "topToolsMobileNavigation", 638 cssclass = "menu menu-mobile dwnavigation", 639 template = "ToolsMenuForMobile.xslt" 640 }) 641 } 642643 <ul class="menu menu-mobile"> 644 @if(Model.CurrentUser.ID <= 0) { 645 @* 646 <li class="menu-mobile__item"> 647 <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> 648 </li> 649 if (showCreateAccountLink) 650 { 651 <li class="menu-mobile__item"> 652 <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> 653 </li> 654 } 655 *@ 656 } else { 657 if(showMyProfileLink) { 658 <li class="menu-mobile__item"> 659 <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> 660 </li> 661 } 662 if(showMyOrdersLink) { 663 <li class="menu-mobile__item"> 664 <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> 665 </li> 666 } 667 if(showMyFavoritesLink) { 668 <li class="menu-mobile__item"> 669 <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> 670 </li> 671 } 672 <li class="menu-mobile__item"> 673 <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> 674 </li> 675 } 676677678 @if(true) { 679 string selectedLanguage = Pageview.Area.CultureInfo.DisplayName.Split('(')[0].Trim(); 680681 <li class="menu-mobile__item dw-mod"> 682 <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> 683 <input id="MobileMenuCheck_Language" type="checkbox" class="expand-trigger"> 684 <label for="MobileMenuCheck_Language" class="menu-mobile__trigger"></label> 685 <ul class="menu-mobile menu-mobile__submenu expand-menu"> 686 @foreach(var area in Dynamicweb.Services.Areas.GetAreas()) { 687 string languageName = Translate(area.CultureInfo.DisplayName.Split('(')[0].Trim()); 688 <li class="menu-mobile__item dw-mod"> 689 <a class="menu-mobile__link menu-mobile__link--highlighted dw-mod menu-mobile__link--level-1" href="/Default.aspx?ID=@(Dynamicweb.Services.Pages.GetFirstPageForArea(area.ID).ID)">@languageName</a> 690 </li> 691 } 692 </ul> 693 </li> 694 } 695 </ul> 696 </nav> 697 <label class="mobile-nav-trigger-off" for="MobileNavTrigger"></label> 698699 if(!onlyPreview) { 700 <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> 701 } 702 } 703 } 704705 @helper LoginModal() { 706 int pageId = Model.TopPage.ID; 707 string topLayout = Model.Area.Item.GetList("LayoutTop").SelectedValue; 708 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 709 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 710 string forgotPasswordPageId = signInProfilePageId.ToString() + "&LoginAction=Recovery"; 711 string userSignedInError = !Model.LogOnFailed ? "" : "checked"; 712 string userSignedInErrorText = ""; 713714 if(Model.LogOnFailed) { 715 switch(Model.LogOnFailedReason) { 716 case Dynamicweb.Security.UserManagement.LogOnFailedReason.PasswordLengthInvalid: 717 userSignedInErrorText = Translate("Password length is invalid"); 718 break; 719 case Dynamicweb.Security.UserManagement.LogOnFailedReason.IncorrectLogin: 720 userSignedInErrorText = Translate("Invalid email or password"); 721 break; 722 case Dynamicweb.Security.UserManagement.LogOnFailedReason.ExceededFailedLogOnLimit: 723 userSignedInErrorText = Translate("You have exceeded the limit of allowed login attempts. The user account is temporarily locked"); 724 break; 725 case Dynamicweb.Security.UserManagement.LogOnFailedReason.LoginLocked: 726 userSignedInErrorText = Translate("The user account is temporarily locked"); 727 break; 728 case Dynamicweb.Security.UserManagement.LogOnFailedReason.PasswordExpired: 729 userSignedInErrorText = Translate("The password has expired and needs to be renewed"); 730 break; 731 default: 732 userSignedInErrorText = Translate("An unknown error occured"); 733 break; 734 } 735 } 736737 <!-- Trigger for the login modal --> 738 <input type="checkbox" id="SignInModalTrigger" class="modal-trigger @topLayout" @userSignedInError /> 739740 <!-- Login modal --> 741 <div class="modal-container"> 742 <label for="SignInModalTrigger" id="SignInModalOverlay" class="modal-overlay"></label> 743 <div class="modal modal--xs" id="SignInModal"> 744 <div class="modal__header"> 745 <h2>@Translate("Sign in")</h2> 746 </div> 747 <div class="modal__body"> 748 <form method="post" id="LoginForm" class="u-no-margin"> 749 <input type="hidden" name="ID" value="@pageId" /> 750 <input type="hidden" name="DWExtranetUsernameRemember" value="True" /> 751 <input type="hidden" name="DWExtranetPasswordRemember" value="True" /> 752 <input type="text" class="u-full-width" id="LoginUsername" name="username" placeholder="@Translate("Email")" /> 753 <input type="password" class="u-full-width" id="LoginPassword" name="password" placeholder="@Translate("Password")" /> 754 <div class="field-error dw-mod">@userSignedInErrorText</div> 755756 <label> 757 <input type="checkbox" id="RememberMe" name="Autologin" checked="checked" value="True"> 758 <span>@Translate("Remember me", "Remember me")</span> 759 </label> 760761 <button type="submit" class="btn btn--primary btn--full dw-mod" name="LoginAction" value="Login" onclick="Buttons.LockButton(event)">@Translate("Sign in")</button> 762763 <a class="btn btn--link-clean dw-mod" href="/Default.aspx?id=@forgotPasswordPageId">@Translate("Forgot your password?", "Forgot your password?")</a> 764765 <a class="btn btn--link-clean dw-mod" href="/default.aspx?ID=@createAccountPageId">@Translate("Create account")?</a> 766 </form> 767 </div> 768 </div> 769 </div> 770 } 771772 @helper RenderHeaderNavigation() { 773 bool megaMenu = Model.Area.Item.GetList("NavigationMegaMenu").SelectedValue.ToLower() == "true" ? true : false; 774 string megamenuPromotionImage = Model.Area.Item.GetFile("NavigationMegamenuPromotionImage") != null ? Model.Area.Item.GetFile("NavigationMegamenuPromotionImage").Path : ""; 775 bool renderPagesInToolBar = Model.Area.Item.GetBoolean("RenderPagesInToolBar"); 776 int startLevel = renderPagesInToolBar ? 1 : 0; 777778779 if(Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") { 780 if(!megaMenu) { 781 if(Model.Area.ID == 10) { 782783 <ul class="menu dw-mod dwnavigation" id="topnavigation"> 784 @foreach(var page in Dynamicweb.Services.Pages.GetPagesByParentID(725)) { 785 if(page.ID == 753) { 786 <li class="menu__item dw-mod menu__item--horizontal menu__item--top-level dw-navbar-button is-dropdown menu__item--disabled"> 787 <a href="/Default.aspx?ID=@page.ID" class="menu__link dw-mod">@page.MenuText</a> 788 <ul class="menu menu--dropdown dw-mod"> 789 @foreach(var i in Dynamicweb.Ecommerce.Services.ProductGroups.GetGroups("LANG2").Where(x => x.ProductCount > 0).OrderBy(x => x.Name)) { 790791 string urlToParse = "Default.aspx?ID=725&GroupID="+i.IdUrlEncoded; 792 string groupHref = Dynamicweb.SystemTools.UrlParser.GetFullHrefString(urlToParse); 793 <li class="menu__item dw-mod menu__item--fixed-width"> 794 <a class=" menu-dropdown__link dw-mod" href="@groupHref">@i.Name</a> 795 </li> 796 } 797 </ul> 798 </li> 799 } else { 800 <li class="menu__item dw-mod menu__item--horizontal menu__item--top-level dw-navbar-button"> 801 <a class="menu__link dw-mod" href="/Default.aspx?ID=@page.ID">@page.MenuText</a> 802 </li> 803 } 804 } 805 </ul> 806807 } else { 808 @RenderNavigation(new 809 { 810 id = "topnavigation", 811 cssclass = "menu dw-mod dwnavigation", 812 startLevel = @startLevel, 813 ecomStartLevel = @startLevel+1, 814 endlevel = 5, 815 expandmode="all", 816 template = "BaseMenuWithDropdown.xslt" 817 }); 818 } 819820 } else { 821 @RenderNavigation(new 822 { 823 id = "topnavigation", 824 cssclass = "menu dw-mod dwnavigation", 825 startLevel = @startLevel, 826 ecomStartLevel = @startLevel+1, 827 endlevel = 5, 828 promotionImage = megamenuPromotionImage, 829 promotionLink = Model.Area.Item.GetString("NavigationMegamenuPromotionLink"), 830 expandmode = "all", 831 template = "BaseMegaMenu.xslt" 832 }); 833 } 834 } 835 } 836837 @helper MobileNavigationTrigger() { 838 @* Mobile navigation trigger *@ 839840 if(Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") { 841 <div class="menu dw-mod u-pull--left"> 842 <div class="menu__item menu__item--horizontal menu__item--top-level dw-mod"> 843 <label for="MobileNavTrigger" class="mobile-nav-trigger-button menu__link dw-mod"></label> 844 </div> 845 </div> 846 } 847 } 848849 @helper RenderLanguageSelector(string type = "inNavigation") { 850 string liClasses = type == "inNavigation" ? "menu__item menu__item--horizontal menu__item--top-level dw-mod" : "menu__item menu__item--horizontal menu--clean u-w40px dw-mod"; 851 string menuLinkClass = type == "inNavigation" ? "menu__link" : "header-menu__link"; 852 string twoLetterLanguageName = Pageview.Area.CultureInfo.TwoLetterISOLanguageName; 853854 if(twoLetterLanguageName == "en"){ 855 twoLetterLanguageName = "gb"; 856 } else if(twoLetterLanguageName == "da"){ 857 twoLetterLanguageName = "dk"; 858 } 859860 @* Language selector *@ 861862863 if(true) { 864865 <li class="@liClasses"> 866 <div class="@menuLinkClass u-w40px is-dropdown is-dropdown--no-icon dw-mod" style="position:relative;"> 867 <img style="display:inline;" src="/Admin/Resources/fonts/flags/1x1/@(twoLetterLanguageName).svg"/> 868869 <div class="menu menu--dropdown u-w100px dw-mod" style="left:inherit;right:0;"> 870 @foreach(var area in Dynamicweb.Services.Areas.GetAreas()) { 871 string languageName = Translate(area.CultureInfo.DisplayName.Split('(')[0].Trim()); 872 string areaprotocol = area.SslMode == 1 ? "https://" : "http://"; 873 <a href="@(areaprotocol)@area.DomainLock" class="menu-dropdown__item menu-dropdown__item--link dw-mod">@languageName</a> 874 } 875 </div> 876 </div> 877 </li> 878 } 879 } 880881 @helper RenderMiniCart(string type = "inNavigation") { 882 string liClasses = type == "inNavigation" ? "menu__item menu__item--horizontal menu__item--top-level dw-mod" : "menu__item menu__item--horizontal menu--clean dw-mod"; 883 string menuLinkClass = type == "inNavigation" ? "menu__link" : "header-menu__link"; 884885 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 886 int cartFeedPageId = GetPageIdByNavigationTag("CartOrderlinesFeed"); 887 int cartPageId = GetPageIdByNavigationTag("CartPage"); 888 double cartProductsCount = Model.Cart.TotalProductsCount; 889890 @* Mini cart *@ 891 <li class="@liClasses"> 892 <div class="mini-cart dw-mod"> 893 <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')"> 894 <i class="fa fa-shopping-cart fa-1_5x"></i> 895 <div class="mini-cart__counter mini-cart__counter--inline dw-mod"> 896 <div class="js-handlebars-root js-mini-cart-counter" id="cartCounter" data-template="MiniCartCounterContent" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=Counter" data-init-onload="false" data-preloader="false"> 897 <div class="js-mini-cart-counter-content"> 898 @cartProductsCount 899 </div> 900 </div> 901 </div> 902 </a> 903 @if(Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") { 904 <div class="mini-cart-dropdown js-handlebars-root js-mini-cart dw-mod" id="miniCart" data-template="MiniCartContent" data-cart-id="@miniCartFeedPageId" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=MiniCart" data-init-onload="false"></div> 905 } 906 </div> 907 </li> 908 } 909910 @helper RenderSignIn(string type = "inNavigation", string userInitials = "") { 911 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"; 912 string menuLinkClass = type == "inNavigation" ? "menu__link" : "header-menu__link"; 913914 int pageId = Model.TopPage.ID; 915 string myProfilePageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerProfile").ToString() : GetPageIdByNavigationTag("CustomerProfile").ToString(); 916 string myOrdersPageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerOrders").ToString() : GetPageIdByNavigationTag("CustomerOrders").ToString(); 917 int myDashboardPageId = GetPageIdByNavigationTag("CustomerDashboard"); 918 string myFavoritesPageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerFavorites").ToString() : GetPageIdByNavigationTag("CustomerFavorites").ToString(); 919 string mySavedCardsPageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("SavedCards").ToString() : GetPageIdByNavigationTag("SavedCards").ToString(); 920 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 921 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 922 string forgotPasswordPageId = signInProfilePageId.ToString() + "&LoginAction=Recovery"; 923924 bool showCreateAccountLink = Model.Area.Item.GetBoolean("ShowCreateAccountLink"); 925 bool showMyProfileLink = Model.Area.Item.GetBoolean("ShowMyProfileLink"); 926 bool showMyOrdersLink = Model.Area.Item.GetBoolean("ShowMyOrdersLink"); 927 bool showMyFavoritesLink = Model.Area.Item.GetBoolean("ShowMyFavoritesLink"); 928 bool showMySavedCardsLink = Model.Area.Item.GetBoolean("ShowMySavedCardsLink"); 929930 @* Sign in + Customer center links *@ 931 <li class="@liClasses"> 932 <div class="@menuLinkClass is-dropdown is-dropdown--no-icon u-w40px dw-mod"> 933 @if(Model.CurrentUser.ID <= 0) { 934 <i class="fa fa-user fa-1_5x"></i> 935 } else { 936 <a href="/default.aspx?ID=@myDashboardPageId" class="u-color-inherit"><div class="circle-icon-btn">@userInitials.ToUpper()</div></a> 937 } 938939 <div class="menu menu--dropdown sign-in-dropdown dw-mod"> 940 <ul class="list list--clean dw-mod"> 941 @if(Model.CurrentUser.ID <= 0) { 942 <li> 943 <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> 944 </li> 945 if(showCreateAccountLink) { 946 <li> 947 <a href="/default.aspx?ID=@createAccountPageId" class="list__link dw-mod">@Translate("Create account")</a> 948 </li> 949 } 950 <li> 951 <a href="/default.aspx?ID=@forgotPasswordPageId" class="list__link dw-mod">@Translate("Forgot your password?")</a> 952 </li> 953 if(showMyProfileLink || showMyOrdersLink || showMyFavoritesLink || showMySavedCardsLink) { 954 <li class="list__seperator dw-mod"></li> 955 } 956 } 957 @if(showMyProfileLink) { 958 <li> 959 <a href="/default.aspx?ID=@myProfilePageId" class="list__link dw-mod"><i class="fa fa-user"></i> @Translate("My Profile")</a> 960 </li> 961 } 962 @if(showMyOrdersLink) { 963 <li> 964 <a href="/default.aspx?ID=@myOrdersPageId" class="list__link dw-mod"><i class="fa fa-list"></i> @Translate("My Orders")</a> 965 </li> 966 } 967 @if(showMyFavoritesLink) { 968 <li> 969 <a href="/default.aspx?ID=@myFavoritesPageId" class="list__link dw-mod"><i class="fa fa-star"></i> @Translate("My Favorites")</a> 970 </li> 971 } 972 @if(showMySavedCardsLink) { 973 <li> 974 <a href="/default.aspx?ID=@mySavedCardsPageId" class="list__link dw-mod"><i class="fa fa-credit-card"></i> @Translate("My Saved cards")</a> 975 </li> 976 } 977 @if(Model.CurrentUser.ID > 0) { 978 if(showMyProfileLink || showMyOrdersLink || showMyFavoritesLink || showMySavedCardsLink) { 979 <li class="list__seperator dw-mod"></li> 980 } 981 <li> 982 <a href="/Admin/Public/ExtranetLogoff.aspx?ID=@pageId" class="list__link dw-mod">@Translate("Sign out")</a> 983 </li> 984 } 985 </ul> 986 </div> 987 </div> 988 </li> 989 } 990991 @helper RenderFavorites(string type = "inNavigation") { 992 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"; 993 string menuLinkClass = type == "inNavigation" ? "menu__link" : "header-menu__link"; 994995 string myFavoritesPageId = GetPageIdByNavigationTag("CustomerFavorites").ToString(); 996997 @* Favorites *@ 998 if(Model.CurrentUser.ID > 0) { 999 <li class="@liClasses"> 1000 <a href="/Default.aspx?ID=@myFavoritesPageId" class="@menuLinkClass dw-mod"> 1001 <i class="fa fa-star fa-1_5x"></i> 1002 </a> 1003 </li> 1004 } 1005 } 100610071008 @helper RenderFooter() { 1009 string footerColumnOneContent = !string.IsNullOrEmpty(Model.Area.Item.GetString("FooterColumnOne")) ? Model.Area.Item.GetString("FooterColumnOne") : ""; 1010 string footerColumnTwoContent = !string.IsNullOrEmpty(Model.Area.Item.GetString("FooterColumnTwo")) ? Model.Area.Item.GetString("FooterColumnTwo") : ""; 1011 string footerColumnThreeContent = !string.IsNullOrEmpty(Model.Area.Item.GetString("FooterColumnThree")) ? Model.Area.Item.GetString("FooterColumnThree") : ""; 1012 string footerColumnOneHeader = Model.Area.Item.GetString("FooterColumnOneHeader"); 1013 string footerColumnTwoHeader = Model.Area.Item.GetString("FooterColumnTwoHeader"); 1014 string footerColumnThreeHeader = Model.Area.Item.GetString("FooterColumnThreeHeader"); 1015 int newsletterSignUpPageId = GetPageIdByNavigationTag("NewsletterSignUp"); 10161017 <!-- Footer section --> 1018 <footer class="footer dw-mod"> 1019 <div class="center-container top-container__center-container dw-mod"> 1020 <div class="grid"> 1021 @if(!string.IsNullOrEmpty(footerColumnOneContent) || !string.IsNullOrEmpty(footerColumnOneHeader)) { 1022 <div class="grid__col-md-auto"> 1023 <h4 class="footer__heading dw-mod">@footerColumnOneHeader</h4> 1024 <div class="footer__content dw-mod"> 1025 @footerColumnOneContent 1026 </div> 1027 </div> 1028 } 1029 @if(!string.IsNullOrEmpty(footerColumnTwoContent) || !string.IsNullOrEmpty(footerColumnTwoHeader)) { 1030 <div class="grid__col-md-auto"> 1031 <h4 class="footer__heading dw-mod">@footerColumnTwoHeader</h4> 1032 <div class="footer__content dw-mod"> 1033 @footerColumnTwoContent 1034 </div> 1035 </div> 1036 } 1037 @if(!string.IsNullOrEmpty(footerColumnThreeContent) || !string.IsNullOrEmpty(footerColumnThreeHeader)) { 1038 <div class="grid__col-md-auto"> 1039 <h4 class="footer__heading dw-mod">@footerColumnThreeHeader</h4> 1040 <div class="footer__content dw-mod"> 1041 @footerColumnThreeContent 1042 </div> 1043 </div> 1044 } 1045 @if(Model.Area.Item.GetBoolean("FooterNewsletterSignUp")) { 1046 <div class="grid__col-md-auto"> 1047 <h4 class="footer__heading dw-mod">@Translate("Mailing list", "Mailing list")</h4> 1048 <div class="footer__content dw-mod"> 1049 <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> 1050 <form class="form dw-mod" name="NewsletterRedirect" action='/Default.aspx' method="get" enctype="multipart/form-data"> 1051 <input name="ID" id="ID" value="@newsletterSignUpPageId" type="hidden" /> 1052 <div class="form__field-combi"> 1053 <input name="NewsletterEmail" id="NewsletterEmail" type="text" placeholder='@Translate("Your email address", "Your email address")' /> 1054 <input class="btn btn--primary btn--condensed dw-mod" type="submit" id="Submitter" value='@Translate("Go", "Go")' /> 1055 </div> 1056 </form> 1057 </div> 1058 </div> 1059 } 1060 @if(Model.Area.Item.GetItems("FooterSocialLinks").Count > 0) { 1061 <div class="grid__col-md-auto"> 1062 <h4 class="footer__heading dw-mod">@Translate("Social links", "Social links")</h4> 1063 <div class="footer__content dw-mod"> 1064 <div class="collection dw-mod"> 1065 @foreach(var socialitem in Model.Area.Item.GetItems("FooterSocialLinks")) { 1066 //Fields.FirstOrDefault(x => x.SystemName == "Icon").GetString() 1067 var socialIcon = socialitem.GetValue("Icon") as Dynamicweb.Frontend.ListViewModel; 1068 string socialIconClass = socialIcon.SelectedValue; 1069 string socialIconTitle = socialIcon.SelectedName; 1070 string socialLink = socialitem.GetString("Link"); 10711072 <a href="@socialLink" target="_blank" title="@socialIconTitle"><i class="fa @socialIconClass fa-2x"></i></a> 1073 } 1074 </div> 1075 </div> 1076 </div> 1077 } 1078 <div class="grid__col-12 footer__copyright dw-mod"> 1079 <p>@Model.Area.Item.GetString("FooterCopyrightText")</p> 1080 </div> 1081 </div> 1082 </div> 1083 </footer> 1084 } 108510861087 @* Templates for Typeahead *@ 1088 <script id="SearchGroupsTemplate" type="text/x-template"> 1089 {{#.}} 1090 <li class="dropdown__item dw-mod" onclick="Search.UpdateGroupSelection(this)" data-group-id="{{id}}">{{name}}</li> 1091 {{/.}} 1092 </script> 10931094 <script id="SearchContentTemplate" type="text/x-template"> 1095 {{#each .}} 1096 {{#Product}} 1097 {{#ifCond template "!==" "SearchMore"}} 1098 <li class="dropdown__item dropdown__item--seperator dw-mod"> 1099 <div> 1100 <a href="{{link}}" class="js-typeahead-link u-color-inherit u-pull--left"> 1101 <div class="u-margin-right u-pull--left {{noimage}} u-hidden-xs u-hidden-xxs"><img src="/Admin/Public/GetImage.ashx?width=45&height=36&crop=5&FillCanvas=True&Compression=75&image={{image}}" alt="{{name}}"></div> 1102 <div class="u-pull--left"> 1103 <div class="u-bold u-max-w220px u-truncate-text js-typeahead-name">{{name}}</div> 1104 @if(!onlyPreview) { 1105 <div class="{{onlyPreview}}">{{price}}</div> 1106 } 1107 </div> 1108 </a> 1109 <div class="u-margin-left u-pull--right u-w80px u-hidden"> 1110 <button class="btn btn--primary btn--condensed btn--full u-no-margin dw-mod {{hideBuyOptions}} js-ignore-click-outside" onclick="Cart.AddToCart(event, '{{productId}}', '1')"><i class="fa fa-shopping-cart js-ignore-click-outside"></i></button> 1111 <a href="{{link}}" class="btn btn--secondary btn--condensed btn--full u-no-margin dw-mod {{hideViewMore}} js-ignore-click-outside">@Translate("View")</a> 1112 </div> 1113 </div> 1114 </li> 1115 {{/ifCond}} 1116 {{#ifCond template "===" "SearchMore"}} 1117 {{>SearchMore}} 1118 {{/ifCond}} 1119 {{/Product}} 1120 {{else}} 1121 <li class="dropdown__item dropdown__item--seperator dw-mod"> 1122 @Translate("No products found") 1123 </li> 1124 {{/each}} 1125 </script> 11261127 <script id="SearchMore" type="text/x-template"> 1128 <li class="dropdown__item dropdown__item--not-selectable dw-mod"> 1129 <a href="/Default.aspx?ID=@productsPageId&Search={{searchParameter}}&GroupID={{groupId}}" class="btn btn--primary btn--full u-no-margin dw-mod js-typeahead-link"> 1130 @Translate("View all") 1131 </a> 1132 </li> 1133 </script> 11341135 @* Templates for the mini cart *@ 1136 <script id="MiniCartCounterContent" type="text/x-template"> 1137 {{#.}} 1138 <div class="js-mini-cart-counter-content dw-mod"> 1139 {{numberofproducts}} 1140 </div> 1141 {{/.}} 1142 </script> 11431144 <script id="MiniCartContent" type="text/x-template"> 1145 {{#.}} 1146 <div class="mini-cart-dropdown__inner {{isempty}} dw-mod"> 1147 <h4 class="u-ta-center u-no-margin u-margin-bottom u-margin-top">@Translate("Shopping cart")</h4> 1148 <div class="mini-cart-dropdown__body dw-mod"> 1149 <table class="table mini-cart-table dw-mod"> 1150 <thead> 1151 <tr> 1152 <td>&nbsp;</td> 1153 <td>@Translate("Product")</td> 1154 <td class="u-ta-right">@Translate("Qty")</td> 1155 <td class="u-ta-right" width="120">@Translate("Price")</td> 1156 </tr> 1157 </thead> 11581159 {{#OrderLines}} 1160 {{#ifCond template "===" "CartOrderline"}} 1161 {{>MiniCartOrderline}} 1162 {{/ifCond}} 1163 {{#ifCond template "===" "CartOrderlineMobile"}} 1164 {{>MiniCartOrderlineMobile}} 1165 {{/ifCond}} 1166 {{#ifCond template "===" "CartOrderlineDiscount"}} 1167 {{>MiniCartOrderlineDiscount}} 1168 {{/ifCond}} 1169 {{/OrderLines}} 11701171 <tr> 1172 <td><i class="fa fa-credit-card"></i></td> 1173 <td>{{paymentmethod}}</td> 1174 <td colspan="2" class="u-ta-right" width="130">{{paymentfee}}</td> 1175 </tr> 1176 <tr> 1177 <td><i class="fa fa-truck"></i></td> 1178 <td>{{shippingmethod}}</td> 1179 <td colspan="2" class="u-ta-right" width="130">{{shippingfee}}</td> 1180 </tr> 1181 <tr class="mini-cart-totals dw-mod"> 1182 <td colspan="2">@Translate("Total")</td> 1183 <td class="u-ta-right">{{numberofproducts}}</td> 1184 <td class="u-ta-right" width="130">{{totalprice}}</td> 1185 </tr> 1186 </table> 1187 </div> 11881189 <table class="table mini-cart-table dw-mod"> 1190 <tr class="mini-cart-orderlines__footer dw-mod"> 1191 <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> 1192 <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> 1193 </tr> 1194 </table> 1195 </div> 1196 {{/.}} 1197 </script> 11981199 <script id="MiniCartOrderline" type="text/x-template"> 1200 <tr class="{{isempty}}"> 1201 <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> 1202 <td> 1203 <a href="{{link}}" class="mini-cart-orderlines__name" title="{{name}}">{{name}}</a> 1204 <a href="{{link}}" class="mini-cart-orderlines__name item-number">{{variantname}}</a> 1205 <div class="item-number">{{unitname}}</div> 1206 </td> 1207 <td class="u-ta-right">{{quantity}}</td> 1208 <td class="u-ta-right">{{totalprice}}</td> 1209 </tr> 1210 </script> 12111212 <script id="MiniCartOrderlineMobile" type="text/x-template"> 1213 <tr class="{{isempty}}"> 1214 <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> 1215 <td> 1216 <a href="{{link}}" class="mini-cart-orderlines__name">{{name}}</a> 1217 <a href="{{link}}" class="mini-cart-orderlines__name item-number">{{variantname}}</a> 1218 <div class="item-number">{{unitname}}</div> 1219 </td> 1220 <td class="u-ta-right">{{quantity}}</td> 1221 <td class="u-ta-right">{{totalprice}}</td> 1222 </tr> 1223 </script> 12241225 <script id="MiniCartOrderlineDiscount" type="text/x-template"> 1226 <tr class="table__row--no-border {{isempty}}"> 1227 <td>&nbsp;</td> 1228 <td><div class="mini-cart-orderlines__name dw-mod">{{name}}</div></td> 1229 <td class="u-ta-right">&nbsp;</td> 1230 <td class="u-ta-right">{{totalprice}}</td> 1231 </tr> 1232 </script> 12331234 <!-- Javascript --> 1235 <script src="/Files/Templates/Designs/Rapido/js/handlebars-v4.0.11.js"></script> 1236 <script src="/Files/Templates/Designs/Rapido/js/master.min.js"></script> 12371238 @if(Model.Area.Item.GetBoolean("UseCustomJavascript")) { 1239 <script src="/Files/Templates/Designs/Rapido/js/custom.min.js"></script> 1240 } 12411242 <script> 1243 Wireframe.Init(@wireframeMode.ToLower()); 1244 </script> 1245 </body> 1246 </html> 12471248