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

1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 2 3 @* 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> 101 102 <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 109 110 <!-- Favicon --> 111 <link href="@favicon" rel="icon" type="image/png"> 112 113 <!-- Font awesome --> 114 <link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/rapido/font-awesome.min.css" type="text/css"> 115 116 <!-- Base (Default, wireframe) styles --> 117 <link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/base/base.min.css" type="text/css"> 118 119 <!-- Rapido Css from Website Settings --> 120 <link id="rapidoCss" rel="stylesheet" href="@autoCssLink" type="text/css"> 121 122 <!-- 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"> 124 125 <!-- 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 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 140 141 @if (!string.IsNullOrEmpty(businessPhotoPath) && 142 !string.IsNullOrEmpty(businessName) && 143 !string.IsNullOrEmpty(streetAddress) && 144 !string.IsNullOrEmpty(addressLocality) && 145 !string.IsNullOrEmpty(addressRegion) && 146 !string.IsNullOrEmpty(postalCode) && 147 !string.IsNullOrEmpty(addressCountry)) 148 { 149 <script type="application/ld+json"> 150 { 151 "@@context": "http://schema.org", 152 "@@type": "Store", 153 "image": [ 154 "@siteURL/Admin/Public/GetImage.ashx?width=400&height=400&crop=0&Compression=75&DoNotUpscale=true&image=@businessPhotoPath", 155 "@siteURL/Admin/Public/GetImage.ashx?width=400&height=300&crop=0&Compression=75&DoNotUpscale=true&image=@businessPhotoPath", 156 "@siteURL/Admin/Public/GetImage.ashx?width=448&height=225&crop=0&Compression=75&DoNotUpscale=true&image=@businessPhotoPath" 157 ], 158 "@@id": "@siteURL", 159 "name": "@businessName", 160 "address": { 161 "@@type": "PostalAddress", 162 "streetAddress": "@streetAddress", 163 "addressLocality": "@addressLocality", 164 "addressRegion": "@addressRegion", 165 "postalCode": "@postalCode", 166 "addressCountry": "@addressCountry" 167 } 168 @if (!string.IsNullOrEmpty(contactEmail)) 169 { 170 <text>,"email": "@Model.Area.Item.GetString("ContactEmail")"</text> 171 } 172 @if (!string.IsNullOrEmpty(contactNumber)) 173 { 174 <text>,"telephone": "@Model.Area.Item.GetString("ContactNumber")"</text> 175 } 176 } 177 </script> 178 } 179 </head> 180 181 <body> 182 <!-- Google Tag Manager (noscript) --> 183 <noscript> 184 <iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KLKN3R7" 185 height="0" width="0" style="display:none;visibility:hidden"></iframe> 186 </noscript> 187 <!-- End Google Tag Manager (noscript) --> 188 @MobileNavigation(userInitials) 189 190 @LoginModal() 191 192 <main class="site dw-mod"> 193 <header class="top-container @stickyTop dw-mod" id="Top"> 194 @if(renderPagesInToolBar && Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") { 195 <div class="tools-navigation dw-mod"> 196 <div class="center-container grid top-container__center-container dw-mod"> 197 <div class="grid__cell"> 198 <div class="u-pull--left u-margin-top">@toolbarText</div> 199 <div class="u-pull--right"> 200 @RenderNavigation(new 201 { 202 id = "topToolsNavigation", 203 cssclass = "menu menu-tools dw-mod dwnavigation", 204 template = "TopMenu.xslt" 205 }) 206 </div> 207 </div> 208 </div> 209 </div> 210 } 211 212 @if(Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") { 213 switch(topLayout) { 214 case "condensed": //2 215 <!-- Main navigation --> 216 <nav class="main-navigation dw-mod"> 217 <div class="center-container top-container__center-container dw-mod"> 218 <div class="grid"> 219 220 <div class="grid__col-md-3 grid--align-self-center grid__col--bleed-y"> 221 <div class="logo u-padding--xs dw-mod"> 222 <a href="/Default.aspx?ID=@firstPageId"> 223 <img class="grid__cell-img" src="@logo" alt="@businessName" /> 224 </a> 225 </div> 226 </div> 227 228 @* Navigation *@ 229 <div class="u-pull--left"> 230 @RenderHeaderNavigation() 231 </div> 232 233 <div class="grid__cell grid__cell--align-middle-right"> 234 <ul class="menu dw-mod u-pull--right"> 235 @RenderSignIn("inNavigation", userInitials) 236 @RenderLanguageSelector() 237 @RenderFavorites() 238 @RenderMiniCart() 239 </ul> 240 </div> 241 </div> 242 </div> 243 </nav> 244 245 <!-- Searchbar --> 246 <div class="u-box-shadow u-color-light-gray--bg u-inline-block u-full-width"> 247 <div class="center-container top-container__center-container dw-mod"> 248 <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"> 249 <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> 250 <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> 251 <div class="typeahead-search-field"> 252 <input type="text" class="u-no-margin u-full-width js-typeahead-search-field" placeholder="@searchPlaceholder" value="@searchValue"> 253 <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> 254 </div> 255 <button type="button" class="btn btn--condensed btn--primary u-no-margin dw-mod js-typeahead-enter-btn"><i class="fa fa-search"></i></button> 256 </div> 257 </div> 258 </div> 259 260 break; 261 case "minimal": //3 262 <!-- Main navigation --> 263 <nav class="main-navigation dw-mod"> 264 <div class="center-container top-container__center-container dw-mod"> 265 <div class="grid"> 266 267 <div class="grid__col-md-3 grid--align-self-center grid__col--bleed-y"> 268 <div class="logo u-padding--xs dw-mod"> 269 <a href="/Default.aspx?ID=@firstPageId"> 270 <img class="grid__cell-img" src="@logo" alt="@businessName" /> 271 </a> 272 </div> 273 </div> 274 275 @* Navigation *@ 276 <div class="u-pull--left"> 277 @RenderHeaderNavigation() 278 </div> 279 280 <div class="grid__cell grid__cell--align-middle-right"> 281 <ul class="menu dw-mod u-pull--right"> 282 283 @* Search *@ 284 <li class="menu__item menu__item--horizontal menu__item--top-level u-hidden-xxs dw-mod" onmouseover="document.getElementById('headerSearch').focus()"> 285 <div class="menu__link u-w50px is-dropdown is-dropdown--no-icon dw-mod"> 286 <i class="fa fa-search fa-1_5x"></i> 287 <div class="menu menu--dropdown u-w340px top-micro-search dw-mod"> 288 <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"> 289 <div class="typeahead-search-field"> 290 <input type="text" class="u-no-margin u-full-width js-typeahead-search-field" id="headerSearch" placeholder="@searchPlaceholder" value="@searchValue"> 291 <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> 292 </div> 293 </div> 294 </div> 295 </div> 296 </li> 297 298 @* @RenderSignIn("inNavigation", userInitials) *@ 299 @RenderLanguageSelector() 300 @* @RenderFavorites() 301 @RenderMiniCart() *@ 302 </ul> 303 </div> 304 </div> 305 </div> 306 </nav> 307 break; 308 case "splitted": //4 309 <!-- Header --> 310 <div class="header header-top dw-mod"> 311 <div class="center-container top-container__center-container dw-mod"> 312 <div class="grid"> 313 314 @* Logo *@ 315 <div class="grid__col-md-6 grid__col-sm-6 grid--align-self-center grid__col--bleed-y"> 316 <div class="grid__cell"> 317 <div class="logo u-max-w220px u-margin-top u-margin-bottom dw-mod"> 318 <a href="/Default.aspx?ID=@firstPageId"> 319 <img class="grid__cell-img" src="@logo" alt="@businessName" /> 320 </a> 321 </div> 322 </div> 323 </div> 324 325 @* Search *@ 326 <div class="grid__col-md-6 grid__col-sm-6 grid__col-xs-12 grid--align-self-center grid__col--bleed"> 327 <div class="grid__cell"> 328 <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"> 329 <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> 330 <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> 331 <input type="text" class="typeahead-search-field u-no-margin js-typeahead-search-field" placeholder="@searchPlaceholder" value="@searchValue"> 332 <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> 333 <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> 334 </div> 335 </div> 336 </div> 337 </div> 338 </div> 339 </div> 340 <!-- Main navigation --> 341 <nav class="main-navigation dw-mod"> 342 <div class="center-container top-container__center-container dw-mod"> 343 <div class="grid"> 344 <div class="u-pull--left"> 345 @RenderHeaderNavigation() 346 </div> 347 <div class="grid__cell grid__cell--align-middle-right"> 348 <ul class="menu dw-mod u-pull--right"> 349 @RenderSignIn("inNavigation", userInitials) 350 @RenderLanguageSelector() 351 @RenderFavorites() 352 @if(!onlyPreview) { 353 @RenderMiniCart() 354 } 355 </ul> 356 </div> 357 </div> 358 </div> 359 </nav> 360 361 break; 362 case "normal": //1 363 default: 364 <!-- Header --> 365 <div class="header header-top dw-mod"> 366 <div class="center-container top-container__center-container dw-mod"> 367 <div class="grid"> 368 369 @* Logo *@ 370 <div class="grid__col-md-3 grid__col-sm-3 grid__col-xs-12 grid--align-self-center grid__col--bleed-y"> 371 <div class="logo dw-mod"> 372 <a href="/Default.aspx?ID=@firstPageId"> 373 <img class="grid__cell-img" src="@logo" alt="@businessName" /> 374 </a> 375 </div> 376 </div> 377 378 @* Search *@ 379 <div class="grid__col-md-4 grid__col-sm-4 grid__col-xs-12 grid__col--bleed-y grid--align-self-center"> 380 <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"> 381 <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> 382 <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> 383 <input type="text" class="typeahead-search-field u-no-margin js-typeahead-search-field" placeholder="@searchPlaceholder" value="@searchValue"> 384 <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> 385 <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> 386 </div> 387 </div> 388 389 <div class="grid__col-md-4 grid__col-sm-4 grid__col-xs-12 grid__col--bleed-y grid--align-self-center"> 390 <div class="grid__cell grid__cell--align-middle-right"> 391 <ul class="menu dw-mod u-pull--right"> 392 @RenderSignIn("outsideNavigation", userInitials) 393 @RenderLanguageSelector("outsideNavigation") 394 @RenderFavorites("outsideNavigation") 395 @if(!onlyPreview) { 396 @RenderMiniCart("outsideNavigation") 397 } 398 </ul> 399 </div> 400 </div> 401 </div> 402 </div> 403 </div> 404 405 <!-- Main navigation --> 406 <nav class="main-navigation dw-mod"> 407 <div class="center-container top-container__center-container dw-mod"> 408 <div class="grid"> 409 @RenderHeaderNavigation() 410 </div> 411 </div> 412 </nav> 413 414 break; 415 } 416 } else { 417 string style = (topLayout == "normal" || topLayout == "splitted" ? "main-navigation--top-style" : "main-navigation--nav-style"); 418 <!-- Main navigation --> 419 <nav class="main-navigation dw-mod @style"> 420 <div class="center-container top-container__center-container dw-mod"> 421 <div class="grid"> 422 @MobileNavigationTrigger() 423 424 <div class="logo u-max-w220px u-middle dw-mod"> 425 <a href="/Default.aspx?ID=@firstPageId"> 426 <img class="grid__cell-img u-w-100prc" src="@logo" alt="@businessName" /> 427 </a> 428 </div> 429 430 @if(!onlyPreview) { 431 <ul class="menu dw-mod u-pull--right"> 432 @RenderMiniCart() 433 </ul> 434 } 435 </div> 436 </div> 437 </nav> 438 439 @* Mobile search *@ 440 <div class="u-padding"> 441 <div class="js-typeahead" data-page-size="10" id="MobileProductSearch" data-search-page-id="@productsSearchFeedId&feed=true" data-result-page-id="@productsPageId"> 442 <input type="text" class="u-full-width js-typeahead-search-field u-no-margin" placeholder="@searchPlaceholder" value="@searchValue"> 443 <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> 444 </div> 445 </div> 446 } 447 448 @* Impersonation bar *@ 449 @if(Model.CurrentUser.ID > 0 && Model.SecondaryUsers.Count > 0) { 450 <div class="u-color-warning--bg"> 451 <div class="center-container top-container__center-container dw-mod"> 452 @*Impersonation*@ 453 <div class="grid"> 454 <div class="grid--align-self-center grid__col-x"> 455 @if(Model.CurrentSecondaryUser != null && Model.CurrentSecondaryUser.ID > 0) { 456 string stopImpersonateTranslation = Translate("Stop impersonation"); 457 string username = ""; 458 if(!string.IsNullOrEmpty(Model.CurrentSecondaryUser.FirstName) && !string.IsNullOrEmpty(Model.CurrentSecondaryUser.LastName)) { 459 username = Model.CurrentSecondaryUser.FirstName + " " + Model.CurrentSecondaryUser.LastName; 460 } else if(!string.IsNullOrEmpty(Model.CurrentSecondaryUser.Name)) { 461 username = Model.CurrentSecondaryUser.Name; 462 } else if(!string.IsNullOrEmpty(Model.CurrentSecondaryUser.Email)) { 463 username = Model.CurrentSecondaryUser.Email; 464 } else { 465 username = Model.CurrentSecondaryUser.UserName; 466 } 467 <div class="grid-cell"> 468 <div class="u-pull--left u-bold u-margin-top"> 469 <i class="fa fa-user-secret"></i> 470 @username<text>&nbsp;</text>@Translate("is impersonated by")<text>&nbsp;</text>@Pageview.User.UserName 471 </div> 472 <form method="post" class="u-pull--right u-no-margin"> 473 <input type="submit" class="btn btn--secondary dw-mod u-no-margin" name="DwExtranetRemoveSecondaryUser" value="@stopImpersonateTranslation"> 474 </form> 475 </div> 476 } else { 477 string viewListTranslation = Translate("View the list of users you can impersonate"); 478 <div class="grid-cell u-bold"> 479 <i class="fa fa-user-secret"></i> 480 <a href="/Default.aspx?ID=@impersonationPageId" title="@viewListTranslation" class="u-color-font-black">@viewListTranslation</a> 481 </div> 482 } 483 </div> 484 </div> 485 </div> 486 </div> 487 } 488 </header> 489 490 <!-- Floating mini cart --> 491 @if(!onlyPreview && !stickyMenu && pageId == productsPageId && Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") { 492 <div class="floating-mini-cart u-hidden dw-mod" id="FloatingMiniCart"> 493 <div class="mini-cart dw-mod"> 494 <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')"> 495 <i class="fa fa-shopping-cart fa-4x"></i> 496 <div class="mini-cart__counter mini-cart__counter--lg dw-mod"> 497 <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"> 498 <div class="js-mini-cart-counter-content"> 499 @Model.Cart.TotalProductsCount 500 </div> 501 </div> 502 </div> 503 </a> 504 505 <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> 506 </div> 507 </div> 508 } 509 510 <!-- Render the content --> 511 <div id="Page" class="page @pagePos"> 512 <section class="center-container content-container dw-mod" id="content"> 513 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 514 515 516 @if (Model.PropertyItem.GetList("ShowBreadcrumb").SelectedValue == "True") 517 { 518 <div class="grid__col-12 grid__col--bleed-y"> 519 @RenderNavigation(new 520 { 521 id = "breadcrumb", 522 template = "Breadcrumb.xslt" 523 }) 524 </div> 525 } 526 527 <div class="grid"> 528 @if (Model.PropertyItem.GetList("LeftMenu").SelectedValue == "True") 529 { 530 var navigationMarkup = RenderNavigation(new 531 { 532 id = "leftnav", 533 cssclass = "menu dwnavigation", 534 startLevel = 2, 535 endlevel = 5, 536 template = "LeftNavigation.xslt" 537 }); 538 if (!string.IsNullOrEmpty(navigationMarkup)) 539 { 540 <nav class="grid__col-md-3 grid__col-sm-12 grid__col-xs-12"> 541 <div class="grid"> 542 <div class="grid__col-12"> 543 <div class="grid__cell"> 544 @navigationMarkup 545 </div> 546 </div> 547 </div> 548 </nav> 549 } 550 } 551 <div class="grid__col-auto grid__col--bleed"> 552 <div class="grid"> 553 @* Divs count is equal divs in ParagraphContainer.cshtml *@ 554 @Model.Placeholder("dwcontent", "content", "default:true;sort:1") 555 </div> 556 </div> 557 </div> 558 </section> 559 </div> 560 </main> 561 562 @RenderFooter() 563 564 565 <!-- Content rendering helpers --> 566 567 @helper MobileNavigation(string userInitials) { 568 int pageId = Model.TopPage.ID; 569 string mobileNavigationLevels = Model.Area.Item.GetBoolean("MobileNavigationLevels") ? Model.Area.Item.GetString("MobileNavigationLevels") : "3"; 570 571 bool showCreateAccountLink = Model.Area.Item.GetBoolean("ShowCreateAccountLink"); 572 573 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 574 int cartFeedPageId = GetPageIdByNavigationTag("CartOrderlinesFeed"); 575 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 576 577 string myProfilePageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerProfile").ToString() : GetPageIdByNavigationTag("CustomerProfile").ToString(); 578 string myOrdersPageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerOrders").ToString() : GetPageIdByNavigationTag("CustomerOrders").ToString(); 579 string myFavoritesPageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerFavorites").ToString() : GetPageIdByNavigationTag("CustomerFavorites").ToString(); 580 bool showMyProfileLink = Model.Area.Item.GetBoolean("ShowMyProfileLink"); 581 bool showMyOrdersLink = Model.Area.Item.GetBoolean("ShowMyOrdersLink"); 582 bool showMyFavoritesLink = Model.Area.Item.GetBoolean("ShowMyFavoritesLink"); 583 584 bool renderPagesInToolBar = Model.Area.Item.GetBoolean("RenderPagesInToolBar"); 585 int startLevel = renderPagesInToolBar ? 1 : 0; 586 587 bool onlyPreview = Model.Area.Item.GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 588 589 if(Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") { 590 <!-- Trigger for mobile navigation --> 591 <input type="checkbox" id="MobileNavTrigger" class="mobile-nav-trigger" /> 592 593 <!-- Mobile navigation --> 594 <nav class="mobile-navigation dw-mod"> 595 @if(Model.CurrentUser.ID > 0) { 596 string userName = Model.CurrentUser.FirstName != null ? Model.CurrentUser.FirstName : ""; 597 userName += " " + Model.CurrentUser.LastName != null ? Model.CurrentUser.LastName : ""; 598 userName += userName == "" && Model.CurrentUser.UserName != null ? Model.CurrentUser.UserName : ""; 599 600 <ul class="menu menu-mobile"> 601 <li class="menu-mobile__item"> 602 <a href="/default.aspx?ID=@myProfilePageId" class="menu-mobile__link dw-mod"><i class="fa fa-user menu-mobile__link-icon"></i> @userName</a> 603 </li> 604 </ul> 605 } 606 607 @RenderNavigation(new 608 { 609 id = "mobilenavigation", 610 cssclass = "menu menu-mobile dwnavigation", 611 startLevel = @startLevel, 612 ecomStartLevel = @startLevel+1, 613 endlevel = @mobileNavigationLevels, 614 expandmode = "all", 615 template = "BaseMenuForMobile.xslt" 616 }) 617 618 @if(Model.Area.Item.GetBoolean("RenderPagesInToolBar")) { 619 @RenderNavigation(new 620 { 621 id = "topToolsMobileNavigation", 622 cssclass = "menu menu-mobile dwnavigation", 623 template = "ToolsMenuForMobile.xslt" 624 }) 625 } 626 627 <ul class="menu menu-mobile"> 628 @if(Model.CurrentUser.ID <= 0) { 629 @* 630 <li class="menu-mobile__item"> 631 <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> 632 </li> 633 if (showCreateAccountLink) 634 { 635 <li class="menu-mobile__item"> 636 <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> 637 </li> 638 } 639 *@ 640 } else { 641 if(showMyProfileLink) { 642 <li class="menu-mobile__item"> 643 <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> 644 </li> 645 } 646 if(showMyOrdersLink) { 647 <li class="menu-mobile__item"> 648 <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> 649 </li> 650 } 651 if(showMyFavoritesLink) { 652 <li class="menu-mobile__item"> 653 <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> 654 </li> 655 } 656 <li class="menu-mobile__item"> 657 <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> 658 </li> 659 } 660 661 662 @if(Dynamicweb.Services.Areas.GetAreas().Count > 1 && Dynamicweb.Context.Current.Request.QueryString.Get("asd") == "asd") { 663 string selectedLanguage = Pageview.Area.CultureInfo.DisplayName.Split('(')[0].Trim(); 664 665 <li class="menu-mobile__item dw-mod"> 666 <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> 667 <input id="MobileMenuCheck_Language" type="checkbox" class="expand-trigger"> 668 <label for="MobileMenuCheck_Language" class="menu-mobile__trigger"></label> 669 <ul class="menu-mobile menu-mobile__submenu expand-menu"> 670 @foreach(var area in Dynamicweb.Services.Areas.GetAreas()) { 671 string languageName = Translate(area.CultureInfo.DisplayName.Split('(')[0].Trim()); 672 <li class="menu-mobile__item dw-mod"> 673 <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> 674 </li> 675 } 676 </ul> 677 </li> 678 } 679 </ul> 680 </nav> 681 <label class="mobile-nav-trigger-off" for="MobileNavTrigger"></label> 682 683 if(!onlyPreview) { 684 <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> 685 } 686 } 687 } 688 689 @helper LoginModal() { 690 int pageId = Model.TopPage.ID; 691 string topLayout = Model.Area.Item.GetList("LayoutTop").SelectedValue; 692 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 693 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 694 string forgotPasswordPageId = signInProfilePageId.ToString() + "&LoginAction=Recovery"; 695 string userSignedInError = !Model.LogOnFailed ? "" : "checked"; 696 string userSignedInErrorText = ""; 697 698 if(Model.LogOnFailed) { 699 switch(Model.LogOnFailedReason) { 700 case Dynamicweb.Security.UserManagement.LogOnFailedReason.PasswordLengthInvalid: 701 userSignedInErrorText = Translate("Password length is invalid"); 702 break; 703 case Dynamicweb.Security.UserManagement.LogOnFailedReason.IncorrectLogin: 704 userSignedInErrorText = Translate("Invalid email or password"); 705 break; 706 case Dynamicweb.Security.UserManagement.LogOnFailedReason.ExceededFailedLogOnLimit: 707 userSignedInErrorText = Translate("You have exceeded the limit of allowed login attempts. The user account is temporarily locked"); 708 break; 709 case Dynamicweb.Security.UserManagement.LogOnFailedReason.LoginLocked: 710 userSignedInErrorText = Translate("The user account is temporarily locked"); 711 break; 712 case Dynamicweb.Security.UserManagement.LogOnFailedReason.PasswordExpired: 713 userSignedInErrorText = Translate("The password has expired and needs to be renewed"); 714 break; 715 default: 716 userSignedInErrorText = Translate("An unknown error occured"); 717 break; 718 } 719 } 720 721 <!-- Trigger for the login modal --> 722 <input type="checkbox" id="SignInModalTrigger" class="modal-trigger @topLayout" @userSignedInError /> 723 724 <!-- Login modal --> 725 <div class="modal-container"> 726 <label for="SignInModalTrigger" id="SignInModalOverlay" class="modal-overlay"></label> 727 <div class="modal modal--xs" id="SignInModal"> 728 <div class="modal__header"> 729 <h2>@Translate("Sign in")</h2> 730 </div> 731 <div class="modal__body"> 732 <form method="post" id="LoginForm" class="u-no-margin"> 733 <input type="hidden" name="ID" value="@pageId" /> 734 <input type="hidden" name="DWExtranetUsernameRemember" value="True" /> 735 <input type="hidden" name="DWExtranetPasswordRemember" value="True" /> 736 <input type="text" class="u-full-width" id="LoginUsername" name="username" placeholder="@Translate("Email")" /> 737 <input type="password" class="u-full-width" id="LoginPassword" name="password" placeholder="@Translate("Password")" /> 738 <div class="field-error dw-mod">@userSignedInErrorText</div> 739 740 <label> 741 <input type="checkbox" id="RememberMe" name="Autologin" checked="checked" value="True"> 742 <span>@Translate("Remember me", "Remember me")</span> 743 </label> 744 745 <button type="submit" class="btn btn--primary btn--full dw-mod" name="LoginAction" value="Login" onclick="Buttons.LockButton(event)">@Translate("Sign in")</button> 746 747 <a class="btn btn--link-clean dw-mod" href="/Default.aspx?id=@forgotPasswordPageId">@Translate("Forgot your password?", "Forgot your password?")</a> 748 749 <a class="btn btn--link-clean dw-mod" href="/default.aspx?ID=@createAccountPageId">@Translate("Create account")?</a> 750 </form> 751 </div> 752 </div> 753 </div> 754 } 755 756 @helper RenderHeaderNavigation() { 757 bool megaMenu = Model.Area.Item.GetList("NavigationMegaMenu").SelectedValue.ToLower() == "true" ? true : false; 758 string megamenuPromotionImage = Model.Area.Item.GetFile("NavigationMegamenuPromotionImage") != null ? Model.Area.Item.GetFile("NavigationMegamenuPromotionImage").Path : ""; 759 bool renderPagesInToolBar = Model.Area.Item.GetBoolean("RenderPagesInToolBar"); 760 int startLevel = renderPagesInToolBar ? 1 : 0; 761 762 763 if(Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") { 764 if(!megaMenu) { 765 if(Model.Area.ID == 10) { 766 767 <ul class="menu dw-mod dwnavigation" id="topnavigation"> 768 @foreach(var page in Dynamicweb.Services.Pages.GetPagesByParentID(725)) { 769 if(page.ID == 753) { 770 <li class="menu__item dw-mod menu__item--horizontal menu__item--top-level dw-navbar-button is-dropdown menu__item--disabled"> 771 <span class="menu__link dw-mod">@page.MenuText</span> 772 <ul class="menu menu--dropdown dw-mod"> 773 @foreach(var i in Dynamicweb.Ecommerce.Services.ProductGroups.GetGroups("LANG2").Where(x => x.ProductCount > 0).OrderBy(x => x.Name)) { 774 775 string urlToParse = "Default.aspx?ID=725&GroupID="+i.IdUrlEncoded; 776 string groupHref = Dynamicweb.SystemTools.UrlParser.GetFullHrefString(urlToParse); 777 <li class="menu__item dw-mod menu__item--fixed-width"> 778 <a class=" menu-dropdown__link dw-mod" href="@groupHref">@i.Name</a> 779 </li> 780 } 781 </ul> 782 </li> 783 } else { 784 <li class="menu__item dw-mod menu__item--horizontal menu__item--top-level dw-navbar-button"> 785 <a class="menu__link dw-mod" href="/Default.aspx?ID=@page.ID">@page.MenuText</a> 786 </li> 787 } 788 } 789 </ul> 790 791 } else { 792 @RenderNavigation(new 793 { 794 id = "topnavigation", 795 cssclass = "menu dw-mod dwnavigation", 796 startLevel = @startLevel, 797 ecomStartLevel = @startLevel+1, 798 endlevel = 5, 799 expandmode="all", 800 template = "BaseMenuWithDropdown.xslt" 801 }); 802 } 803 804 } else { 805 @RenderNavigation(new 806 { 807 id = "topnavigation", 808 cssclass = "menu dw-mod dwnavigation", 809 startLevel = @startLevel, 810 ecomStartLevel = @startLevel+1, 811 endlevel = 5, 812 promotionImage = megamenuPromotionImage, 813 promotionLink = Model.Area.Item.GetString("NavigationMegamenuPromotionLink"), 814 expandmode = "all", 815 template = "BaseMegaMenu.xslt" 816 }); 817 } 818 } 819 } 820 821 @helper MobileNavigationTrigger() { 822 @* Mobile navigation trigger *@ 823 824 if(Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") { 825 <div class="menu dw-mod u-pull--left"> 826 <div class="menu__item menu__item--horizontal menu__item--top-level dw-mod"> 827 <label for="MobileNavTrigger" class="mobile-nav-trigger-button menu__link dw-mod"></label> 828 </div> 829 </div> 830 } 831 } 832 833 @helper RenderLanguageSelector(string type = "inNavigation") { 834 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"; 835 string menuLinkClass = type == "inNavigation" ? "menu__link" : "header-menu__link"; 836 837 @* Language selector *@ 838 839 840 if(Dynamicweb.Services.Areas.GetAreas().Count > 1 && Dynamicweb.Context.Current.Request.QueryString.Get("asd") == "asd") { 841 <li class="@liClasses"> 842 <div class="@menuLinkClass u-w40px is-dropdown is-dropdown--no-icon dw-mod"> 843 <i class="fa fa-globe fa-1_5x"></i> 844 <div class="menu menu--dropdown u-w100px dw-mod"> 845 @foreach(var area in Dynamicweb.Services.Areas.GetAreas()) { 846 string languageName = Translate(area.CultureInfo.DisplayName.Split('(')[0].Trim()); 847 <a href="/Default.aspx?ID=@(Dynamicweb.Services.Pages.GetFirstPageForArea(area.ID).ID)" class="menu-dropdown__item menu-dropdown__item--link dw-mod">@languageName</a> 848 } 849 </div> 850 </div> 851 </li> 852 } 853 } 854 855 @helper RenderMiniCart(string type = "inNavigation") { 856 string liClasses = type == "inNavigation" ? "menu__item menu__item--horizontal menu__item--top-level dw-mod" : "menu__item menu__item--horizontal menu--clean dw-mod"; 857 string menuLinkClass = type == "inNavigation" ? "menu__link" : "header-menu__link"; 858 859 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 860 int cartFeedPageId = GetPageIdByNavigationTag("CartOrderlinesFeed"); 861 int cartPageId = GetPageIdByNavigationTag("CartPage"); 862 double cartProductsCount = Model.Cart.TotalProductsCount; 863 864 @* Mini cart *@ 865 <li class="@liClasses"> 866 <div class="mini-cart dw-mod"> 867 <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')"> 868 <i class="fa fa-shopping-cart fa-1_5x"></i> 869 <div class="mini-cart__counter mini-cart__counter--inline dw-mod"> 870 <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"> 871 <div class="js-mini-cart-counter-content"> 872 @cartProductsCount 873 </div> 874 </div> 875 </div> 876 </a> 877 @if(Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") { 878 <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> 879 } 880 </div> 881 </li> 882 } 883 884 @helper RenderSignIn(string type = "inNavigation", string userInitials = "") { 885 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"; 886 string menuLinkClass = type == "inNavigation" ? "menu__link" : "header-menu__link"; 887 888 int pageId = Model.TopPage.ID; 889 string myProfilePageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerProfile").ToString() : GetPageIdByNavigationTag("CustomerProfile").ToString(); 890 string myOrdersPageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerOrders").ToString() : GetPageIdByNavigationTag("CustomerOrders").ToString(); 891 int myDashboardPageId = GetPageIdByNavigationTag("CustomerDashboard"); 892 string myFavoritesPageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerFavorites").ToString() : GetPageIdByNavigationTag("CustomerFavorites").ToString(); 893 string mySavedCardsPageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("SavedCards").ToString() : GetPageIdByNavigationTag("SavedCards").ToString(); 894 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 895 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 896 string forgotPasswordPageId = signInProfilePageId.ToString() + "&LoginAction=Recovery"; 897 898 bool showCreateAccountLink = Model.Area.Item.GetBoolean("ShowCreateAccountLink"); 899 bool showMyProfileLink = Model.Area.Item.GetBoolean("ShowMyProfileLink"); 900 bool showMyOrdersLink = Model.Area.Item.GetBoolean("ShowMyOrdersLink"); 901 bool showMyFavoritesLink = Model.Area.Item.GetBoolean("ShowMyFavoritesLink"); 902 bool showMySavedCardsLink = Model.Area.Item.GetBoolean("ShowMySavedCardsLink"); 903 904 @* Sign in + Customer center links *@ 905 <li class="@liClasses"> 906 <div class="@menuLinkClass is-dropdown is-dropdown--no-icon u-w40px dw-mod"> 907 @if(Model.CurrentUser.ID <= 0) { 908 <i class="fa fa-user fa-1_5x"></i> 909 } else { 910 <a href="/default.aspx?ID=@myDashboardPageId" class="u-color-inherit"><div class="circle-icon-btn">@userInitials.ToUpper()</div></a> 911 } 912 913 <div class="menu menu--dropdown sign-in-dropdown dw-mod"> 914 <ul class="list list--clean dw-mod"> 915 @if(Model.CurrentUser.ID <= 0) { 916 <li> 917 <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> 918 </li> 919 if(showCreateAccountLink) { 920 <li> 921 <a href="/default.aspx?ID=@createAccountPageId" class="list__link dw-mod">@Translate("Create account")</a> 922 </li> 923 } 924 <li> 925 <a href="/default.aspx?ID=@forgotPasswordPageId" class="list__link dw-mod">@Translate("Forgot your password?")</a> 926 </li> 927 if(showMyProfileLink || showMyOrdersLink || showMyFavoritesLink || showMySavedCardsLink) { 928 <li class="list__seperator dw-mod"></li> 929 } 930 } 931 @if(showMyProfileLink) { 932 <li> 933 <a href="/default.aspx?ID=@myProfilePageId" class="list__link dw-mod"><i class="fa fa-user"></i> @Translate("My Profile")</a> 934 </li> 935 } 936 @if(showMyOrdersLink) { 937 <li> 938 <a href="/default.aspx?ID=@myOrdersPageId" class="list__link dw-mod"><i class="fa fa-list"></i> @Translate("My Orders")</a> 939 </li> 940 } 941 @if(showMyFavoritesLink) { 942 <li> 943 <a href="/default.aspx?ID=@myFavoritesPageId" class="list__link dw-mod"><i class="fa fa-star"></i> @Translate("My Favorites")</a> 944 </li> 945 } 946 @if(showMySavedCardsLink) { 947 <li> 948 <a href="/default.aspx?ID=@mySavedCardsPageId" class="list__link dw-mod"><i class="fa fa-credit-card"></i> @Translate("My Saved cards")</a> 949 </li> 950 } 951 @if(Model.CurrentUser.ID > 0) { 952 if(showMyProfileLink || showMyOrdersLink || showMyFavoritesLink || showMySavedCardsLink) { 953 <li class="list__seperator dw-mod"></li> 954 } 955 <li> 956 <a href="/Admin/Public/ExtranetLogoff.aspx?ID=@pageId" class="list__link dw-mod">@Translate("Sign out")</a> 957 </li> 958 } 959 </ul> 960 </div> 961 </div> 962 </li> 963 } 964 965 @helper RenderFavorites(string type = "inNavigation") { 966 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"; 967 string menuLinkClass = type == "inNavigation" ? "menu__link" : "header-menu__link"; 968 969 string myFavoritesPageId = GetPageIdByNavigationTag("CustomerFavorites").ToString(); 970 971 @* Favorites *@ 972 if(Model.CurrentUser.ID > 0) { 973 <li class="@liClasses"> 974 <a href="/Default.aspx?ID=@myFavoritesPageId" class="@menuLinkClass dw-mod"> 975 <i class="fa fa-star fa-1_5x"></i> 976 </a> 977 </li> 978 } 979 } 980 981 982 @helper RenderFooter() { 983 string footerColumnOneContent = !string.IsNullOrEmpty(Model.Area.Item.GetString("FooterColumnOne")) ? Model.Area.Item.GetString("FooterColumnOne") : ""; 984 string footerColumnTwoContent = !string.IsNullOrEmpty(Model.Area.Item.GetString("FooterColumnTwo")) ? Model.Area.Item.GetString("FooterColumnTwo") : ""; 985 string footerColumnThreeContent = !string.IsNullOrEmpty(Model.Area.Item.GetString("FooterColumnThree")) ? Model.Area.Item.GetString("FooterColumnThree") : ""; 986 string footerColumnOneHeader = Model.Area.Item.GetString("FooterColumnOneHeader"); 987 string footerColumnTwoHeader = Model.Area.Item.GetString("FooterColumnTwoHeader"); 988 string footerColumnThreeHeader = Model.Area.Item.GetString("FooterColumnThreeHeader"); 989 int newsletterSignUpPageId = GetPageIdByNavigationTag("NewsletterSignUp"); 990 991 <!-- Footer section --> 992 <footer class="footer dw-mod"> 993 <div class="center-container top-container__center-container dw-mod"> 994 <div class="grid"> 995 @if(!string.IsNullOrEmpty(footerColumnOneContent) || !string.IsNullOrEmpty(footerColumnOneHeader)) { 996 <div class="grid__col-md-auto"> 997 <h4 class="footer__heading dw-mod">@footerColumnOneHeader</h4> 998 <div class="footer__content dw-mod"> 999 @footerColumnOneContent 1000 </div> 1001 </div> 1002 } 1003 @if(!string.IsNullOrEmpty(footerColumnTwoContent) || !string.IsNullOrEmpty(footerColumnTwoHeader)) { 1004 <div class="grid__col-md-auto"> 1005 <h4 class="footer__heading dw-mod">@footerColumnTwoHeader</h4> 1006 <div class="footer__content dw-mod"> 1007 @footerColumnTwoContent 1008 </div> 1009 </div> 1010 } 1011 @if(!string.IsNullOrEmpty(footerColumnThreeContent) || !string.IsNullOrEmpty(footerColumnThreeHeader)) { 1012 <div class="grid__col-md-auto"> 1013 <h4 class="footer__heading dw-mod">@footerColumnThreeHeader</h4> 1014 <div class="footer__content dw-mod"> 1015 @footerColumnThreeContent 1016 </div> 1017 </div> 1018 } 1019 @if(Model.Area.Item.GetBoolean("FooterNewsletterSignUp")) { 1020 <div class="grid__col-md-auto"> 1021 <h4 class="footer__heading dw-mod">@Translate("Mailing list", "Mailing list")</h4> 1022 <div class="footer__content dw-mod"> 1023 <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> 1024 <form class="form dw-mod" name="NewsletterRedirect" action='/Default.aspx' method="get" enctype="multipart/form-data"> 1025 <input name="ID" id="ID" value="@newsletterSignUpPageId" type="hidden" /> 1026 <div class="form__field-combi"> 1027 <input name="NewsletterEmail" id="NewsletterEmail" type="text" placeholder='@Translate("Your email address", "Your email address")' /> 1028 <input class="btn btn--primary btn--condensed dw-mod" type="submit" id="Submitter" value='@Translate("Go", "Go")' /> 1029 </div> 1030 </form> 1031 </div> 1032 </div> 1033 } 1034 @if(Model.Area.Item.GetItems("FooterSocialLinks").Count > 0) { 1035 <div class="grid__col-md-auto"> 1036 <h4 class="footer__heading dw-mod">@Translate("Social links", "Social links")</h4> 1037 <div class="footer__content dw-mod"> 1038 <div class="collection dw-mod"> 1039 @foreach(var socialitem in Model.Area.Item.GetItems("FooterSocialLinks")) { 1040 //Fields.FirstOrDefault(x => x.SystemName == "Icon").GetString() 1041 var socialIcon = socialitem.GetValue("Icon") as Dynamicweb.Frontend.ListViewModel; 1042 string socialIconClass = socialIcon.SelectedValue; 1043 string socialIconTitle = socialIcon.SelectedName; 1044 string socialLink = socialitem.GetString("Link"); 1045 1046 <a href="@socialLink" target="_blank" title="@socialIconTitle"><i class="fa @socialIconClass fa-2x"></i></a> 1047 } 1048 </div> 1049 </div> 1050 </div> 1051 } 1052 <div class="grid__col-12 footer__copyright dw-mod"> 1053 <p>@Model.Area.Item.GetString("FooterCopyrightText")</p> 1054 </div> 1055 </div> 1056 </div> 1057 </footer> 1058 } 1059 1060 1061 @* Templates for Typeahead *@ 1062 <script id="SearchGroupsTemplate" type="text/x-template"> 1063 {{#.}} 1064 <li class="dropdown__item dw-mod" onclick="Search.UpdateGroupSelection(this)" data-group-id="{{id}}">{{name}}</li> 1065 {{/.}} 1066 </script> 1067 1068 <script id="SearchContentTemplate" type="text/x-template"> 1069 {{#each .}} 1070 {{#Product}} 1071 {{#ifCond template "!==" "SearchMore"}} 1072 <li class="dropdown__item dropdown__item--seperator dw-mod"> 1073 <div> 1074 <a href="{{link}}" class="js-typeahead-link u-color-inherit u-pull--left"> 1075 <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> 1076 <div class="u-pull--left"> 1077 <div class="u-bold u-max-w220px u-truncate-text js-typeahead-name">{{name}}</div> 1078 @if(!onlyPreview) { 1079 <div class="{{onlyPreview}}">{{price}}</div> 1080 } 1081 </div> 1082 </a> 1083 <div class="u-margin-left u-pull--right u-w80px u-hidden"> 1084 <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> 1085 <a href="{{link}}" class="btn btn--secondary btn--condensed btn--full u-no-margin dw-mod {{hideViewMore}} js-ignore-click-outside">@Translate("View")</a> 1086 </div> 1087 </div> 1088 </li> 1089 {{/ifCond}} 1090 {{#ifCond template "===" "SearchMore"}} 1091 {{>SearchMore}} 1092 {{/ifCond}} 1093 {{/Product}} 1094 {{else}} 1095 <li class="dropdown__item dropdown__item--seperator dw-mod"> 1096 @Translate("No products found") 1097 </li> 1098 {{/each}} 1099 </script> 1100 1101 <script id="SearchMore" type="text/x-template"> 1102 <li class="dropdown__item dropdown__item--not-selectable dw-mod"> 1103 <a href="/Default.aspx?ID=@productsPageId&Search={{searchParameter}}&GroupID={{groupId}}" class="btn btn--primary btn--full u-no-margin dw-mod js-typeahead-link"> 1104 @Translate("View all") 1105 </a> 1106 </li> 1107 </script> 1108 1109 @* Templates for the mini cart *@ 1110 <script id="MiniCartCounterContent" type="text/x-template"> 1111 {{#.}} 1112 <div class="js-mini-cart-counter-content dw-mod"> 1113 {{numberofproducts}} 1114 </div> 1115 {{/.}} 1116 </script> 1117 1118 <script id="MiniCartContent" type="text/x-template"> 1119 {{#.}} 1120 <div class="mini-cart-dropdown__inner {{isempty}} dw-mod"> 1121 <h4 class="u-ta-center u-no-margin u-margin-bottom u-margin-top">@Translate("Shopping cart")</h4> 1122 <div class="mini-cart-dropdown__body dw-mod"> 1123 <table class="table mini-cart-table dw-mod"> 1124 <thead> 1125 <tr> 1126 <td>&nbsp;</td> 1127 <td>@Translate("Product")</td> 1128 <td class="u-ta-right">@Translate("Qty")</td> 1129 <td class="u-ta-right" width="120">@Translate("Price")</td> 1130 </tr> 1131 </thead> 1132 1133 {{#OrderLines}} 1134 {{#ifCond template "===" "CartOrderline"}} 1135 {{>MiniCartOrderline}} 1136 {{/ifCond}} 1137 {{#ifCond template "===" "CartOrderlineMobile"}} 1138 {{>MiniCartOrderlineMobile}} 1139 {{/ifCond}} 1140 {{#ifCond template "===" "CartOrderlineDiscount"}} 1141 {{>MiniCartOrderlineDiscount}} 1142 {{/ifCond}} 1143 {{/OrderLines}} 1144 1145 <tr> 1146 <td><i class="fa fa-credit-card"></i></td> 1147 <td>{{paymentmethod}}</td> 1148 <td colspan="2" class="u-ta-right" width="130">{{paymentfee}}</td> 1149 </tr> 1150 <tr> 1151 <td><i class="fa fa-truck"></i></td> 1152 <td>{{shippingmethod}}</td> 1153 <td colspan="2" class="u-ta-right" width="130">{{shippingfee}}</td> 1154 </tr> 1155 <tr class="mini-cart-totals dw-mod"> 1156 <td colspan="2">@Translate("Total")</td> 1157 <td class="u-ta-right">{{numberofproducts}}</td> 1158 <td class="u-ta-right" width="130">{{totalprice}}</td> 1159 </tr> 1160 </table> 1161 </div> 1162 1163 <table class="table mini-cart-table dw-mod"> 1164 <tr class="mini-cart-orderlines__footer dw-mod"> 1165 <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> 1166 <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> 1167 </tr> 1168 </table> 1169 </div> 1170 {{/.}} 1171 </script> 1172 1173 <script id="MiniCartOrderline" type="text/x-template"> 1174 <tr class="{{isempty}}"> 1175 <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> 1176 <td> 1177 <a href="{{link}}" class="mini-cart-orderlines__name" title="{{name}}">{{name}}</a> 1178 <a href="{{link}}" class="mini-cart-orderlines__name item-number">{{variantname}}</a> 1179 <div class="item-number">{{unitname}}</div> 1180 </td> 1181 <td class="u-ta-right">{{quantity}}</td> 1182 <td class="u-ta-right">{{totalprice}}</td> 1183 </tr> 1184 </script> 1185 1186 <script id="MiniCartOrderlineMobile" type="text/x-template"> 1187 <tr class="{{isempty}}"> 1188 <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> 1189 <td> 1190 <a href="{{link}}" class="mini-cart-orderlines__name">{{name}}</a> 1191 <a href="{{link}}" class="mini-cart-orderlines__name item-number">{{variantname}}</a> 1192 <div class="item-number">{{unitname}}</div> 1193 </td> 1194 <td class="u-ta-right">{{quantity}}</td> 1195 <td class="u-ta-right">{{totalprice}}</td> 1196 </tr> 1197 </script> 1198 1199 <script id="MiniCartOrderlineDiscount" type="text/x-template"> 1200 <tr class="table__row--no-border {{isempty}}"> 1201 <td>&nbsp;</td> 1202 <td><div class="mini-cart-orderlines__name dw-mod">{{name}}</div></td> 1203 <td class="u-ta-right">&nbsp;</td> 1204 <td class="u-ta-right">{{totalprice}}</td> 1205 </tr> 1206 </script> 1207 1208 <!-- Javascript --> 1209 <script src="/Files/Templates/Designs/Rapido/js/handlebars-v4.0.11.js"></script> 1210 <script src="/Files/Templates/Designs/Rapido/js/master.min.js"></script> 1211 1212 @if(Model.Area.Item.GetBoolean("UseCustomJavascript")) { 1213 <script src="/Files/Templates/Designs/Rapido/js/custom.min.js"></script> 1214 } 1215 1216 <script> 1217 Wireframe.Init(@wireframeMode.ToLower()); 1218 </script> 1219 </body> 1220 </html> 1221 1222