Error executing template "Designs/Rapido/_parsed/CaseArticle.parsed.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_40b96d0ad4fe4171a01c9287bf76f10c.Execute() in D:\Dynamicweb.net\Solutions\Peritus\ferno.staging.dynamicweb-cms.com\Files\Templates\Designs\Rapido\_parsed\CaseArticle.parsed.cshtml:line 638
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 2 3 @using Dynamicweb.Frontend.Devices 4 @using Dynamicweb.Extensibility 5 @using Dynamicweb.Content 6 @using Dynamicweb.Security 7 8 @using System 9 @using System.Linq 10 @using System.Web 11 @using System.IO 12 13 @{ 14 //General settings 15 string favicon = Model.Area.Item.GetFile("LogoFavicon") != null ? Model.Area.Item.GetFile("LogoFavicon").Path : "/Files/Images/favicon.png"; 16 string logo = Model.Area.Item.GetFile("LogoImage") != null ? Model.Area.Item.GetFile("LogoImage").Path : "/Files/Images/logo-dynamicweb.png"; 17 if (Path.GetExtension(logo).ToLower() != ".svg") 18 { 19 logo = "/Admin/Public/GetImage.ashx?height=40&amp;crop=5&amp;Compression=75&amp;image=" + @logo; 20 } 21 string searchPlaceholder = Translate("Search products", "Search products"); 22 string searchValue = HttpContext.Current.Request.QueryString.Get("Search") != null ? HttpContext.Current.Request.QueryString.Get("Search") : ""; 23 string wireframeMode = Model.Area.Item.GetBoolean("WireframeMode").ToString(); 24 25 26 //bool paymentIncoice = false; 27 //var paymentInvoiceHidden = Dynamicweb.Core.Converter.ToBoolean(customSettings["Payment_Invoice"]); 28 29 //Font settings 30 string navigationFont = Model.Area.Item.GetItem("NavigationFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 31 string mobileNavigationFont = Model.Area.Item.GetItem("MobileNavigationFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 32 string headerFont = Model.Area.Item.GetItem("ContentLayoutHeaderFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 33 string subHeaderFont = Model.Area.Item.GetItem("ContentLayoutSubheaderFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 34 string contentFont = Model.Area.Item.GetItem("ContentLayoutBodyText").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 productSearchPageId = GetPageIdByNavigationTag("ProductSearchFeed"); 44 int productGroupsPageId = GetPageIdByNavigationTag("ProductGroupsFeed"); 45 46 int impersonationPageId = GetPageIdByNavigationTag("Impersonation"); 47 48 bool stickyMenu = Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet" ? false : Model.Area.Item.GetBoolean("NavigationStickyMenu"); 49 string stickyTop = stickyMenu ? "top-container--sticky" : ""; 50 string pagePos = stickyMenu ? "js-page-pos" : ""; 51 string topLayout = Model.Area.Item.GetList("LayoutTop").SelectedValue; 52 bool renderPagesInToolBar = Model.Area.Item.GetBoolean("RenderPagesInToolBar"); 53 54 string autoCssLink = "/Files/Templates/Designs/Rapido/css/rapido/rapido_" + Model.Area.ID.ToString() + ".min.css?ticks=" + Model.Area.UpdatedDate.Ticks; 55 56 string userInitials = ""; 57 if (Model.CurrentUser.ID != 0) 58 { 59 if (!String.IsNullOrEmpty(Model.CurrentUser.Name)) 60 { 61 string[] names = Model.CurrentUser.Name.Split(' '); 62 userInitials += Model.CurrentUser.Name.Substring(0, 1); 63 64 if (names.Length > 0) 65 { 66 userInitials += names[names.Length - 1].Substring(0, 1); 67 } 68 } 69 else 70 { 71 userInitials += Model.CurrentUser.FirstName != null && Model.CurrentUser.FirstName != "" ? Model.CurrentUser.FirstName.Substring(0, 1) : ""; 72 userInitials += Model.CurrentUser.LastName != null && Model.CurrentUser.LastName != "" ? Model.CurrentUser.LastName.Substring(0, 1) : ""; 73 userInitials += userInitials.Length == 1 && Model.CurrentUser.FirstName != null && Model.CurrentUser.FirstName.Length > 1 ? Model.CurrentUser.FirstName.Substring(1, 2) : ""; 74 userInitials += userInitials == "" && Model.CurrentUser.Email != null && Model.CurrentUser.Email.Length > 1 ? Model.CurrentUser.Email.Substring(0, 2) : ""; 75 } 76 } 77 78 string url = HttpContext.Current.Request.Url.Host; 79 80 81 82 } 83 <!DOCTYPE html> 84 85 <html lang="@Pageview.Area.CultureInfo.TwoLetterISOLanguageName"> 86 <head> 87 <meta charset="utf-8" /> 88 <title>@Model.TopPage.Name</title> 89 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1"> 90 <meta name="robots" content="index, follow"> 91 @System.Net.WebUtility.HtmlDecode(Model.MetaTags) 92 @RenderSnippet("FBImage") 93 94 <!-- Favicon --> 95 <link href="@favicon" rel="icon" type="image/png"> 96 97 <!-- Font awesome --> 98 <link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/rapido/font-awesome.min.css" type="text/css"> 99 100 <!-- Base (Default, wireframe) styles --> 101 <link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/base/base.css" type="text/css"> 102 103 <!-- Rapido Css from Website Settings --> 104 <link id="rapidoCss" rel="stylesheet" href="@autoCssLink" type="text/css"> 105 106 <!-- Ignite Css (Custom site specific styles) --> 107 <link id="igniteCss" type="text/css" href="/Files/Templates/Designs/Rapido/css/ignite/ignite.min.css" rel="stylesheet"> 108 109 <!-- Google fonts --> 110 @{ 111 var fonts = new string[5] { @navigationFont, @mobileNavigationFont, @headerFont, @subHeaderFont, @contentFont }; 112 var family = string.Join("|", fonts.Distinct().Select(x => string.Format("{0}:100,200,300,400,500,600,700,800,900", x))); 113 } 114 <link href="https://fonts.googleapis.com/css?family=@family" rel="stylesheet"> 115 116 @RenderSnippet("TagManager") 117 <!--Google Tag Manager--> 118 @if (true) //!url.Contains("dev") && !url.Contains("staging") 119 { 120 <script> 121 (function (w, d, s, l, i) { 122 w[l] = w[l] || []; 123 w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' }); 124 var f = d.getElementsByTagName(s)[0], 125 j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; 126 j.async = true; 127 j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; 128 f.parentNode.insertBefore(j, f); 129 })(window, document, 'script', 'dataLayer', 'GTM-MVHFK2B');</script> 130 } 131 <!--END Google Tag Manager--> 132 <!-- Global site tag (gtag.js) - Google Analytics --> 133 134 <script async src="https://www.googletagmanager.com/gtag/js?id=UA-125792852-1"></script> 135 136 <script> 137 window.dataLayer = window.dataLayer || []; 138 function gtag() { dataLayer.push(arguments); } 139 gtag('js', new Date()); 140 141 gtag('config', 'UA-125792852-1'); 142 </script> 143 144 </head> 145 146 <body> 147 <!--Google Tag Manager (noscript)--> 148 @if (true) //!url.Contains("dev") && !url.Contains("staging") 149 { 150 <noscript> 151 <iframe src="https://www.googletagmanager.com/ns.html?id=GTM-MVHFK2B" 152 height="0" width="0" style="display:none;visibility:hidden"></iframe> 153 </noscript> 154 } 155 <!---End Google Tag Manager (noscript)--> 156 @MobileNavigation(userInitials) 157 158 @LoginModal() 159 160 <main class="site dw-mod"> 161 <header class="top-container @stickyTop dw-mod" id="Top"> 162 @if (renderPagesInToolBar) 163 { 164 <div class="tools-navigation dw-mod"> 165 <div class="center-container grid top-container__center-container dw-mod"> 166 <div class="grid__col-xs-12 grid__col--bleed-y"> 167 <div class="grid__cell grid__cell--align-middle-right"> 168 @RenderNavigation(new 169 { 170 id = "topnavigation", 171 cssclass = "menu menu-tools dw-mod dwnavigation", 172 template = "TopMenu.xslt" 173 }) 174 </div> 175 </div> 176 </div> 177 </div> 178 } 179 <div class="tools-navigation dw-mod"> 180 <div class="center-container grid top-container__center-container dw-mod"> 181 <div class="grid__col-xs-12 grid__col--bleed-y"> 182 <div class="grid__cell grid__cell--align-middle-right"> 183 @RenderNavigation(new 184 { 185 id = "toolsnavigation", 186 cssclass = "menu menu-tools dw-mod dwnavigation", 187 template = "ToolsMenu.xslt", 188 parenttag = "toolMenuPage" 189 190 191 }) 192 </div> 193 </div> 194 </div> 195 </div> 196 @if (topLayout == "normal") 197 { 198 <!-- Header --> 199 <div class="header header-top dw-mod"> 200 <div class="center-container top-container__center-container dw-mod"> 201 <div class="grid"> 202 203 @* Logo *@ 204 @if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 205 { 206 <div class="grid__col-md-3 grid__col-sm-3 grid--align-self-center grid__col--bleed-y"> 207 <div class="logo dw-mod"> 208 <a href="/Default.aspx?ID=@firstPageId"> 209 <img class="grid__cell-img" src="@logo" alt="Logo" /> 210 </a> 211 </div> 212 </div> 213 } 214 @if (Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") 215 { 216 <div class="grid__col-12"> 217 <div class="grid__cell"> 218 <div class="logo u-max-w220px u-middle u-margin-bottom dw-mod"> 219 <a href="/Default.aspx?ID=@firstPageId"> 220 <img class="grid__cell-img" src="@logo" alt="Logo" /> 221 </a> 222 </div> 223 </div> 224 </div> 225 } 226 227 @if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 228 { 229 @* Search *@ 230 <div class="grid__col-6 grid__col--bleed-y grid--align-self-center"> 231 <div class="typeahead u-margin u-color-inherit js-typeahead" data-page-size="10" id="TopProductSearch" data-search-page-id="@productSearchPageId" data-result-page-id="@productsPageId" data-groups-page-id="@productGroupsPageId"> 232 <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> 233 <ul class="dropdown dropdown--absolute-position js-ajax-container js-typeahead-groups-content dw-mod" id="TopProductSearchGroupsContent" data-template="SearchGroupsTemplate" data-json-feed="/Default.aspx?ID=@productGroupsPageId&feedType=productGroups" data-init-onload="false"></ul> 234 <input type="text" class="typeahead-search-field u-no-margin js-typeahead-search-field" placeholder="@searchPlaceholder" value="@searchValue"> 235 <ul class="dropdown dropdown--absolute-position u-full-width js-ajax-container js-typeahead-search-content u-full-width dw-mod" id="TopProductSearchContent" data-template="SearchContentTemplate" data-no-result-template="SearchEmpty" data-json-feed="/Default.aspx?ID=@productSearchPageId&feedType=productsOnly" data-init-onload="false" data-preloader="minimal"></ul> 236 <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> 237 </div> 238 </div> 239 240 <div class="grid__cell grid__cell--align-middle-right"> 241 <ul class="menu dw-mod u-pull--right"> 242 @RenderSignIn("outsideNavigation", userInitials) 243 @RenderLanguageSelector("outsideNavigation") 244 @RenderFavorites("outsideNavigation") 245 @RenderMiniCart("outsideNavigation") 246 </ul> 247 </div> 248 } 249 250 @* Mobile search *@ 251 @if (Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") 252 { 253 <div class="grid__col-12 grid__col--bleed-y grid--align-self-center"> 254 <div class="grid__cell"> 255 <div class="js-typeahead" data-page-size="10" id="MobileProductSearch" data-search-page-id="@productSearchPageId" data-result-page-id="@productsPageId"> 256 <input type="text" class="u-full-width js-typeahead-search-field" placeholder="@searchPlaceholder" value="@searchValue"> 257 <ul class="dropdown dropdown--absolute-position js-ajax-container js-typeahead-search-content dw-mod" id="MobileProductSearchContent" data-template="SearchContentTemplate" data-no-result-template="SearchEmpty" data-json-feed="/Default.aspx?ID=@productSearchPageId&feedType=productsOnly" data-init-onload="false"></ul> 258 </div> 259 </div> 260 </div> 261 } 262 </div> 263 </div> 264 </div> 265 266 <!-- Main navigation --> 267 <nav class="main-navigation dw-mod"> 268 <div class="center-container top-container__center-container dw-mod"> 269 <div class="grid"> 270 <div class="grid__col-12 grid--align-self-center grid__col--bleed"> 271 <div class="grid__cell"> 272 @MobileNavigationTrigger() 273 @RenderHeaderNavigation() 274 275 @if (Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") 276 { 277 <ul class="menu dw-mod u-pull--right"> 278 @RenderMiniCart() 279 </ul> 280 } 281 </div> 282 </div> 283 </div> 284 </div> 285 </nav> 286 } 287 288 @if (topLayout == "condensed") 289 { 290 <!-- Main navigation --> 291 <nav class="main-navigation dw-mod"> 292 <div class="center-container top-container__center-container dw-mod"> 293 <div class="grid"> 294 295 <div class="grid__col-md-3 grid--align-self-center grid__col--bleed-y"> 296 <div class="logo u-padding--xs dw-mod"> 297 <a href="/Default.aspx?ID=@firstPageId"> 298 <img class="grid__cell-img" src="@logo" alt="Logo" /> 299 </a> 300 </div> 301 </div> 302 303 @* Navigation *@ 304 <div class="u-pull--left"> 305 @MobileNavigationTrigger() 306 @RenderHeaderNavigation() 307 </div> 308 309 <div class="grid__cell grid__cell--align-middle-right"> 310 <ul class="menu dw-mod u-pull--right"> 311 @RenderSignIn("inNavigation", userInitials) 312 @RenderLanguageSelector() 313 @RenderFavorites() 314 @RenderMiniCart() 315 </ul> 316 </div> 317 </div> 318 </div> 319 </nav> 320 321 <!-- Searchbar --> 322 <div class="u-box-shadow u-color-light-gray--bg u-inline-block u-full-width"> 323 <div class="center-container top-container__center-container dw-mod"> 324 <div class="typeahead typeahead--centered u-color-inherit js-typeahead dw-mod" data-page-size="10" id="ProductSearchBar" data-search-page-id="@productSearchPageId" data-result-page-id="@productsPageId" data-groups-page-id="@productGroupsPageId"> 325 <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> 326 <ul class="dropdown dropdown--absolute-position js-ajax-container js-typeahead-groups-content dw-mod" id="ProductSearchBarGroupsContent" data-template="SearchGroupsTemplate" data-json-feed="/Default.aspx?ID=@productGroupsPageId&feedType=productGroups" data-init-onload="false"></ul> 327 <div class="typeahead-search-field"> 328 <input type="text" class="u-no-margin u-full-width js-typeahead-search-field" placeholder="@searchPlaceholder" value="@searchValue"> 329 <ul class="dropdown dropdown--absolute-position u-full-width js-ajax-container js-typeahead-search-content dw-mod" id="ProductSearchBarContent" data-template="SearchContentTemplate" data-no-result-template="SearchEmpty" data-json-feed="/Default.aspx?ID=@productSearchPageId&feedType=productsOnly" data-init-onload="false"></ul> 330 </div> 331 <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> 332 </div> 333 </div> 334 </div> 335 } 336 @if (topLayout == "minimal") 337 { 338 <!-- Main navigation --> 339 <nav class="main-navigation dw-mod"> 340 <div class="center-container top-container__center-container dw-mod"> 341 <div class="grid"> 342 343 <div class="grid__col-md-3 grid--align-self-center grid__col--bleed-y"> 344 <div class="logo u-padding--xs dw-mod"> 345 <a href="/Default.aspx?ID=@firstPageId"> 346 <img class="grid__cell-img" src="@logo" alt="Logo" /> 347 </a> 348 </div> 349 </div> 350 351 @* Navigation *@ 352 <div class="u-pull--left"> 353 @MobileNavigationTrigger() 354 @RenderHeaderNavigation() 355 </div> 356 357 <div class="grid__cell grid__cell--align-middle-right"> 358 <ul class="menu dw-mod u-pull--right"> 359 @* Search *@ 360 <li class="menu__item menu__item--horizontal menu__item--top-level u-hidden-xxs dw-mod"> 361 <div class="menu__link u-w50px is-dropdown is-dropdown--no-icon dw-mod"> 362 <i class="fa fa-search fa-1_5x"></i> 363 <div class="menu menu--dropdown u-w340px top-micro-search dw-mod"> 364 <div class="typeahead js-typeahead" data-page-size="10" id="ProductSearchBar" data-search-page-id="@productSearchPageId" data-result-page-id="@productsPageId" data-groups-page-id="@productGroupsPageId"> 365 <div class="typeahead-search-field"> 366 <input type="text" class="u-no-margin u-full-width js-typeahead-search-field" placeholder="@searchPlaceholder" value="@searchValue"> 367 <ul class="dropdown dropdown--absolute-position u-full-width js-ajax-container js-typeahead-search-content" id="ProductSearchBarContent" data-template="SearchContentTemplate" data-no-result-template="SearchEmpty" data-json-feed="/Default.aspx?ID=@productSearchPageId&feedType=productsOnly" data-init-onload="false" data-preloader="minimal"></ul> 368 </div> 369 </div> 370 </div> 371 </div> 372 </li> 373 @RenderSignIn("inNavigation", userInitials) 374 @RenderLanguageSelector() 375 @RenderFavorites() 376 @RenderMiniCart() 377 </ul> 378 </div> 379 </div> 380 </div> 381 </nav> 382 } 383 384 @* Impersonation bar *@ 385 @if (Model.CurrentUser.ID > 0 && Model.SecondaryUsers.Count > 0) 386 { 387 <div class="u-color-warning--bg"> 388 <div class="center-container top-container__center-container dw-mod"> 389 @*Impersonation*@ 390 <div class="grid"> 391 <div class="grid--align-self-center grid__col-x"> 392 @if (Model.CurrentSecondaryUser != null && Model.CurrentSecondaryUser.ID > 0) 393 { 394 string stopImpersonateTranslation = Translate("Stop impersonation"); 395 string username = ""; 396 if (!string.IsNullOrEmpty(Model.CurrentSecondaryUser.FirstName) && !string.IsNullOrEmpty(Model.CurrentSecondaryUser.LastName)) 397 { 398 username = Model.CurrentSecondaryUser.FirstName + " " + Model.CurrentSecondaryUser.LastName; 399 } 400 else if (!string.IsNullOrEmpty(Model.CurrentSecondaryUser.Name)) 401 { 402 username = Model.CurrentSecondaryUser.Name; 403 } 404 else if (!string.IsNullOrEmpty(Model.CurrentSecondaryUser.Email)) 405 { 406 username = Model.CurrentSecondaryUser.Email; 407 } 408 else 409 { 410 username = Model.CurrentSecondaryUser.UserName; 411 } 412 <div class="grid-cell"> 413 <div class="u-pull--left u-bold u-margin-top"> 414 <i class="fa fa-user-secret"></i> 415 @Pageview.User.UserName<text>&nbsp;</text>@Translate("is impersonated by")<text>&nbsp;</text>@username 416 </div> 417 <form method="post" class="u-pull--right u-no-margin"> 418 <input type="submit" class="btn btn--secondary dw-mod u-no-margin" name="DwExtranetRemoveSecondaryUser" value="@stopImpersonateTranslation"> 419 </form> 420 </div> 421 } 422 else 423 { 424 string viewListTranslation = Translate("View the list of users you can impersonate"); 425 <div class="grid-cell u-bold"> 426 <i class="fa fa-user-secret"></i> 427 <a href="/Default.aspx?ID=@impersonationPageId" title="@viewListTranslation" class="u-color-font-black">@viewListTranslation</a> 428 </div> 429 } 430 </div> 431 </div> 432 </div> 433 </div> 434 } 435 </header> 436 <!-- Floating mini cart --> 437 @if (!stickyMenu && pageId == productsPageId && Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 438 { 439 <div class="floating-mini-cart u-hidden dw-mod" id="FloatingMiniCart"> 440 <div class="mini-cart dw-mod"> 441 <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')"> 442 <i class="fa fa-shopping-cart fa-4x"></i> 443 <div class="mini-cart__counter mini-cart__counter--lg dw-mod"> 444 <div class="js-ajax-container js-mini-cart-counter" id="FloatingCartCounter" data-template="MiniCartCounterContent" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=Counter" data-preloader="false" data-init-onload="false"> 445 <div class="js-mini-cart-counter-content"> 446 @Model.Cart.TotalProductsCount 447 </div> 448 </div> 449 </div> 450 </a> 451 452 <div class="mini-cart-dropdown js-ajax-container js-mini-cart dw-mod" id="SecondaryMiniCart" data-template="MiniCartContent" data-cart-id="@miniCartFeedPageId" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=MiniCart" data-init-onload="false"></div> 453 </div> 454 </div> 455 } 456 457 <!-- Render the content --> 458 <div id="Page" class="page @pagePos"> 459 <section class="center-container content-container dw-mod" id="content"> 460 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 461 462 @using System.Text.RegularExpressions 463 464 @*This is an example implementation of a Case template. 465 You may want to re-configure the itemtype and adjust this template to the specific needs. *@ 466 467 @{ 468 string fullBackgroundImage = ""; 469 if (Model.Item.GetFile("Image") != null) 470 { 471 fullBackgroundImage = "background-image:url(/Admin/Public/GetImage.ashx?width=2500&amp;height=1100&amp;crop=0&amp;Compression=90&amp;DoNotUpscale=true&amp;image=" + Model.Item.GetFile("Image").Path + ");"; 472 } 473 474 string caseListPageId = GetPageIdByNavigationTag("CasesListFeed").ToString(); 475 string solutionTypes = ""; 476 string solutionTypesValues = ""; 477 string partnerLink = Model.Item.GetItem("PartnerLink") != null ? Model.Item.GetItem("PartnerLink").PageID.ToString() : ""; //This solution is wrong. We need the Item PageId here. 478 479 string cardClass = Pageview.Device.ToString() != "Tablet" ? "paragraph-card" : ""; 480 string cardFooterClass = Pageview.Device.ToString() != "Tablet" ? "paragraph-card-footer" : ""; 481 } 482 483 <div class="grid article"> 484 485 @* Escape the container and section *@ 486 </div> 487 </section> 488 @* ----------------------------------- *@ 489 490 <section class="multiple-paragraphs-container u-color-light" style="@fullBackgroundImage"> 491 <div class="center-container center-container--with-background-image dw-mod"> 492 <div class="grid center-container--with-background-image"> 493 <div class="grid__col-md-12 grid__col-xs-12 paragraph-container"> 494 <div class="u-ta-center u-middle"> 495 <div> 496 <h1 class="article__header article__header--giant" style="color: @Model.Item.GetString("TextColor")">@Model.Item.GetString("BannerHeading")</h1> 497 <div class="article__subheader article__subheader--giant" style="color: @Model.Item.GetString("TextColor")">@Model.Item.GetString("BannerSubheading")</div> 498 </div> 499 </div> 500 </div> 501 </div> 502 </div> 503 </section> 504 505 @* Re-enter the container and section *@ 506 <section class="content-container center-container dw-mod"> 507 <div class="grid"> 508 @* ----------------------------------- *@ 509 510 <div class="grid__col-12"></div> 511 512 @* The descriptions *@ 513 <article class="grid__col-md-8"> 514 <h2 class="article__header">@Translate("Challenge")</h2> 515 <div class="article__paragraph">@Model.Item.GetString("Challenge")</div> 516 517 <h2 class="article__header">@Translate("Dynamicweb as a solution")</h2> 518 <div class="article__paragraph">@Model.Item.GetString("Solution")</div> 519 520 <h2 class="article__header">@Translate("Results")</h2> 521 <div class="article__paragraph">@Model.Item.GetString("Results")</div> 522 523 @* Quote *@ 524 @if (!String.IsNullOrEmpty(Model.Item.GetString("QuoteDescription"))) 525 { 526 <div class="grid article__block"> 527 <div class="grid__col-auto"> 528 @if (Model.Item.GetFile("QuoteImage") != null) 529 { 530 <div class="grid__cell-img grid__cell-img--centered"> 531 <img src="/Admin/Public/GetImage.ashx?width=160&amp;height=160&amp;crop=5&amp;Compression=90&amp;image=@Model.Item.GetFile("QuoteImage").Path" class="article__image article__image--ball" /> 532 </div> 533 } 534 </div> 535 <div class="grid__col-md-8"> 536 <div class="article__summary u-color-light-gray u-italic"> 537 "@Model.Item.GetString("QuoteDescription")" 538 </div> 539 <div> 540 - @Model.Item.GetString("QuoteAuthor") 541 </div> 542 </div> 543 </div> 544 } 545 </article> 546 547 @* Customer informations *@ 548 <div class="grid__col-md-4"> 549 <table class="table"> 550 @if (Model.Item.GetFile("CustomerLogo") != null) { 551 <tr class="table__row--no-border"> 552 <td colspan="2"> 553 <img src="/Admin/Public/GetImage.ashx?width=300&height=80&amp;crop=5&amp;Compression=90&amp;DoNotUpscale=true&amp;image=@Model.Item.GetFile("CustomerLogo").Path" /> 554 </td> 555 </tr> 556 } 557 @if (!String.IsNullOrEmpty(Model.Item.GetString("CustomerCompanyName"))) { 558 <tr> 559 <td width="32"><i class="fa fa-user fa-2x u-brand-color-two"></i></td> 560 <td> 561 <div class="u-bold">@Translate("Client")</div> 562 <div>@Model.Item.GetString("CustomerCompanyName")</div> 563 </td> 564 </tr> 565 } 566 @if (!String.IsNullOrEmpty(Model.Item.GetString("CustomerLocation"))) { 567 <tr> 568 <td width="32"><i class="fa fa-globe fa-2x u-brand-color-two"></i></td> 569 <td> 570 <div class="u-bold">@Translate("Location")</div> 571 <div>@Model.Item.GetString("CustomerLocation")</div> 572 </td> 573 </tr> 574 } 575 @if (!String.IsNullOrEmpty(Model.Item.GetString("Industry"))) { 576 <tr> 577 <td width="32"><i class="fa fa-building fa-2x u-brand-color-two"></i></td> 578 <td> 579 <div class="u-bold">@Translate("Industry")</div> 580 <div>@Model.Item.GetString("Industry")</div> 581 </td> 582 </tr> 583 } 584 @if (Model.Item.GetList("SolutionType") != null) { 585 <tr> 586 <td width="32"><i class="fa fa-gear fa-2x u-brand-color-two"></i></td> 587 <td> 588 <div class="u-bold">@Translate("Functionality")</div> 589 <div> 590 @{ 591 int count = 0; 592 593 foreach (var type in Model.Item.GetList("SolutionType").SelectedOptions) 594 { 595 if (count > 0) { 596 solutionTypes += ", "; 597 solutionTypesValues += ", "; 598 } 599 600 solutionTypes += type.Name; 601 solutionTypesValues += type.Value; 602 603 count++; 604 } 605 } 606 @solutionTypes 607 </div> 608 </td> 609 </tr> 610 } 611 @if (!String.IsNullOrEmpty(Model.Item.GetString("CustomerWebsiteUrl"))) { 612 <tr> 613 <td width="32"><i class="fa fa-desktop fa-2x u-brand-color-two"></i></td> 614 <td> 615 <div class="u-bold">@Translate("Website")</div> 616 <a href="http://@Model.Item.GetString("CustomerWebsiteUrl")">@Model.Item.GetString("CustomerWebsiteUrl")</a> 617 </td> 618 </tr> 619 } 620 621 @if (Model.Item.GetItem("PartnerLink") != null) { 622 <tr> 623 <td width="32"><i class="fa fa-address-card fa-2x u-brand-color-two"></i></td> 624 <td> 625 <div class="u-bold">@Translate("Partner")</div> 626 <a href="/Default.aspx?ID=@partnerLink">@Model.Item.GetItem("PartnerLink").GetString("PartnerName")</a> 627 </td> 628 </tr> 629 } 630 </table> 631 </div> 632 633 @* Images *@ 634 @if (Model.Item.GetItems("Gallery") != null) 635 { 636 if (Model.Item.GetItems("Gallery").Count > 0) 637 { 638 string mainImage = Model.Item.GetItems("Gallery").FirstOrDefault().GetFile("ImagePath").Path; 639 int imagesCount = Model.Item.GetItems("Gallery").Count; 640 641 <div class="grid__col-md-8"> 642 <label class="gallery" for="GalleryModalTrigger"> 643 <span class="gallery__main-image"> 644 <img src="/Admin/Public/GetImage.ashx?width=992&amp;height=760&amp;crop=0&amp;Compression=75&amp;DoNotUpscale=1&amp;image=@mainImage" class="flex-img" /> 645 </span> 646 <span class="gallery__image-counter"> 647 <i class="fa fa-camera fa-2x"></i> <span class="gallery__image-counter__number">@imagesCount</span> 648 <span class="gallery__image-counter__text">@Translate("See all") <i class="fa fa-angle-right"></i></span> 649 </span> 650 </label> 651 </div> 652 653 <div class="grid__col-md-4"> 654 655 </div> 656 } 657 } 658 659 @* Related cases *@ 660 @* Escape the container and section *@ 661 </div> 662 </section> 663 @* ----------------------------------- *@ 664 665 <section class="multiple-paragraphs-container u-color-light-gray--bg"> 666 <div class="center-container dw-mod"> 667 <div class="grid"> 668 <div class="grid__col-md-12 grid__col-xs-12 paragraph-container"> 669 <h1 class="article__header u-no-margin">@Translate("Similar cases")</h1> 670 </div> 671 </div> 672 673 <div class="js-ajax-container" id="RelatedCases" data-template="RelatedCasesTemplate" data-json-feed="/Default.aspx?ID=@caseListPageId&SolutionType=@solutionTypesValues&ExcludeCaseID=@Model.ID"></div> 674 675 <script id="RelatedCasesTemplate" type="text/x-template"> 676 <div class="grid u-no-margin" id="Cases" data-template="CasesTemplate" ></div> 677 </script> 678 679 <script id="CasesTemplate" type="text/x-template"> 680 <div class="grid__col-md-3 grid__col-sm-3 grid__col-xs-12"> 681 <div class="u-ta-center @cardClass"> 682 <div class="u-margin-bottom"> 683 <a href="{{link}}"> 684 <div class="layered-image {{tintedImage}}" style="background-image:url(/Admin/Public/GetImage.ashx?width=992&amp;height=760&amp;crop=0&amp;Compression=75&amp;DoNotUpscale=true&amp;image={{image}}); background-size: cover;"> 685 <img src="/Admin/Public/GetImage.ashx?width=240&amp;crop=0&amp;Compression=75&amp;DoNotUpscale=true&amp;image={{logo}}" class="u-padding" /> 686 </div> 687 </a> 688 </div> 689 690 <a href="{{link}}"> 691 <h2 class="u-no-margin u-margin-bottom">{{title}}</h2> 692 </a> 693 694 <p>{{summary}}</p> 695 </div> 696 <div class="grid__cell-footer grid--justify-center @cardFooterClass"> 697 <div class="u-margin-top u-margin-bottom"> 698 <a href="{{link}}" class="btn btn--secondary btn--line-height dw-mod">@Translate("Read the case")</a> 699 </div> 700 </div> 701 </div> 702 </script> 703 </div> 704 </section> 705 706 @if (Model.Item.GetItems("Gallery").Count > 0) 707 { 708 string firstImage = Model.Item.GetItems("Gallery").FirstOrDefault().GetFile("ImagePath").Path; 709 int modalImagesCount = Model.Item.GetItems("Gallery").Count; 710 List<string> galleryImages = new List<string>(); 711 712 foreach (var item in Model.Item.GetItems("Gallery")) 713 { 714 if (item.GetFile("ImagePath") != null) { 715 galleryImages.Add(item.GetFile("ImagePath").Path); 716 } 717 } 718 string galleryImagesArray = string.Join(", ", galleryImages); 719 720 <!-- Trigger for the gallery modal --> 721 <input type="checkbox" id="GalleryModalTrigger" class="modal-trigger" /> 722 723 <!-- Gallery modal --> 724 <div class="modal-container"> 725 <label for="GalleryModalTrigger" id="GalleryModalOverlay" class="modal-overlay"></label> 726 <div class="modal modal--lg modal--full" id="GalleryModal"> 727 <div class="modal__body"> 728 <div class="gallery-slider js-gallery-slider" data-current-image="0" data-total-images="@modalImagesCount" data-images="@galleryImagesArray" > 729 <div class="gallery-slider__image"> 730 <img src="/Admin/Public/GetImage.ashx?width=1200&amp;height=820&amp;crop=5&amp;Compression=75&amp;DoNotUpscale=1&amp;image=@firstImage" class="modal--full__img js-gallery-image" /> 731 </div> 732 <div class="gallery-slider__image-counter"> 733 <span class="js-image-list-counter">1</span> / @modalImagesCount 734 </div> 735 <label class="gallery-slider__close-btn" for="GalleryModalTrigger"> 736 <i class="fa fa-times-circle fa-1_5x"></i> 737 </label> 738 <button class="gallery-slider__previous-btn" onclick="ImageList.GetPreviousImage(this)"> 739 <i class="fa fa-arrow-circle-left fa-3x"></i> 740 </button> 741 <button class="gallery-slider__next-btn" onclick="ImageList.GetNextImage(this)"> 742 <i class="fa fa-arrow-circle-right fa-3x"></i> 743 </button> 744 </div> 745 </div> 746 </div> 747 </div> 748 } 749 750 @* Re-enter the container and section *@ 751 <section class="content-container center-container dw-mod"> 752 <div class="grid"> 753 @* ----------------------------------- *@ 754 </div> 755 756 </section> 757 </div> 758 </main> 759 760 @RenderFooter() 761 762 763 <!-- Content rendering helpers --> 764 765 @helper MobileNavigation(string userInitials) 766 { 767 int pageId = Model.TopPage.ID; 768 string mobileNavigationLevels = Model.Area.Item.GetBoolean("MobileNavigationLevels") ? Model.Area.Item.GetString("MobileNavigationLevels") : "3"; 769 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 770 int cartFeedPageId = GetPageIdByNavigationTag("CartOrderlinesFeed"); 771 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 772 string myProfilePageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerProfile").ToString() : GetPageIdByNavigationTag("CustomerProfile").ToString(); 773 string myOrdersPageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerOrders").ToString() : GetPageIdByNavigationTag("CustomerOrders").ToString(); 774 string myFavoritesPageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerFavorites").ToString() : GetPageIdByNavigationTag("CustomerFavorites").ToString(); 775 bool renderPagesInToolBar = Model.Area.Item.GetBoolean("RenderPagesInToolBar"); 776 string menuTemplate = "BaseMenuForMobileExpandable.xslt"; 777 int startLevel = renderPagesInToolBar ? 1 : 0; 778 779 bool showRequestProfileLink = false; 780 var customSettings = Dynamicweb.Content.Items.Item.GetItemById("CustomWebsiteSettings", Pageview.Area.Item["CustomSettings"].ToString()); 781 showRequestProfileLink = Dynamicweb.Core.Converter.ToBoolean(customSettings["RequestProfileLink"]); 782 783 if (Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") 784 { 785 <!-- Trigger for mobile navigation --> 786 <input type="checkbox" id="MobileNavTrigger" class="mobile-nav-trigger" autocomplete="off" /> 787 788 <!-- Mobile navigation --> 789 <nav class="mobile-navigation dw-mod"> 790 @if (Model.CurrentUser.ID > 0) 791 { 792 string userName = Model.CurrentUser.FirstName != null ? Model.CurrentUser.FirstName : ""; 793 userName += " " + Model.CurrentUser.LastName != null ? Model.CurrentUser.LastName : ""; 794 userName += userName == "" && Model.CurrentUser.UserName != null ? Model.CurrentUser.UserName : ""; 795 796 <ul class="menu menu-mobile"> 797 <li class="menu-mobile__item"> 798 <a href="/default.aspx?ID=@myProfilePageId" class="menu-mobile__link dw-mod"><i class="fa fa-user menu-mobile__link-icon"></i> @userName</a> 799 </li> 800 </ul> 801 } 802 803 @RenderNavigation(new 804 { 805 id = "mobilenavigation", 806 cssclass = "menu menu-mobile dwnavigation", 807 startLevel = @startLevel, 808 ecomStartLevel = @startLevel+1, 809 endlevel = @mobileNavigationLevels, 810 expandmode = "all", 811 template = @menuTemplate 812 }) 813 814 @if (renderPagesInToolBar) 815 { 816 @RenderNavigation(new 817 { 818 id = "topToolsMobileNavigation", 819 cssclass = "menu menu-mobile dwnavigation", 820 template = "ToolsMenuForMobile.xslt" 821 }) 822 } 823 824 <ul class="menu menu-mobile"> 825 @if (Model.CurrentUser.ID <= 0) 826 { 827 <li class="menu-mobile__item"> 828 <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> 829 </li> 830 831 if (showRequestProfileLink) 832 { 833 <li class="menu-mobile__item"> 834 <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> 835 </li> 836 } 837 } 838 else 839 { 840 <li class="menu-mobile__item"> 841 <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> 842 </li> 843 <li class="menu-mobile__item"> 844 <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> 845 </li> 846 <li class="menu-mobile__item"> 847 <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> 848 </li> 849 <li class="menu-mobile__item"> 850 <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> 851 </li> 852 } 853 854 @if (Model.Languages.Count > 0) 855 { 856 string selectedLanguage = ""; 857 foreach (var lang in Model.Languages) 858 { 859 if (lang.IsCurrent) 860 { 861 selectedLanguage = lang.Name; 862 } 863 } 864 865 866 867 <li class="menu-mobile__item dw-mod"> 868 <input id="MobileMenuCheck_Language" type="checkbox" class="expand-trigger"> 869 <div class="menu-mobile__link__wrap"> 870 <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> 871 <label for="MobileMenuCheck_Language" class="menu-mobile__trigger"></label> 872 </div> 873 <ul class="menu-mobile menu-mobile__submenu expand-menu"> 874 @foreach (var lang in Model.Languages) 875 { 876 877 <li class="menu-mobile__item dw-mod"> 878 <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> 879 </li> 880 881 882 } 883 </ul> 884 </li> 885 } 886 </ul> 887 </nav> 888 <label class="mobile-nav-trigger-off" for="MobileNavTrigger"></label> 889 890 <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> 891 } 892 } 893 894 @helper LoginModal() 895 { 896 int pageId = Model.TopPage.ID; 897 string topLayout = Model.Area.Item.GetList("LayoutTop").SelectedValue; 898 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 899 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 900 string forgotPasswordPageId = signInProfilePageId.ToString() + "&LoginAction=Recovery"; 901 string userSignedInError = !Model.LogOnFailed ? "" : "checked"; 902 string userSignedInErrorText = ""; 903 904 bool showRequestProfileLink = false; 905 var customSettings = Dynamicweb.Content.Items.Item.GetItemById("CustomWebsiteSettings", Pageview.Area.Item["CustomSettings"].ToString()); 906 showRequestProfileLink = Dynamicweb.Core.Converter.ToBoolean(customSettings["RequestProfileLink"]); 907 908 909 if (Model.LogOnFailed) 910 { 911 switch (Model.LogOnFailedReason) 912 { 913 case Dynamicweb.Security.UserManagement.LogOnFailedReason.PasswordLengthInvalid: 914 userSignedInErrorText = Translate("Password length is invalid"); 915 break; 916 case Dynamicweb.Security.UserManagement.LogOnFailedReason.IncorrectLogin: 917 userSignedInErrorText = Translate("Invalid email or password"); 918 break; 919 case Dynamicweb.Security.UserManagement.LogOnFailedReason.ExceededFailedLogOnLimit: 920 userSignedInErrorText = Translate("You have exceeded the limit of allowed login attempts. The user account is temporarily locked"); 921 break; 922 case Dynamicweb.Security.UserManagement.LogOnFailedReason.LoginLocked: 923 userSignedInErrorText = Translate("The user account is temporarily locked"); 924 break; 925 case Dynamicweb.Security.UserManagement.LogOnFailedReason.PasswordExpired: 926 userSignedInErrorText = Translate("The password has expired and needs to be renewed"); 927 break; 928 default: 929 userSignedInErrorText = Translate("An unknown error occured"); 930 break; 931 } 932 } 933 934 <!-- Trigger for the login modal --> 935 <input type="checkbox" id="SignInModalTrigger" class="modal-trigger @topLayout" @userSignedInError /> 936 937 <!-- Login modal --> 938 <div class="modal-container"> 939 <label for="SignInModalTrigger" id="SignInModalOverlay" class="modal-overlay"></label> 940 <div class="modal modal--xs" id="SignInModal"> 941 <div class="modal__header"> 942 <h2>@Translate("Sign in")</h2> 943 </div> 944 <div class="modal__body"> 945 <form method="post" id="LoginForm" class="u-no-margin"> 946 <input type="hidden" name="ID" value="@pageId" /> 947 <input type="hidden" name="DWExtranetUsernameRemember" value="True" /> 948 <input type="hidden" name="DWExtranetPasswordRemember" value="True" /> 949 <input type="text" class="u-full-width" id="LoginUsername" name="username" placeholder="@Translate("Email")" /> 950 <input type="password" class="u-full-width" id="LoginPassword" name="password" placeholder="@Translate("Password")" /> 951 <div class="field-error dw-mod">@userSignedInErrorText</div> 952 953 <label> 954 <input type="checkbox" id="RememberMe" name="Autologin" checked="checked" value="True"> 955 <span>@Translate("Remember me", "Remember me")</span> 956 </label> 957 958 <button type="submit" class="btn btn--primary btn--full dw-mod" name="LoginAction" value="Login" onclick="Buttons.LockButton(event)">@Translate("Sign in")</button> 959 960 <a class="btn btn--link-clean dw-mod" href="/Default.aspx?id=@forgotPasswordPageId">@Translate("Forgot your password?", "Forgot your password?")</a> 961 962 @if (showRequestProfileLink) 963 { 964 <a class="btn btn--link-clean dw-mod" href="/default.aspx?ID=@createAccountPageId">@Translate("Create account")?</a> 965 } 966 </form> 967 </div> 968 </div> 969 </div> 970 } 971 972 @helper RenderHeaderNavigation() 973 { 974 bool megaMenu = Model.Area.Item.GetList("NavigationMegaMenu").SelectedValue.ToLower() == "true" ? true : false; 975 string megamenuPromotionImage = Model.Area.Item.GetFile("NavigationMegamenuPromotionImage") != null ? Model.Area.Item.GetFile("NavigationMegamenuPromotionImage").Path : ""; 976 bool renderPagesInToolBar = Model.Area.Item.GetBoolean("RenderPagesInToolBar"); 977 int startLevel = renderPagesInToolBar ? 1 : 0; 978 979 if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 980 { 981 if (!megaMenu) 982 { 983 @RenderNavigation(new 984 { 985 id = "topnavigation", 986 cssclass = "menu dw-mod dwnavigation", 987 startLevel = @startLevel, 988 ecomStartLevel = @startLevel + 1, 989 endlevel = 5, 990 expandmode= "all", 991 template = "BaseMenuWithDropdown.xslt" 992 }); 993 } 994 else 995 { 996 @RenderNavigation(new 997 { 998 id = "topnavigation", 999 cssclass = "menu dw-mod dwnavigation", 1000 startLevel = @startLevel, 1001 ecomStartLevel = @startLevel + 1, 1002 endlevel = 5, 1003 promotionImage = megamenuPromotionImage, 1004 promotionLink = Model.Area.Item.GetString("NavigationMegamenuPromotionLink"), 1005 template = "BaseMegaMenu.xslt" 1006 }); 1007 } 1008 } 1009 } 1010 1011 @helper MobileNavigationTrigger() 1012 { 1013 @* Mobile navigation trigger *@ 1014 1015 if (Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") 1016 { 1017 <div class="menu dw-mod u-pull--left"> 1018 <div class="menu__item menu__item--horizontal menu__item--top-level dw-mod"> 1019 <label for="MobileNavTrigger" class="mobile-nav-trigger-button menu__link dw-mod"></label> 1020 </div> 1021 </div> 1022 } 1023 } 1024 1025 @helper RenderLanguageSelector(string type = "inNavigation") 1026 { 1027 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"; 1028 string menuLinkClass = type == "inNavigation" ? "menu__link" : "header-menu__link"; 1029 1030 @* Language selector *@ 1031 if (Model.Languages.Count > 1) 1032 { 1033 1034 <li class="@liClasses"> 1035 <div class="@menuLinkClass u-w40px is-dropdown is-dropdown--no-icon dw-mod"> 1036 <i class="fa fa-flag fa-1_5x"></i> 1037 <div class="menu menu--dropdown u-w100px dw-mod"> 1038 @foreach (var lang in Model.Languages) 1039 { 1040 1041 <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> 1042 1043 } 1044 </div> 1045 </div> 1046 </li> 1047 } 1048 } 1049 1050 @helper RenderMiniCart(string type = "inNavigation") 1051 { 1052 string liClasses = type == "inNavigation" ? "menu__item menu__item--horizontal menu__item--top-level dw-mod" : "menu__item menu__item--horizontal menu--clean dw-mod"; 1053 string menuLinkClass = type == "inNavigation" ? "menu__link" : "header-menu__link"; 1054 1055 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 1056 int cartFeedPageId = GetPageIdByNavigationTag("CartOrderlinesFeed"); 1057 int cartPageId = GetPageIdByNavigationTag("CartPage"); 1058 double cartProductsCount = Model.Cart.TotalProductsCount; 1059 1060 @* Mini cart *@ 1061 <li class="@liClasses"> 1062 <div class="mini-cart dw-mod"> 1063 <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')"> 1064 <i class="fa fa-shopping-cart fa-1_5x"></i> 1065 <div class="mini-cart__counter mini-cart__counter--inline dw-mod"> 1066 <div class="js-ajax-container js-mini-cart-counter" id="cartCounter" data-template="MiniCartCounterContent" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=Counter" data-init-onload="false" data-preloader="false"> 1067 <div class="js-mini-cart-counter-content"> 1068 @cartProductsCount 1069 </div> 1070 </div> 1071 </div> 1072 </a> 1073 @if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 1074 { 1075 <div class="mini-cart-dropdown js-ajax-container js-mini-cart dw-mod" id="miniCart" data-template="MiniCartContent" data-cart-id="@miniCartFeedPageId" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=MiniCart" data-init-onload="false"></div> 1076 } 1077 </div> 1078 </li> 1079 } 1080 1081 @helper RenderSignIn(string type = "inNavigation", string userInitials = "") 1082 { 1083 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"; 1084 string menuLinkClass = type == "inNavigation" ? "menu__link" : "header-menu__link"; 1085 1086 int pageId = Model.TopPage.ID; 1087 string myProfilePageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerProfile").ToString() : GetPageIdByNavigationTag("CustomerProfile").ToString(); 1088 string myOrdersPageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerOrders").ToString() : GetPageIdByNavigationTag("CustomerOrders").ToString(); 1089 int myDashboardPageId = GetPageIdByNavigationTag("CustomerDashboard"); 1090 string myFavoritesPageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerFavorites").ToString() : GetPageIdByNavigationTag("CustomerFavorites").ToString(); 1091 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 1092 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 1093 string forgotPasswordPageId = signInProfilePageId.ToString() + "&LoginAction=Recovery"; 1094 1095 bool showRequestProfileLink = false; 1096 var customSettings = Dynamicweb.Content.Items.Item.GetItemById("CustomWebsiteSettings", Pageview.Area.Item["CustomSettings"].ToString()); 1097 showRequestProfileLink = Dynamicweb.Core.Converter.ToBoolean(customSettings["RequestProfileLink"]); 1098 1099 @* Sign in + Customer center links *@ 1100 <li class="@liClasses"> 1101 <div class="@menuLinkClass is-dropdown is-dropdown--no-icon u-w40px dw-mod"> 1102 @if (Model.CurrentUser.ID <= 0) 1103 { 1104 <i class="fa fa-user fa-1_5x"></i> 1105 } 1106 else 1107 { 1108 <a href="/default.aspx?ID=@myDashboardPageId" class="u-color-inherit"><div class="circle-icon-btn">@userInitials.ToUpper()</div></a> 1109 } 1110 1111 <div class="menu menu--dropdown sign-in-dropdown dw-mod"> 1112 <ul class="list list--clean dw-mod"> 1113 @if (Model.CurrentUser.ID <= 0) 1114 { 1115 <li> 1116 <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> 1117 </li> 1118 1119 if (showRequestProfileLink) 1120 { 1121 <li> 1122 <a href="/default.aspx?ID=@createAccountPageId" class="list__link dw-mod">@Translate("Create account")</a> 1123 </li> 1124 } 1125 1126 <li> 1127 <a href="/default.aspx?ID=@forgotPasswordPageId" class="list__link dw-mod">@Translate("Forgot your password?")</a> 1128 </li> 1129 @*<li class="list__seperator dw-mod"></li>*@ 1130 } 1131 1132 @if (Model.CurrentUser.ID > 0) 1133 { 1134 <li> 1135 <a href="/default.aspx?ID=@myProfilePageId" class="list__link dw-mod"><i class="fa fa-user"></i> @Translate("My Profile")</a> 1136 </li> 1137 <li> 1138 <a href="/default.aspx?ID=@myOrdersPageId" class="list__link dw-mod"><i class="fa fa-list"></i> @Translate("My Orders")</a> 1139 </li> 1140 <li> 1141 <a href="/default.aspx?ID=@myFavoritesPageId" class="list__link dw-mod"><i class="fa fa-star"></i> @Translate("My Favorites")</a> 1142 </li> 1143 <li class="list__seperator dw-mod"></li> 1144 <li> 1145 <a href="/Admin/Public/ExtranetLogoff.aspx?ID=@pageId" class="list__link dw-mod">@Translate("Sign out")</a> 1146 </li> 1147 } 1148 </ul> 1149 </div> 1150 </div> 1151 </li> 1152 } 1153 1154 @helper RenderFavorites(string type = "inNavigation") 1155 { 1156 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"; 1157 string menuLinkClass = type == "inNavigation" ? "menu__link" : "header-menu__link"; 1158 1159 string myFavoritesPageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerFavorites").ToString() : GetPageIdByNavigationTag("CustomerFavorites").ToString(); 1160 1161 @* Favorites *@ 1162 if (Model.CurrentUser.ID > 0) 1163 { 1164 <li class="@liClasses"> 1165 <a href="/Default.aspx?ID=@myFavoritesPageId" class="@menuLinkClass dw-mod"> 1166 <i class="fa fa-star fa-1_5x"></i> 1167 </a> 1168 </li> 1169 } 1170 } 1171 1172 1173 @helper RenderFooter() 1174 { 1175 string footerColumnOneContent = !string.IsNullOrEmpty(Model.Area.Item.GetString("FooterColumnOne")) ? Model.Area.Item.GetString("FooterColumnOne") : ""; 1176 string footerColumnTwoContent = !string.IsNullOrEmpty(Model.Area.Item.GetString("FooterColumnTwo")) ? Model.Area.Item.GetString("FooterColumnTwo") : ""; 1177 string footerColumnOneHeader = Model.Area.Item.GetString("FooterColumnOneHeader"); 1178 string footerColumnTwoHeader = Model.Area.Item.GetString("FooterColumnTwoHeader"); 1179 int newsletterSignUpPageId = GetPageIdByNavigationTag("NewsletterSignUp"); 1180 1181 <!-- Footer section --> 1182 <footer class="footer dw-mod"> 1183 <div class="center-container top-container__center-container dw-mod"> 1184 <div class="grid"> 1185 @if (!string.IsNullOrEmpty(footerColumnOneContent) || !string.IsNullOrEmpty(footerColumnOneHeader)) 1186 { 1187 <div class="grid__col-md-auto"> 1188 <h4 class="footer__heading dw-mod">@footerColumnOneHeader</h4> 1189 @footerColumnOneContent 1190 </div> 1191 } 1192 @if (!string.IsNullOrEmpty(footerColumnTwoContent) || !string.IsNullOrEmpty(footerColumnTwoHeader)) 1193 { 1194 <div class="grid__col-md-auto"> 1195 <h4 class="footer__heading dw-mod">@footerColumnTwoHeader</h4> 1196 @footerColumnTwoContent 1197 </div> 1198 } 1199 @if (Model.Area.Item.GetBoolean("FooterNewsletterSignUp")) 1200 { 1201 <div class="grid__col-md-auto"> 1202 <h4 class="footer__heading dw-mod">@Translate("Mailing list", "Mailing list")</h4> 1203 <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> 1204 <form class="form dw-mod" name="NewsletterRedirect" action='/Default.aspx' method="get" enctype="multipart/form-data"> 1205 <input name="ID" id="ID" value="@newsletterSignUpPageId" type="hidden" /> 1206 <div class="form__field-combi"> 1207 <input name="NewsletterEmail" id="NewsletterEmail" type="text" placeholder='@Translate("Your email address", "Your email address")' /> 1208 <input class="btn btn--primary dw-mod" type="submit" id="Submitter" value='@Translate("Go", "Go")' /> 1209 </div> 1210 </form> 1211 </div> 1212 } 1213 @if (Model.Area.Item.GetItems("FooterSocialLinks").Count > 0) 1214 { 1215 <div class="grid__col-md-auto"> 1216 <h4 class="footer__heading dw-mod">@Translate("Social links", "Social links")</h4> 1217 1218 <div class="collection dw-mod"> 1219 @foreach (var socialitem in Model.Area.Item.GetItems("FooterSocialLinks")) 1220 { 1221 //Fields.FirstOrDefault(x => x.SystemName == "Icon").GetString() 1222 var socialIcon = socialitem.GetValue("Icon") as Dynamicweb.Frontend.ListViewModel; 1223 string socialIconClass = socialIcon.SelectedValue; 1224 string socialIconTitle = socialIcon.SelectedName; 1225 string socialLink = socialitem.GetString("Link"); 1226 1227 <a href="@socialLink" title="@socialIconTitle"><i class="fa @socialIconClass fa-2x"></i></a> 1228 } 1229 </div> 1230 </div> 1231 } 1232 <div class="grid__col-12 grid--align-center"> 1233 <p>@Model.Area.Item.GetString("FooterCopyrightText")</p> 1234 </div> 1235 </div> 1236 </div> 1237 </footer> 1238 } 1239 1240 1241 @* Templates for Typeahead *@ 1242 <script id="SearchGroupsTemplate" type="text/x-template"> 1243 <li class="dropdown__item dw-mod" onclick="Search.UpdateGroupSelection(this)" data-group-id="{{id}}">{{name}}</li> 1244 </script> 1245 1246 <script id="SearchContentTemplate" type="text/x-template"> 1247 <li class="dropdown__item dropdown__item--seperator dw-mod"> 1248 <a href="{{link}}" class="js-typeahead-link u-color-inherit u-pull--left"> 1249 <div class="u-margin-right u-pull--left {{noimage}} u-hidden-xs u-hidden-xxs"><img src="/Admin/Public/GetImage.ashx?width=45&height=38&crop=1&Compression=75&image={{image}}" alt="{{name}}"></div> 1250 <div class="u-pull--left"> 1251 <div class="u-bold u-max-w220px u-truncate-text js-typeahead-name">{{name}}</div> 1252 <div>{{price}}</div> @Translate("inkl. MVA") <span class="stock-icon {{stockState}} dw-mod" title=""></span> 1253 </div> 1254 </a> 1255 1256 <div class="u-margin-left u-pull--right u-hidden-xs u-hidden-xxs"> 1257 <button class="{{hasBuyOption}}-hibe-buy btn btn--primary btn--condensed u-no-margin dw-mod {{hideBuyOptions}} js-ignore-click-outside " onclick="Cart.AddToCart(event, '{{id}}', '1')"><i class="fa fa-shopping-cart js-ignore-click-outside"></i></button> 1258 <a href="{{link}}" class="{{hasBuyOption}}-view btn btn--secondary btn--condensed u-no-margin dw-mod js-ignore-click-outside">@Translate("View")</a> 1259 </div> 1260 1261 </li> 1262 </script> 1263 1264 <script id="SearchMore" type="text/x-template"> 1265 <li class="dropdown__item dropdown__item--not-selectable dw-mod"> 1266 <a href="/Default.aspx?ID=@productsPageId&Search={{searchParameter}}&GroupID={{groupId}}" class="btn btn--primary btn--full u-no-margin dw-mod js-typeahead-link"> 1267 @Translate("View all") 1268 </a> 1269 </li> 1270 </script> 1271 1272 <script id="SearchEmpty" type="text/x-template"> 1273 <li class="u-margin u-padding-left"> 1274 @Translate("Your search gave 0 results") 1275 </li> 1276 </script> 1277 1278 @* Templates for the mini cart *@ 1279 <script id="MiniCartCounterContent" type="text/x-template"> 1280 <div class="js-mini-cart-counter-content dw-mod"> 1281 {{numberofproducts}} 1282 </div> 1283 </script> 1284 1285 <script id="MiniCartContent" type="text/x-template"> 1286 <div class="mini-cart-dropdown__inner {{isempty}} dw-mod"> 1287 <h4 class="u-ta-center u-no-margin u-margin-bottom u-margin-top">@Translate("Shopping cart")</h4> 1288 <div class="mini-cart-dropdown__body dw-mod"> 1289 <table class="table mini-cart-table dw-mod"> 1290 <thead> 1291 <tr> 1292 <td>&nbsp;</td> 1293 <td>@Translate("Product")</td> 1294 <td class="u-ta-right">@Translate("Qty")</td> 1295 <td class="u-ta-right" width="120">@Translate("Price")</td> 1296 </tr> 1297 </thead> 1298 1299 <tbody id="MiniCartOrderLines"></tbody> 1300 1301 @*<tr> 1302 <td><i class="fa fa-credit-card"></i></td> 1303 <td>{{paymentmethod}}</td> 1304 <td colspan="2" class="u-ta-right" width="130">{{paymentfee}}</td> 1305 </tr>*@ 1306 <tr> 1307 <td><i class="fa fa-truck"></i></td> 1308 <td>{{shippingmethod}}</td> 1309 <td colspan="2" class="u-ta-right" width="130">{{shippingfee}}</td> 1310 </tr> 1311 <tr class="mini-cart-totals dw-mod"> 1312 <td colspan="2">@Translate("Total")</td> 1313 <td class="u-ta-right">{{numberofproducts}}</td> 1314 <td class="u-ta-right" width="130">{{totalprice}}</td> 1315 </tr> 1316 </table> 1317 </div> 1318 1319 <table class="table mini-cart-table dw-mod"> 1320 <tr class="mini-cart-orderlines__footer dw-mod"> 1321 <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> 1322 <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> 1323 </tr> 1324 </table> 1325 </div> 1326 </script> 1327 1328 <script id="MiniCartOrderline" type="text/x-template"> 1329 <tr class="{{isempty}}"> 1330 <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> 1331 <td> 1332 <a href="{{link}}" class="mini-cart-orderlines__name">{{name}}</a> 1333 <a href="{{link}}" class="mini-cart-orderlines__name">{{variantname}}</a> 1334 </td> 1335 <td class="u-ta-right">{{quantity}}</td> 1336 <td class="u-ta-right">{{totalprice}}</td> 1337 </tr> 1338 </script> 1339 1340 <script id="MiniCartOrderlineDiscount" type="text/x-template"> 1341 <tr class="table__row--no-border {{isempty}}"> 1342 <td>&nbsp;</td> 1343 <td><div class="mini-cart-orderlines__name dw-mod">{{name}}</div></td> 1344 <td class="u-ta-right">&nbsp;</td> 1345 <td class="u-ta-right">{{totalprice}}</td> 1346 </tr> 1347 </script> 1348 1349 <!-- Javascript --> 1350 <script src="/Files/Templates/Designs/Rapido/js/master.min.js"></script> 1351 1352 @if (Model.Area.Item.GetBoolean("UseCustomJavascript")) 1353 { 1354 <script src="/Files/Templates/Designs/Rapido/js/custom.min.js"></script> 1355 } 1356 1357 <script> 1358 Wireframe.Init(@wireframeMode.ToLower()); 1359 </script> 1360 <script> 1361 // Master.cshtml Scripts 1362 // Change navigation Frontpage button with Font Awesome Icon 1363 var mobileHome = document.getElementById("home"), 1364 desktopHome = document.querySelector("ul#topnavigation > li > a"), 1365 homeIcon = "<i class='fa fa-home fa-1_5x'></i>"; 1366 // For Mobile 1367 mobileHome ? mobileHome.innerHTML = homeIcon : 0; 1368 // For Desktop 1369 desktopHome ? desktopHome.innerHTML = homeIcon : 0; 1370 1371 // Remove Product category button from the TopProductSearch input field 1372 var typeAheadSearchInput = document.getElementById("TopProductSearch"), 1373 typeAheadCategoryButton = typeAheadSearchInput.childNodes; 1374 // Remove the button 1375 typeAheadCategoryButton[1].remove(); 1376 </script> 1377 </body> 1378 </html> 1379 1380