Error executing template "Designs/Rapido/_parsed/PageNoEcom.parsed.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_198d7cef5c6f46c49f39c4dc5095ca7d.Execute() in E:\Prod\Files\Templates\Designs\Rapido\_parsed\PageNoEcom.parsed.cshtml:line 389
   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.2 *@ 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=75&amp;image=" + @logo; 21 } 22 bool megaMenu = Model.Area.Item.GetBoolean("NavigationMegaMenu"); 23 bool stickyMenu = Pageview.Device.ToString() == "Mobile" ? false : Model.Area.Item.GetBoolean("NavigationStickyMenu"); 24 string mobileNavigationLevels = Model.Area.Item.GetBoolean("MobileNavigationLevels") ? Model.Area.Item.GetString("MobileNavigationLevels") : "3"; 25 string searchPlaceholder = Translate("Search", "Search"); 26 string userSignedInError = !Model.LogOnFailed ? "" : "checked"; 27 string userSignedInErrorText; 28 29 switch (Model.LogOnFailedReason) 30 { 31 case Dynamicweb.Security.UserManagement.LogOnFailedReason.PasswordLengthInvalid: 32 userSignedInErrorText = Translate("Password length is invalid"); 33 break; 34 case Dynamicweb.Security.UserManagement.LogOnFailedReason.IncorrectLogin: 35 userSignedInErrorText = Translate("Invalid email or password"); 36 break; 37 case Dynamicweb.Security.UserManagement.LogOnFailedReason.ExceededFailedLogOnLimit: 38 userSignedInErrorText = Translate("You have exceeded the limit of allowed login attempts. The user account is temporarily locked"); 39 break; 40 case Dynamicweb.Security.UserManagement.LogOnFailedReason.LoginLocked: 41 userSignedInErrorText = Translate("The user account is temporarily locked"); 42 break; 43 case Dynamicweb.Security.UserManagement.LogOnFailedReason.PasswordExpired: 44 userSignedInErrorText = Translate("The password has expired and needs to be renewed"); 45 break; 46 default: 47 userSignedInErrorText = Translate("An unknown error occured"); 48 break; 49 } 50 string loggedIn = Model.CurrentUser != null ? "true" : "false"; 51 string wireframeMode = Model.Area.Item.GetBoolean("WireframeMode").ToString(); 52 53 //Font settings 54 string navigationFont = Model.Area.Item.GetItem("NavigationFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 55 string mobileNavigationFont = Model.Area.Item.GetItem("MobileNavigationFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 56 string headerFont = Model.Area.Item.GetItem("ContentLayoutHeaderFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 57 string subHeaderFont = Model.Area.Item.GetItem("ContentLayoutSubheaderFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 58 string contentFont = Model.Area.Item.GetItem("ContentLayoutBodyText").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 59 60 //Page IDs for use in the template 61 string firstPageId = Model.Area.FirstActivePage.ID.ToString(); 62 string areaId = Model.Area.ID.ToString(); 63 string autoCssLink = "/Files/Templates/Designs/Rapido/css/rapido/rapido_" + @areaId + ".min.css?ticks=" + Model.Area.UpdatedDate.Ticks; 64 int pageId = Model.TopPage.ID; 65 string newsletterSignUpPageId = GetPageIdByNavigationTag("NewsletterSignUp").ToString(); 66 string searchPageId = ""; 67 68 string stickyTop = stickyMenu ? "top-container--sticky" : ""; 69 string pagePos = stickyMenu ? "js-page-pos" : ""; 70 string topLayout = Model.Area.Item.GetList("LayoutTop").SelectedValue; 71 string megamenuPromotionImage = Model.Area.Item.GetFile("NavigationMegamenuPromotionImage") != null ? Model.Area.Item.GetFile("NavigationMegamenuPromotionImage").Path : ""; 72 bool renderPagesInToolBar = Model.Area.Item.GetBoolean("RenderPagesInToolBar"); 73 string toolbarText = Model.Area.Item.GetString("ToolbarText"); 74 75 string headerButtonText = Model.Area.Item.GetString("HeaderButtonText"); 76 string headerButtonLink = Model.Area.Item.GetString("HeaderButtonLink"); 77 78 string headerButtonType = "btn--link"; 79 } 80 81 @{ 82 string siteURL = Dynamicweb.Context.Current.Request.Url.Scheme + "://" + Dynamicweb.Context.Current.Request.Url.Host; 83 string businessPhotoPath = Model.Area.Item.GetFile("BusinessPhoto") != null ? Model.Area.Item.GetFile("BusinessPhoto").PathUrlEncoded : ""; 84 string businessName = Model.Area.Item.GetString("BusinessName"); 85 var address = Model.Area.Item.GetItem("Address"); 86 string streetAddress = ""; 87 string addressLocality = ""; 88 string addressRegion = ""; 89 string postalCode = ""; 90 string addressCountry = ""; 91 string contactEmail = Model.Area.Item.GetString("ContactEmail"); 92 string contactNumber = Model.Area.Item.GetString("ContactNumber"); 93 94 if (address != null) 95 { 96 streetAddress = address.GetString("StreetAddress"); 97 addressLocality = address.GetString("City"); 98 addressRegion = address.GetString("Region"); 99 postalCode = address.GetString("PostalCode"); 100 addressCountry = address.GetString("Country"); 101 } 102 } 103 104 @{ 105 switch (Model.Area.Item.GetList("HeaderButtonType").SelectedName) 106 { 107 case "Link": 108 headerButtonType = "btn--link"; 109 break; 110 case "Secondary": 111 headerButtonType = "btn--secondary"; 112 break; 113 default: 114 headerButtonType = "btn--primary"; 115 break; 116 } 117 } 118 <!DOCTYPE html> 119 120 <html> 121 <head> 122 <meta charset="utf-8" /> 123 <title>@Model.TopPage.Name</title> 124 <meta name="viewport" content="width=device-width, initial-scale=1"> 125 126 <!-- Favicon --> 127 <link href="@favicon" rel="icon" type="image/png"> 128 129 <!-- Font awesome --> 130 <link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/rapido/font-awesome.min.css" type="text/css"> 131 132 <!-- Base (Default, wireframe) styles --> 133 <link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/base/base.min.css" type="text/css"> 134 135 <!-- Rapido Css from Website Settings --> 136 <link id="rapidoCss" rel="stylesheet" href="@autoCssLink" type="text/css"> 137 138 <!-- Ignite Css (Custom site specific styles) --> 139 <link id="igniteCss" type="text/css" href="/Files/Templates/Designs/Rapido/css/ignite/ignite.min.css" rel="stylesheet"> 140 141 <!-- Google fonts --> 142 @{ 143 var fonts = new string[5] { @navigationFont, @mobileNavigationFont, @headerFont, @subHeaderFont, @contentFont }; 144 var family = string.Join("%7C", fonts.Distinct().Select(x => string.Format("{0}:100,200,300,400,500,600,700,800,900", x))); 145 } 146 <link href="https://fonts.googleapis.com/css?family=@family" rel="stylesheet"> 147 148 @if (!string.IsNullOrEmpty(businessPhotoPath) && 149 !string.IsNullOrEmpty(businessName) && 150 !string.IsNullOrEmpty(streetAddress) && 151 !string.IsNullOrEmpty(addressLocality) && 152 !string.IsNullOrEmpty(addressRegion) && 153 !string.IsNullOrEmpty(postalCode) && 154 !string.IsNullOrEmpty(addressCountry)) 155 { 156 <script type="application/ld+json"> 157 { 158 "@@context": "http://schema.org", 159 "@@type": "Store", 160 "image": [ 161 "@siteURL/Admin/Public/GetImage.ashx?width=400&height=400&crop=0&Compression=75&DoNotUpscale=true&image=@businessPhotoPath", 162 "@siteURL/Admin/Public/GetImage.ashx?width=400&height=300&crop=0&Compression=75&DoNotUpscale=true&image=@businessPhotoPath", 163 "@siteURL/Admin/Public/GetImage.ashx?width=448&height=225&crop=0&Compression=75&DoNotUpscale=true&image=@businessPhotoPath" 164 ], 165 "@@id": "@siteURL", 166 "name": "@businessName", 167 "address": { 168 "@@type": "PostalAddress", 169 "streetAddress": "@streetAddress", 170 "addressLocality": "@addressLocality", 171 "addressRegion": "@addressRegion", 172 "postalCode": "@postalCode", 173 "addressCountry": "@addressCountry" 174 } 175 @if (!string.IsNullOrEmpty(contactEmail)) 176 { 177 <text>,"email": "@Model.Area.Item.GetString("ContactEmail")"</text> 178 } 179 @if (!string.IsNullOrEmpty(contactNumber)) 180 { 181 <text>,"telephone": "@Model.Area.Item.GetString("ContactNumber")"</text> 182 } 183 } 184 </script> 185 } 186 </head> 187 188 <body> 189 @MobileNavigation() 190 191 <main class="site dw-mod"> 192 <header class="top-container @stickyTop" id="Top"> 193 @if (renderPagesInToolBar) 194 { 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 = "topnavigation", 203 cssclass = "menu menu-tools dw-mod dwnavigation", 204 template = "TopMenu.xslt" 205 }) 206 </div> 207 </div> 208 </div> 209 </div> 210 } 211 212 213 @if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 214 { 215 switch (topLayout) 216 { 217 case "condensed": //2 218 <!-- Main navigation --> 219 <nav class="main-navigation dw-mod"> 220 <div class="center-container top-container__center-container dw-mod"> 221 <div class="grid"> 222 223 <div class="grid__col-md-3 grid--align-self-center grid__col--bleed-y"> 224 <div class="logo u-padding--xs dw-mod"> 225 <a href="/Default.aspx?ID=@firstPageId"> 226 <img class="grid__cell-img" src="@logo" alt="@Translate("Logo")" /> 227 </a> 228 </div> 229 </div> 230 231 @* Navigation *@ 232 <div class="u-pull--left"> 233 @RenderHeaderNavigation() 234 </div> 235 236 <div class="grid__cell grid__cell--align-middle-right"> 237 <ul class="menu dw-mod u-pull--right"> 238 @RenderLanguageSelector() 239 </ul> 240 @if (!string.IsNullOrWhiteSpace(headerButtonLink)) { 241 <div class="u-pull--right"><a class="btn @headerButtonType dw-mod u-no-margin u-margin-left" href="@headerButtonLink">@headerButtonText</a></div> 242 } 243 </div> 244 </div> 245 </div> 246 </nav> 247 248 break; 249 case "minimal": //3 250 <!-- Main navigation --> 251 <nav class="main-navigation dw-mod"> 252 <div class="center-container top-container__center-container dw-mod"> 253 <div class="grid"> 254 255 <div class="grid__col-md-3 grid--align-self-center grid__col--bleed-y"> 256 <div class="logo u-padding--xs dw-mod"> 257 <a href="/Default.aspx?ID=@firstPageId"> 258 <img class="grid__cell-img" src="@logo" alt="@Translate("Logo")" /> 259 </a> 260 </div> 261 </div> 262 263 @* Navigation *@ 264 <div class="u-pull--left"> 265 @RenderHeaderNavigation() 266 </div> 267 268 <div class="grid__cell grid__cell--align-middle-right"> 269 <ul class="menu dw-mod u-pull--right"> 270 @RenderLanguageSelector() 271 </ul> 272 @if (!string.IsNullOrWhiteSpace(headerButtonLink)) { 273 <div class="u-pull--right"><a class="btn @headerButtonType dw-mod u-no-margin u-margin-left" href="@headerButtonLink">@headerButtonText</a></div> 274 } 275 </div> 276 </div> 277 </div> 278 </nav> 279 break; 280 case "splitted": //4 281 <!-- Header --> 282 <div class="header header-top dw-mod"> 283 <div class="center-container top-container__center-container dw-mod"> 284 <div class="grid"> 285 286 @* Logo *@ 287 <div class="grid__col-md-6 grid__col-sm-6 grid--align-self-center grid__col--bleed-y"> 288 <div class="grid__cell"> 289 <div class="logo u-max-w220px u-margin-top u-margin-bottom dw-mod"> 290 <a href="/Default.aspx?ID=@firstPageId"> 291 <img class="grid__cell-img" src="@logo" alt="@Translate("Logo")" /> 292 </a> 293 </div> 294 </div> 295 </div> 296 </div> 297 </div> 298 </div> 299 <!-- Main navigation --> 300 <nav class="main-navigation dw-mod"> 301 <div class="center-container top-container__center-container dw-mod"> 302 <div class="grid"> 303 <div class="u-pull--left"> 304 @RenderHeaderNavigation() 305 </div> 306 <div class="grid__cell grid__cell--align-middle-right"> 307 <ul class="menu dw-mod u-pull--right"> 308 @RenderLanguageSelector() 309 </ul> 310 @if (!string.IsNullOrWhiteSpace(headerButtonLink)) { 311 <div class="u-pull--right"><a class="btn @headerButtonType dw-mod u-no-margin u-margin-left" href="@headerButtonLink">@headerButtonText</a></div> 312 } 313 </div> 314 </div> 315 </div> 316 </nav> 317 318 break; 319 case "normal": //1 320 default: 321 <!-- Header --> 322 <div class="header header-top dw-mod"> 323 <div class="center-container top-container__center-container dw-mod"> 324 <div class="grid"> 325 326 @* Logo *@ 327 <div class="grid__col-md-3 grid__col-sm-3 grid__col-xs-12 grid--align-self-center grid__col--bleed-y"> 328 <div class="logo dw-mod"> 329 <a href="/Default.aspx?ID=@firstPageId"> 330 <img class="grid__cell-img" src="@logo" alt="@Translate("Logo")" /> 331 </a> 332 </div> 333 </div> 334 335 <div class="grid__col-md-4 grid__col-sm-4 grid__col-xs-12 grid__col--bleed-y grid--align-self-center"> 336 <div class="grid__cell grid__cell--align-middle-right"> 337 <ul class="menu dw-mod u-pull--right"> 338 @RenderLanguageSelector("outsideNavigation") 339 </ul> 340 341 @if (!string.IsNullOrWhiteSpace(headerButtonLink)) 342 { 343 <div class="u-pull--right"><a class="btn @headerButtonType dw-mod u-no-margin u-margin-left" href="@headerButtonLink">@headerButtonText</a></div> 344 } 345 </div> 346 </div> 347 </div> 348 </div> 349 </div> 350 351 <!-- Main navigation --> 352 <nav class="main-navigation dw-mod"> 353 <div class="center-container top-container__center-container dw-mod"> 354 <div class="grid"> 355 @RenderHeaderNavigation() 356 </div> 357 </div> 358 </nav> 359 360 break; 361 } 362 } 363 else 364 { 365 string style = (topLayout == "normal" || topLayout == "splitted" ? "main-navigation--top-style" : "main-navigation--nav-style"); 366 <!-- Main navigation --> 367 <nav class="main-navigation dw-mod @style"> 368 <div class="center-container top-container__center-container dw-mod"> 369 <div class="grid"> 370 @MobileNavigationTrigger() 371 372 <div class="logo u-max-w220px u-middle dw-mod"> 373 <a href="/Default.aspx?ID=@firstPageId"> 374 <img class="grid__cell-img u-w-100prc" src="@logo" alt="@Translate("Logo")" /> 375 </a> 376 </div> 377 </div> 378 </div> 379 </nav> 380 } 381 </header> 382 383 <!-- Render the content --> 384 <div id="Page" class="page @pagePos"> 385 <section class="center-container content-container dw-mod" id="content"> 386 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 387 388 389 @if (Model.PropertyItem.GetList("ShowBreadcrumb").SelectedValue == "True") 390 { 391 <div class="grid__col-12"> 392 @RenderNavigation(new 393 { 394 id = "breadcrumb", 395 template = "breadcrumb.xslt" 396 }) 397 </div> 398 } 399 400 <div class="grid"> 401 @if (Model.PropertyItem.GetList("LeftMenu").SelectedValue == "True") 402 { 403 var navigationMarkup = RenderNavigation(new 404 { 405 id = "leftnav", 406 cssclass = "menu dwnavigation", 407 startLevel = 2, 408 endlevel = 5, 409 template = "LeftNavigation.xslt" 410 }); 411 if (!string.IsNullOrEmpty(navigationMarkup)) 412 { 413 <nav class="grid__col-md-3 grid__col-sm-12 grid__col-xs-12 paragraph-container"> 414 <div class="grid__cell"> 415 @navigationMarkup 416 </div> 417 </nav> 418 } 419 } 420 <div class="grid__col-auto grid__col--bleed"> 421 <div class="grid"> 422 @Model.Placeholder("dwcontent", "content", "default:true;sort:1") 423 </div> 424 </div> 425 </div> 426 </section> 427 </div> 428 </main> 429 430 <!-- Footer section --> 431 @RenderFooter() 432 433 <!-- Helpers --> 434 @helper RenderLanguageSelector(string type = "inNavigation") 435 { 436 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"; 437 string menuLinkClass = type == "inNavigation" ? "menu__link" : "header-menu__link"; 438 439 @* Language selector *@ 440 if (Model.Languages.Count > 1) 441 { 442 <li class="@liClasses"> 443 <div class="@menuLinkClass u-w40px is-dropdown is-dropdown--no-icon dw-mod"> 444 <i class="fa fa-globe fa-1_5x"></i> 445 <div class="menu menu--dropdown u-w100px dw-mod"> 446 @foreach (var lang in Model.Languages) 447 { 448 <a href="/Default.aspx?ID=@lang.Page.ID&CurrencyCode=@Dynamicweb.Services.Areas.GetArea(lang.ID).EcomCurrencyId" class="menu-dropdown__item menu-dropdown__item--link dw-mod">@lang.Name</a> 449 } 450 </div> 451 </div> 452 </li> 453 } 454 } 455 <!-- Content rendering helpers --> 456 457 @helper MobileNavigation() 458 { 459 int pageId = Model.TopPage.ID; 460 string mobileNavigationLevels = Model.Area.Item.GetBoolean("MobileNavigationLevels") ? Model.Area.Item.GetString("MobileNavigationLevels") : "3"; 461 462 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 463 int cartFeedPageId = GetPageIdByNavigationTag("CartOrderlinesFeed"); 464 465 bool renderPagesInToolBar = Model.Area.Item.GetBoolean("RenderPagesInToolBar"); 466 int startLevel = renderPagesInToolBar ? 1 : 0; 467 468 bool onlyPreview = Model.Area.Item.GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 469 470 if (Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") 471 { 472 <!-- Trigger for mobile navigation --> 473 <input type="checkbox" id="MobileNavTrigger" class="mobile-nav-trigger" /> 474 475 <!-- Mobile navigation --> 476 <nav class="mobile-navigation dw-mod"> 477 478 @RenderNavigation(new 479 { 480 id = "mobilenavigation", 481 cssclass = "menu menu-mobile dwnavigation", 482 startLevel = @startLevel, 483 ecomStartLevel = @startLevel + 1, 484 endlevel = @mobileNavigationLevels, 485 expandmode = "all", 486 template = "BaseMenuForMobile.xslt" 487 }) 488 489 @if (Model.Area.Item.GetBoolean("RenderPagesInToolBar")) 490 { 491 @RenderNavigation(new 492 { 493 id = "topToolsMobileNavigation", 494 cssclass = "menu menu-mobile dwnavigation", 495 template = "ToolsMenuForMobile.xslt" 496 }) 497 } 498 499 <ul class="menu menu-mobile"> 500 @if (Model.Languages.Count > 0) 501 { 502 string selectedLanguage = ""; 503 foreach (var lang in Model.Languages) 504 { 505 if (lang.IsCurrent) 506 { 507 selectedLanguage = lang.Name; 508 } 509 } 510 511 <li class="menu-mobile__item dw-mod"> 512 <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> 513 <input id="MobileMenuCheck_Language" type="checkbox" class="expand-trigger"> 514 <label for="MobileMenuCheck_Language" class="menu-mobile__trigger"></label> 515 <ul class="menu-mobile menu-mobile__submenu expand-menu"> 516 @foreach (var lang in Model.Languages) 517 { 518 <li class="menu-mobile__item dw-mod"> 519 <a class="menu-mobile__link menu-mobile__link--highlighted dw-mod menu-mobile__link--level-1" href="/Default.aspx?ID=@lang.Page.ID&CurrencyCode=@Dynamicweb.Services.Areas.GetArea(lang.ID).EcomCurrencyId">@lang.Name</a> 520 </li> 521 } 522 </ul> 523 </li> 524 } 525 </ul> 526 </nav> 527 <label class="mobile-nav-trigger-off" for="MobileNavTrigger"></label> 528 529 if (!onlyPreview) 530 { 531 <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> 532 } 533 } 534 } 535 536 @helper RenderHeaderNavigation() { 537 bool megaMenu = Model.Area.Item.GetList("NavigationMegaMenu").SelectedValue.ToLower() == "true" ? true : false; 538 string megamenuPromotionImage = Model.Area.Item.GetFile("NavigationMegamenuPromotionImage") != null ? Model.Area.Item.GetFile("NavigationMegamenuPromotionImage").Path : ""; 539 bool renderPagesInToolBar = Model.Area.Item.GetBoolean("RenderPagesInToolBar"); 540 int startLevel = renderPagesInToolBar ? 1 : 0; 541 542 if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 543 { 544 if (!megaMenu) 545 { 546 @RenderNavigation(new 547 { 548 id = "topnavigation", 549 cssclass = "menu dw-mod dwnavigation", 550 startLevel = @startLevel, 551 ecomStartLevel = @startLevel+1, 552 endlevel = 5, 553 expandmode="all", 554 template = "BaseMenuWithDropdown.xslt" 555 }); 556 } 557 else 558 { 559 @RenderNavigation(new 560 { 561 id = "topnavigation", 562 cssclass = "menu dw-mod dwnavigation", 563 startLevel = @startLevel, 564 ecomStartLevel = @startLevel+1, 565 endlevel = 5, 566 promotionImage = megamenuPromotionImage, 567 promotionLink = Model.Area.Item.GetString("NavigationMegamenuPromotionLink"), 568 expandmode="all", 569 template = "BaseMegaMenu.xslt" 570 }); 571 } 572 } 573 } 574 575 @helper MobileNavigationTrigger() { 576 @* Mobile navigation trigger *@ 577 578 if (Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") 579 { 580 <div class="menu dw-mod u-pull--left"> 581 <div class="menu__item menu__item--horizontal menu__item--top-level dw-mod"> 582 <label for="MobileNavTrigger" class="mobile-nav-trigger-button menu__link dw-mod"></label> 583 </div> 584 </div> 585 } 586 } 587 588 @helper RenderFooter() { 589 string footerColumnOneContent = !string.IsNullOrEmpty(Model.Area.Item.GetString("FooterColumnOne")) ? Model.Area.Item.GetString("FooterColumnOne") : ""; 590 string footerColumnTwoContent = !string.IsNullOrEmpty(Model.Area.Item.GetString("FooterColumnTwo")) ? Model.Area.Item.GetString("FooterColumnTwo") : ""; 591 string footerColumnThreeContent = !string.IsNullOrEmpty(Model.Area.Item.GetString("FooterColumnThree")) ? Model.Area.Item.GetString("FooterColumnThree") : ""; 592 string footerColumnOneHeader = Model.Area.Item.GetString("FooterColumnOneHeader"); 593 string footerColumnTwoHeader = Model.Area.Item.GetString("FooterColumnTwoHeader"); 594 string footerColumnThreeHeader = Model.Area.Item.GetString("FooterColumnThreeHeader"); 595 int newsletterSignUpPageId = GetPageIdByNavigationTag("NewsletterSignUp"); 596 597 <!-- Footer section --> 598 <footer class="footer dw-mod"> 599 <div class="center-container top-container__center-container dw-mod"> 600 <div class="grid"> 601 @if (!string.IsNullOrEmpty(footerColumnOneContent) || !string.IsNullOrEmpty(footerColumnOneHeader)) 602 { 603 <div class="grid__col-md-auto"> 604 <h4 class="footer__heading dw-mod">@footerColumnOneHeader</h4> 605 <div class="footer__content dw-mod"> 606 @footerColumnOneContent 607 </div> 608 </div> 609 } 610 @if (!string.IsNullOrEmpty(footerColumnTwoContent) || !string.IsNullOrEmpty(footerColumnTwoHeader)) 611 { 612 <div class="grid__col-md-auto"> 613 <h4 class="footer__heading dw-mod">@footerColumnTwoHeader</h4> 614 <div class="footer__content dw-mod"> 615 @footerColumnTwoContent 616 </div> 617 </div> 618 } 619 @if (!string.IsNullOrEmpty(footerColumnThreeContent) || !string.IsNullOrEmpty(footerColumnThreeHeader)) 620 { 621 <div class="grid__col-md-auto"> 622 <h4 class="footer__heading dw-mod">@footerColumnThreeHeader</h4> 623 <div class="footer__content dw-mod"> 624 @footerColumnThreeContent 625 </div> 626 </div> 627 } 628 @if (Model.Area.Item.GetBoolean("FooterNewsletterSignUp")) 629 { 630 <div class="grid__col-md-auto"> 631 <h4 class="footer__heading dw-mod">@Translate("Mailing list", "Mailing list")</h4> 632 <div class="footer__content dw-mod"> 633 <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> 634 <form class="form dw-mod" name="NewsletterRedirect" action='/Default.aspx' method="get" enctype="multipart/form-data"> 635 <input name="ID" id="ID" value="@newsletterSignUpPageId" type="hidden" /> 636 <div class="form__field-combi"> 637 <input name="NewsletterEmail" id="NewsletterEmail" type="text" placeholder='@Translate("Your email address", "Your email address")' /> 638 <input class="btn btn--primary dw-mod" type="submit" id="Submitter" value='@Translate("Go", "Go")' /> 639 </div> 640 </form> 641 </div> 642 </div> 643 } 644 @if (Model.Area.Item.GetItems("FooterSocialLinks").Count > 0) 645 { 646 <div class="grid__col-md-auto"> 647 <h4 class="footer__heading dw-mod">@Translate("Social links", "Social links")</h4> 648 <div class="footer__content dw-mod"> 649 <div class="collection dw-mod"> 650 @foreach (var socialitem in Model.Area.Item.GetItems("FooterSocialLinks")) 651 { 652 //Fields.FirstOrDefault(x => x.SystemName == "Icon").GetString() 653 var socialIcon = socialitem.GetValue("Icon") as Dynamicweb.Frontend.ListViewModel; 654 string socialIconClass = socialIcon.SelectedValue; 655 string socialIconTitle = socialIcon.SelectedName; 656 string socialLink = socialitem.GetString("Link"); 657 658 <a href="@socialLink" target="_blank" title="@socialIconTitle"><i class="fa @socialIconClass fa-2x"></i></a> 659 } 660 </div> 661 </div> 662 </div> 663 } 664 <div class="grid__col-12 footer__copyright dw-mod"> 665 <p>@Model.Area.Item.GetString("FooterCopyrightText")</p> 666 </div> 667 </div> 668 </div> 669 </footer> 670 } 671 672 <!-- Javascript --> 673 <script src="/Files/Templates/Designs/Rapido/js/handlebars-v4.0.11.js"></script> 674 <script src="/Files/Templates/Designs/Rapido/js/master.min.js"></script> 675 676 <script> 677 Wireframe.Init(@wireframeMode.ToLower()); 678 </script> 679 680 @if (Model.Area.Item.GetBoolean("UseCustomJavascript")) 681 { 682 <script src="/Files/Templates/Designs/Rapido/js/custom.min.js"></script> 683 } 684 </body> 685 </html> 686 687