Error executing template "Designs/StandardWebshop/_parsed/StandardPage.parsed.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_c161854da37b4d7c868af880d0b5738e.Execute() in E:\Solutions\DermaPharm\Live\Files\Templates\Designs\StandardWebshop\_parsed\StandardPage.parsed.cshtml:line 27
   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 @using NORRIQ.Common8.Razor 3 @{ 4 var noscriptquery = System.Web.HttpContext.Current.Request.QueryString["notracking"]; 5 var testcss = System.Web.HttpContext.Current.Request.QueryString["testcss"]; 6 string origin = Dynamicweb.Context.Current.Request.QueryString.Get("ori"); 7 if (!string.IsNullOrWhiteSpace(origin)) { 8 //Dynamicweb.Environment.CookieManager.SetCookie("goodskin_origin", origin, DateTime.Now.AddHours(2)); 9 var originCookie = new Dynamicweb.Environment.Cookie("goodskin_origin", origin); 10 originCookie.Expires = DateTime.Now.AddHours(2); 11 originCookie.HttpOnly = false; 12 originCookie.Shareable = true; 13 originCookie.Secure = true; 14 Dynamicweb.Environment.CookieManager.SetCookie(originCookie); 15 } 16 } 17 18 <!DOCTYPE html> 19 <html lang="@Pageview.Area.Culture"> 20 <head> 21 @if(Model.ID == 2) { 22 @RenderSnippet("EcomMeta") 23 } else { 24 <title>@Model.Title</title> 25 <meta name="description" content="@Model.Description" /> 26 } 27 @if (Model.Item.GetBoolean("NoIndex")) 28 { 29 <meta name="robots" content="noindex, nofollow" /> 30 <!-- TODO: remove on launch--> 31 } 32 @RenderSnippet("AddNoIndex") 33 <meta charset='utf-8' /> 34 35 <meta http-equiv="X-UA-Compatible" content="IE=edge" /> 36 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no" /> 37 <link href="https://fonts.googleapis.com/css?family=Montserrat:300,300i,700,700i" rel="stylesheet"> 38 <link rel="stylesheet" href="https://use.typekit.net/bcz8hat.css"> 39 40 <link href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css' rel='stylesheet' type='text/css' /> 41 <link href='@(Model.Item.GetBoolean("NIQ:JavaScriptDebug") ? "/Files/Templates/Designs/StandardWebshop/css/style.css?v=3" : "/Files/Templates/Designs/StandardWebshop/css/style.css?v=3")' rel='stylesheet' />@*min*@ 42 43 @RenderSnippet("MoveToHead") 44 @if (noscriptquery != "true") 45 { 46 @Model.Area.Item.GetString("GTM_Header_Script") 47 } 48 <!--[if IE]> 49 <style>.productlist-grid { float: left; }</style> 50 <![endif]--> 51 <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> 52 <!--[if lt IE 9]> 53 <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> 54 <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> 55 <![endif]--> 56 57 </head> 58 59 <body data-is-desktop="@(Pageview.Device == Dynamicweb.Frontend.Devices.DeviceType.Desktop ? "true" : "false")" data-is-tablet="@(Pageview.Device == Dynamicweb.Frontend.Devices.DeviceType.Tablet ? "true" : "false")" data-is-phone="@(Pageview.Device == Dynamicweb.Frontend.Devices.DeviceType.Mobile ? "true" : "false")"> 60 @if(noscriptquery != "true") { 61 @Model.Area.Item.GetString("GTM_BodyIFrame") 62 } 63 @using NORRIQ.Common8.Razor; 64 @using Dynamicweb 65 @using Dynamicweb.Ecommerce.Common; 66 @using Dynamicweb.Ecommerce.Prices 67 @using Dynamicweb.Rendering; 68 69 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 70 @{ 71 var isCartEmpty = (Dynamicweb.Ecommerce.Common.Context.Cart == null || Dynamicweb.Ecommerce.Common.Context.Cart.OrderLines.CountOnlyProducts == 0); 72 var isMobile = Pageview.Device.ToString() == "Mobile" ? "true":"false"; 73 74 75 var cartPage = Dynamicweb.Services.Pages.GetPage(3); 76 var cartPageEmpty = Dynamicweb.Services.Pages.GetPage(2); 77 } 78 79 <header class="header-default"> 80 <div class="container"> 81 <div class="header-wrapper"> 82 <div class="header-default-logo"> 83 <a href="/" title='@Translate("Go to frontpage", "Go to frontpage")'> 84 @{ 85 var logo = Model.Area.Item.GetFile("Logo"); 86 87 if (logo != null) 88 { 89 var extension = logo.Name.Substring(logo.Name.LastIndexOf('.') + 1); 90 var filename = logo.Path.Substring(0, logo.Path.LastIndexOf('.')); 91 <img class="img-responsive" src="@logo.Path" srcset="@filename-2x.@extension 2x" alt='@Translate("Website Logo Alt", "Shutter - Standard Webshop")' /> 92 } 93 else 94 { 95 <i>No logo found, please configure it in the Dynamicweb Administration</i> 96 } 97 } 98 </a> 99 </div> 100 @RenderNavigation(new { Template = "navbar-nav-ecom-goodskin.xslt", Expandmode = "all", StartLevel = 1, EndLevel = 3 }) 101 @RenderNavigation(new { Template = "navbar-nav-pages.xslt", Expandmode = "all", StartLevel = 1, EndLevel = 2 }) 102 <ul class="nav navbar-nav header-default-nav"> 103 <li class="dropdown dropdown-icon"> 104 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> 105 <i class="fa fa-search"></i> 106 <span class="dropdown-label">@Translate("Search", "Search")</span> 107 </a> 108 <div class="dropdown-menu instantsearch"> 109 @using NORRIQ.Common8.Razor; 110 @{ 111 var searchLabel = Translate("Search products"); 112 var searchResultPageId = NORRIQ.Common8.Razor.Navigation.GetPageIdByNavigationTag("search"); 113 var searchQuery = @System.Web.HttpContext.Current.Request.QueryString["ecomQuery"]; 114 } 115 116 <div class="form-search" id="instantsearch"> 117 <form class="form form-search-form" id="search-form" action="/Default.aspx" method="get"> 118 <input type="hidden" value="@searchQuery" id="searchstring"> 119 <input type="hidden" name="ID" value="@searchResultPageId" /> 120 <label for="searchTerm" class="sr-only"> 121 @searchLabel 122 </label> 123 <div class="input-group"> 124 <input type="search" class="form-control" id="searchTerm" name="eComQuery" placeholder="@searchLabel" autocomplete="off" data-tabindex="0" value="@searchQuery" /> 125 <span class="input-group-btn"> 126 <button type="submit" id="instantSearchBtn" class="btn btn-primary js-search-btn"> 127 <i id="instantSearchIcon" class="icon-search" aria-hidden="true"></i><span class="sr-only">@Translate("Search")</span> 128 </button> 129 </span> 130 </div> 131 </form> 132 <div class="form-search-collapse collapse" id="search-result-foldout"> 133 <div class="form-search-result" id="search-result-container"></div> 134 </div> 135 </div> 136 137 138 <script type="text/x-jsrender" id="quicksearchtemplate"> 139 140 <table class="table table-condensed productlist-table"> 141 <tbody> 142 {{for Products}} 143 <tr data-product-id="{{:Id}}" 144 data-product-key='{{:AutoAddProductKey}}' 145 data-product-language-id="{{:LanguageId}}"> 146 @if (Pageview.Security.UserLoggedIn) 147 { 148 <td class="productlist-table-thumb text-center" width="70"> 149 <img src="/Admin/Public/GetImage.ashx?Image={{:ThumbnailImageName}}&amp;Width=60&amp;Height=60&amp;Crop=5&amp;Compression=80" height="60" class="img-responsive" alt="{{:ThumbnailImageAltText}}" /> 150 </td> 151 <td class="productlist-table-product"> 152 <a href="{{:Link}}" class="productlist-table-name"> 153 {{:Name}} 154 </a> 155 <div class="clearfix"> 156 <div class="pull-left text-small"> 157 @Translate("Product Number"): {{:Number}}<br /> 158 @Translate("Price"): {{:UnitPrice}} 159 </div> 160 <div class="productlist-table-quantity pull-right"> 161 <div class="input-group"> 162 <input type="text" 163 class="form-control qty-input text-center js-qs-qty-input" 164 value="{{:QtyInBasket}}" 165 onclick="this.focus(); this.select();" 166 data-tabindex="{{:#index + 1}}" /> 167 <span class="input-group-addon qty-input-user-feedback js-qs-qty-input-feedback"> 168 {{if QtyInBasket > 0}} 169 <i class="icon-added"></i> 170 {{else}} 171 <i class="icon-minicart"></i> 172 {{/if}} 173 </span> 174 </div> 175 </div> 176 </div> 177 </td> 178 } 179 else 180 { 181 <td class="productlist-table-thumb text-center" width="70"> 182 <img src="{{:ThumbnailImageName}}" height="60" class="img-responsive" alt="{{:ThumbnailImageAltText}}" /> 183 </td> 184 <td class="productlist-table-product"> 185 <a href="{{:Link}}" class="productlist-table-name"> 186 {{:Name}} 187 </a> 188 </td> 189 } 190 </tr> 191 {{/for}} 192 </tbody> 193 </table> 194 {{if MoreResults}} 195 <a href="{{:LinkToFullResults}}" class="btn btn-primary btn-sm">@Translate("Show all results") ({{:NumberOfResults}})</a> 196 {{/if}} 197 </script> 198 <script type="text/x-jsrender" id="quicksearchloadingtemplate"> 199 <p class="product-search-label"> 200 <i class="icon-async icon-pulse" aria-hidden="true"></i> @Translate("Searching") 201 </p> 202 </script> 203 <script type="text/x-jsrender" id="noquerytemplate"> 204 <p class="product-search-label"><i class="icon-keyboard" aria-hidden="true"></i> @Translate("Start typing to search")</p> 205 </script> 206 <script type="text/x-jsrender" id="failedsearchtemplate"> 207 <p class="product-search-label"><i class="icon-warning" aria-hidden="true"></i> @Translate("An error occured")</p> 208 </script> 209 <script type="text/x-jsrender" id="noresultstemplate"> 210 <p class="product-search-label"><i class="icon-warning" aria-hidden="true"></i> @Translate("Search found no products")</p> 211 </script> 212 213 <script type="text/x-jsrender" id="qsautoaddfeedbackloading"> 214 <i class="icon-async icon-pulse"></i> 215 </script> 216 <script type="text/x-jsrender" id="qsautoaddfeedbacksuccess"> 217 <i class="icon-added" title="@Translate("Product added to cart")"></i> 218 </script> 219 <script type="text/x-jsrender" id="qsautoaddfeedbackerror"> 220 {{if error == "badinput"}} 221 <i class="icon-warning" title="@Translate("Please enter a numerical value")"></i> 222 {{else error == "servererror"}} 223 <i class="icon-warning" title="@Translate("An server error occured your cart was not updated")"></i> 224 {{else}} 225 <i class="icon-warning"></i> 226 {{/if}} 227 </script> 228 229 <script append="true"> 230 require(["jquery", "standardwebshop/areas/ecom/instantsearch"], function ($, search) { 231 search.init({ 232 WaitTime: 250, 233 $SearchResultTemplate: $('#quicksearchtemplate'), 234 $SearchInput: $('#searchTerm'), 235 $ResultContainer: $('#search-result-container'), 236 $ResultLoadingTemplate: $('#quicksearchloadingtemplate'), 237 $NoQueryTemplate: $('#noquerytemplate'), 238 $FailedSearchTemplate: $('#failedsearchtemplate'), 239 $CollapseContainer: $('#search-result-foldout'), 240 $NoResulsTemplate: $('#noresultstemplate'), 241 $SearchContainer: $('#instantsearch'), 242 LinkToSearchResults: "/default.aspx?ID=@NORRIQ.Common8.Razor.Navigation.GetPageIdByNavigationTag("search")", 243 PostPageId: "@NORRIQ.Common8.Razor.Navigation.GetPageIdByNavigationTag("instant-search")", 244 $searchBtn: $('.js-search-btn') 245 }); 246 }); 247 </script> 248 </div> 249 </li> 250 251 <li class="@(Pageview.Device == Dynamicweb.Frontend.Devices.DeviceType.Desktop ? "dropdown dropdown-hover" : "dropdown") dropdown-icon"> 252 <a href="javascript:void(0)" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> 253 <i class="fa fa-user-circle-o" aria-hidden="true"></i> 254 <span class="dropdown-label"> 255 @if (Pageview.Security.UserLoggedIn) 256 { 257 @Translate("Account") 258 } 259 else 260 { 261 @Translate("Sign in") 262 } 263 </span> 264 </a> 265 @if (Pageview.Security.UserLoggedIn) 266 { 267 <ul class="dropdown-menu"> 268 @RenderNavigation(new { Template = "navbar-nav-customer.xslt", Expandmode = "all", StartLevel = 1, EndLevel = 2 }) 269 <li> 270 <a href="/admin/public/extranetlogoff.aspx?ID=@(Pageview.Page.ID)"> 271 <i class="icon-chevron-left" aria-hidden="true"></i> 272 @Translate("Sign out") 273 </a> 274 </li> 275 </ul> 276 } 277 else 278 { 279 <div class="dropdown-menu user"> 280 @using NORRIQ.Common8.Razor; 281 <form name="ExtUserForm" id="loginForm" method="post" class="form" role="form" action="@(System.Web.HttpContext.Current.Request.Url.PathAndQuery)"> 282 <input type="hidden" name="pid" value="@Pageview.Page.ID" /> 283 <div class="form-group"> 284 <label for="Username">@Translate("Username")</label> 285 <input id="Username" name="Username" type="text" value="" class="form-control" autocomplete="off"> 286 </div> 287 <div class="form-group"> 288 <label for="Password">@Translate("Password")</label> 289 <input id="Password" name="Password" type="password" value="" class="form-control" autocomplete="off"> 290 </div> 291 <div class="form-group"> 292 <div id="loginFeedback"></div> 293 <button type="submit" role="button" class="btn btn-primary btn-block" id="loginBtn"> 294 @Translate("Sign in") 295 </button> 296 </div> 297 <ul class="form-login-links"> 298 <li> 299 <a href="@NORRIQ.Common8.Razor.Navigation.GetUrlByNavigationTag("forgot-password")">@Translate("Forgot password")</a> 300 </li> 301 <li> 302 <a href="@NORRIQ.Common8.Razor.Navigation.GetUrlByNavigationTag("new-user")">@Translate("Register user")</a> 303 </li> 304 </ul> 305 </form> 306 <script id="loginBtnDefaultTemplate" type="text/x-jsrender"> 307 @Translate("Sign in") 308 </script> 309 <script id="loginBtnLoggingInTemplate" type="text/x-jsrender"> 310 <i class="icon-async icon-pulse" aria-hidden="true"></i> @Translate("Signing in") 311 </script> 312 <script id="loginLoadingTemplate" type="text/x-jsrender"> 313 <p class="user-login-loading"><i class="icon-async icon-pulse" aria-hidden="true"></i> @Translate("Signing in")</p> 314 </script> 315 <script id="loginErrorTemplate" type="text/x-jsrender"> 316 <p class="user-login-error">@Translate("An error occured!")</p> 317 </script> 318 <script id="loginBadLoginInfoTemplate" type="text/x-jsrender"> 319 <p class="user-login-error">@Translate("Username or password is incorrect!")</p> 320 </script> 321 </div> 322 } 323 </li> 324 @{ 325 double quantity = 0; 326 double testquantity = 0; 327 var emptyCart = Translate("Your cart is empty", "Your cart is empty"); 328 var dropdown = string.Format("title=\"{0}\"", emptyCart); 329 var pageTypeDefined = Model.Item.GetValue<ListViewModel>("PageType"); 330 var pageType = "default"; 331 if (pageTypeDefined != null) 332 { 333 pageType = Model.Item.GetValue<ListViewModel>("PageType").SelectedValue; 334 } 335 if (!isCartEmpty) 336 { 337 quantity = Model.Cart.TotalProductsCount; 338 testquantity = Model.Cart.TotalProductsCount; 339 dropdown = "class=\"dropdown-toggle dropdown-minicart\" data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\""; 340 } 341 } 342 @if (pageType != "cart") 343 { 344 345 <li class="@(Pageview.Device == Dynamicweb.Frontend.Devices.DeviceType.Desktop && !isCartEmpty ? "dropdown" : "dropdown") dropdown-icon" id="cart-information"> 346 <a href="Default.aspx?ID=3"> 347 348 <i class="fa fa-shopping-basket" aria-hidden="true"></i> 349 <span class="dropdown-label">@Translate("Cart", "Cart")</span> 350 @if (!isCartEmpty && Pageview.Security.UserLoggedIn || !isCartEmpty) 351 { 352 <span class="dropdown-qty">@quantity</span> 353 } 354 </a> 355 356 </li> 357 358 } 359 <li class="dropdown dropdown-icon dropdown-mobile"> 360 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> 361 <i class="fa fa-bars"></i> 362 <span class="dropdown-label">Menu</span> 363 </a> 364 @RenderNavigation(new { Template = "navbar-nav-dropdown-goodskin.xslt", Expandmode = "all", StartLevel = 1, EndLevel = 2 }) 365 </li> 366 </ul> 367 <!-- Mini-cart dropdown --> 368 <div class="cart-dropdown-wrapper"> 369 <div class="mini-cart-dropdown"> 370 <div class="mini-cart-dropdown__inner" > 371 <p>@Translate("Indkøbskurv")</p> 372 <ul class="cart-items"> 373 @{ 374 Dynamicweb.Ecommerce.Orders.Order cartContext = Dynamicweb.Ecommerce.Common.Context.Cart; 375 var cartPageId = 1335; 376 377 } 378 379 @if (cartContext != null) 380 { 381 382 foreach (var ol in cartContext.ProductOrderLines) 383 { 384 var product = ol.Product; 385 var link = "/Default.aspx?ID=2&productid=" + product.Id; 386 var productImage = "/Files" + product.ImageLarge; 387 var productQuant = cartContext.OrderLines.Where(x => x.ProductId == product.Id).FirstOrDefault(); 388 var currentProductCountDec = productQuant.Quantity - 1; 389 var priceInclDiscount = Math.Round(product.Price.Price + productQuant.TotalDiscount.Price, 2); 390 var orderlineTotatPrice = Math.Round(ol.Price.Price + productQuant.TotalDiscount.Price, 2); 391 var price2InclDiscount = orderlineTotatPrice / ol.Quantity; 392 var testProductPrice = Math.Abs(ol.TotalDiscount.PriceWithVAT / ol.Quantity); 393 var unitprice = ol.UnitPrice.PriceWithVAT; 394 var totalPrice = ol.TotalDiscount.PriceWithVAT; 395 396 <li data-id="@product.Id" class="item"> 397 398 <a href="@link"><img src="/admin/Public/GetImage.ashx?Width=86&amp;Height=125&amp;Crop=5&amp;Compression=70&Image=@productImage"></a> 399 400 <div class="right"> 401 <div> 402 <a class="title" href="@link">@product.Name</a> 403 @if (!string.IsNullOrWhiteSpace(product.Manufacturer.Name)) 404 { 405 <p>@product.Manufacturer.Name</p> 406 } 407 </div> 408 <div class="price"> 409 <p>@price2InclDiscount.ToString("0.00") @cartContext.CurrencyCode</p> 410 411 <p>x @productQuant.Quantity</p> 412 413 <p> @orderlineTotatPrice.ToString("0.00") DKK</p> 414 </div> 415 <div class="options"> 416 <a href="/Default.aspx?Id=@(cartPageId)&OrderContext=@(cartContext.OrderContextId)&CartCmd=DelOrderLine&key=@(ol.Id)&cartrouteid=@(Pageview.ID)&redirect=false"> 417 <i class="icon-trash" aria-hidden="true"></i> @Translate("Slet Vare") 418 </a> 419 </div> 420 </div> 421 </li> 422 } 423 } 424 else 425 { 426 <li class="no-items"> 427 <div> 428 <p>@Translate("Kurven er tom")</p> 429 <p>@Translate("Click og se vores produktudvalg:")</p> 430 </div> 431 </li> 432 } 433 434 </ul> 435 <ul class="cart-actions"> 436 @if (cartContext != null) 437 { 438 if (cartContext.ShippingFee.Price > 0) 439 { 440 var rest = Math.Round(200 - cartContext.OrderLines.Price.Price, 2); 441 <li class="shipping-alert"> 442 <div class="alert alert-warning">Køb for @rest DKK mere og få fri fragt</div> 443 </li> 444 } 445 446 <li class="shipping-fee"> 447 <div>Levering</div> 448 <div>@cartContext.ShippingFee</div> 449 </li> 450 <li class="price-total"> 451 <div>Total</div> 452 <div>@Math.Round(Model.Cart.TotalPrice.PriceWithVat.Value, 2) @cartContext.CurrencyCode</div> 453 454 </li> 455 } 456 @if (cartPage != null && cartContext != null) 457 { 458 <li><a href="/Default.aspx?ID=@cartPage.ID" class="btn btn-lg">@Translate("Gå til kurv")</a></li> 459 } 460 else 461 { 462 <li><a href="/Default.aspx?ID=@cartPageEmpty.ID" class="btn btn-lg">@Translate("Gå til shop")</a></li> 463 } 464 </ul> 465 466 </div> 467 </div> 468 </div> 469 <!-- Mini-cart dropdown --> 470 471 </div> 472 @if (isMobile == "true"){ 473 @SnippetStart("moveUSP") 474 } 475 <div class="row"> 476 <div class="col-xs-12"> 477 <div class="checkout-assurance-box clearfix"> 478 <div class="col-sm-4 col-md-4"><i class="fa fa-truck fa-flip-horizontal"></i><span><strong>@Translate("FRI FRAGT")</strong>@Translate("<br/>På alle ordrer")</span></div> 479 <div class="col-sm-4 col-md-4"><i class="fa fa-clock-o"></i><span><strong>@Translate("HURTIG LEVERING","HURTIG LEVERING")</strong><br/>@Translate("1-3 hverdage","1-3 hverdage")</span></div> 480 <div class="col-sm-4 col-md-4"><a href="https://certifikat.emaerket.dk/goodskin.dk" class="e-maerket" title='@Translate("Se Goodskins E-mærke")' target="_blank"><img src="/Files/Templates/Designs/StandardWebshop/Images/e-maerket.png" /></a><span><strong>@Translate("E-MÆRKET","E-MÆRKET")</strong><br/>@Translate("Certificeret webshop","Certificeret webshop")</span></div> 481 </div> 482 483 </div> 484 </div> 485 @if (isMobile == "true"){ 486 @SnippetEnd("moveUSP") 487 } 488 </div> 489 </header> 490 491 492 493 <script append="true"> 494 $('#cart-information > a, .cart-dropdown-wrapper').mouseenter(function () { 495 if ($(window).width() >= 1007) { 496 $('.cart-dropdown-wrapper').show(); 497 } 498 499 }).mouseleave(function () { 500 $('.cart-dropdown-wrapper').hide(); 501 }); 502 </script> 503 504 505 @using Dynamicweb.Ecommerce.Products 506 @using Dynamicweb.Frontend 507 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 508 509 @Title("Standad Page") 510 @Description("Page Template") 511 512 @{ 513 var image = Model.Item.GetFile("PageImage"); 514 var ImageHeight = Model.Item.GetValue<ListViewModel>("ImageHeight").SelectedValue; 515 var PageText = Model.Item.GetString("Text"); 516 var PageType = Model.Item.GetValue<ListViewModel>("PageType").SelectedValue; 517 // If Password is enabled on page PageType is empty so set it to default 518 if (string.IsNullOrEmpty(PageType)) 519 { 520 PageType = "default"; 521 } 522 523 var ecomquery = System.Web.HttpContext.Current.Request.QueryString["ecomQuery"]; 524 var prodid = System.Web.HttpContext.Current.Request.QueryString["productid"]; 525 var groupid = System.Web.HttpContext.Current.Request.QueryString["groupid"]; 526 } 527 @if (!Pageview.IsCurrentUserAllowed && !Pageview.Security.UserLoggedIn) 528 { 529 <main data-page-type="protected"> 530 <div class="container"> 531 <h1 class="title-styled" data-align="center"> 532 @Model.Area.Item.GetString("RestrictedTitle") 533 </h1> 534 <div class="row-flex"> 535 @if (!String.IsNullOrEmpty(Model.Area.Item.GetString("NewUserText"))) 536 { 537 <div class="col-xs-12 col-sm-6 col-md-5 col-md-offset-1" data-display="flex"> 538 <div data-align="left" data-content-border="boxed" data-content-type="box"> 539 @Model.Area.Item.GetString("LoginText") 540 @using NORRIQ.Common8.Razor; 541 @{ 542 var ResetPassword = "/kundeservice/glemt-adgangskode"; 543 } 544 <form name="ExtUserForm" id="loginForm" method="post" class="form" role="form" action="@(System.Web.HttpContext.Current.Request.Url.PathAndQuery)"> 545 <div class="form-group"> 546 <label for="Username">@Translate("Username")</label> 547 <input id="Username" name="Username" type="text" value="" class="form-control" autocomplete="off"> 548 </div> 549 <div class="form-group"> 550 <label for="Password">@Translate("Password")</label> 551 <input id="Password" name="Password" type="password" value="" class="form-control" autocomplete="off"> 552 </div> 553 <div id="loginFeedback"></div> 554 555 <a href="@ResetPassword" class="forgot-password">@Translate("Forgot password")</a> 556 557 <button type="submit" role="button" class="btn btn-primary" id="loginBtn" data-float="right"> 558 @Translate("Sign in") 559 </button> 560 </form> 561 <script id="loginBtnDefaultTemplate" type="text/x-jsrender"> 562 @Translate("Sign in") 563 </script> 564 <script id="loginBtnLoggingInTemplate" type="text/x-jsrender"> 565 <i class="icon-async icon-pulse" aria-hidden="true"></i> @Translate("Signing in") 566 </script> 567 <script id="loginLoadingTemplate" type="text/x-jsrender"> 568 <p class="user-login-loading"><i class="icon-async icon-pulse" aria-hidden="true"></i> @Translate("Signing in")</p> 569 </script> 570 <script id="loginErrorTemplate" type="text/x-jsrender"> 571 <p class="user-login-error">@Translate("An error occured!")</p> 572 </script> 573 <script id="loginBadLoginInfoTemplate" type="text/x-jsrender"> 574 <p class="user-login-error">@Translate("Username or password is incorrect!")</p> 575 </script> 576 </div> 577 </div> 578 <div class="col-xs-12 col-sm-6 col-md-5" data-display="flex"> 579 <div data-align="left" data-content-border="boxed" data-content-type="box"> 580 @Model.Area.Item.GetString("NewUserText") 581 </div> 582 </div> 583 } 584 else 585 { 586 <div class="col-xs-12 col-sm-6 col-sm-offset-3 col-md-4 col-md-offset-4" data-display="flex"> 587 <div data-align="left" data-content-border="boxed" data-content-type="box"> 588 @Model.Area.Item.GetString("LoginText") 589 @using NORRIQ.Common8.Razor; 590 @{ 591 var ResetPassword = "/kundeservice/glemt-adgangskode"; 592 } 593 <form name="ExtUserForm" id="loginForm" method="post" class="form" role="form" action="@(System.Web.HttpContext.Current.Request.Url.PathAndQuery)"> 594 <div class="form-group"> 595 <label for="Username">@Translate("Username")</label> 596 <input id="Username" name="Username" type="text" value="" class="form-control" autocomplete="off"> 597 </div> 598 <div class="form-group"> 599 <label for="Password">@Translate("Password")</label> 600 <input id="Password" name="Password" type="password" value="" class="form-control" autocomplete="off"> 601 </div> 602 <div id="loginFeedback"></div> 603 604 <a href="@ResetPassword" class="forgot-password">@Translate("Forgot password")</a> 605 606 <button type="submit" role="button" class="btn btn-primary" id="loginBtn" data-float="right"> 607 @Translate("Sign in") 608 </button> 609 </form> 610 <script id="loginBtnDefaultTemplate" type="text/x-jsrender"> 611 @Translate("Sign in") 612 </script> 613 <script id="loginBtnLoggingInTemplate" type="text/x-jsrender"> 614 <i class="icon-async icon-pulse" aria-hidden="true"></i> @Translate("Signing in") 615 </script> 616 <script id="loginLoadingTemplate" type="text/x-jsrender"> 617 <p class="user-login-loading"><i class="icon-async icon-pulse" aria-hidden="true"></i> @Translate("Signing in")</p> 618 </script> 619 <script id="loginErrorTemplate" type="text/x-jsrender"> 620 <p class="user-login-error">@Translate("An error occured!")</p> 621 </script> 622 <script id="loginBadLoginInfoTemplate" type="text/x-jsrender"> 623 <p class="user-login-error">@Translate("Username or password is incorrect!")</p> 624 </script> 625 </div> 626 </div> 627 } 628 </div> 629 </div> 630 </main> 631 } 632 else 633 { 634 if (image != null) 635 { 636 <div class="pageimage" style="background-image:url(@image.Path);"></div> 637 } 638 @RenderBreadcrumb() 639 <main class="page-content" data-page-type="@PageType"> 640 @if (PageType == "default") 641 { 642 <div class="container"> 643 <div class="row-flex"> 644 <div class="col-xs-12 col-sm-12 col-md-3" data-content="sidebar" id="sidebar"> 645 @RenderNavigation() 646 @RenderSidebar() 647 </div> 648 <div class="col-xs-12 col-sm-12 col-md-9 pull-right"> 649 @RenderHeader() 650 @RenderPageText() 651 @RenderPrimary() 652 @RenderSecondary() 653 @RenderTertiary() 654 </div> 655 </div> 656 </div> 657 } 658 else if (PageType == "ecom") 659 { 660 <div class="container"> 661 @RenderPageText() 662 @RenderPrimary() 663 @RenderSecondary() 664 @RenderTertiary() 665 @RenderSidebar() 666 </div> 667 } 668 else if (PageType == "boxed" || PageType == "cart" || PageType == "frontpage") 669 { 670 <div class="container"> 671 @RenderHeader() 672 @RenderPageText() 673 @RenderPrimary() 674 @RenderSecondary() 675 @RenderTertiary() 676 @RenderSidebar() 677 </div> 678 } 679 </main> 680 } 681 682 683 @* Default content for pages *@ 684 @helper RenderPrimary() 685 { 686 if (!String.IsNullOrEmpty(Model.Placeholder("Primary"))) 687 { 688 <div class="row-flex"> 689 @Model.Placeholder("Primary", "Content", "unwrap:true;default:true") 690 </div> 691 } 692 } 693 @helper RenderSecondary() 694 { 695 if (!String.IsNullOrEmpty(Model.Placeholder("Secondary"))) 696 { 697 <div class="row-flex"> 698 @Model.Placeholder("Secondary", "Content", "unwrap:true") 699 </div> 700 } 701 } 702 @helper RenderTertiary() 703 { 704 if (!String.IsNullOrEmpty(Model.Placeholder("Tertiary"))) 705 { 706 <div class="row-flex"> 707 @Model.Placeholder("Tertiary", "Content", "unwrap:true") 708 </div> 709 } 710 } 711 @helper RenderSidebar() 712 { 713 if (!String.IsNullOrEmpty(Model.Placeholder("Sidebar"))) 714 { 715 <div class="row-flex"> 716 @Model.Placeholder("Sidebar", "Sidebar", "unwrap:true") 717 </div> 718 } 719 } 720 @helper RenderNavigation() 721 { 722 <nav id="desktop-menu"> 723 @RenderNavigation(new { Template = "nav-sidebar.xslt", Expandmode = "all", StartLevel = 1, EndLevel = 4 }) 724 </nav> 725 } 726 @helper RenderBreadcrumb() 727 { 728 // Model.PropertyItem may sometimes be null, thus we must check for it. 729 if (Model.PropertyItem != null) 730 { 731 if (!Model.PropertyItem.GetBoolean("HideBreadcrumb")) 732 { 733 <nav class="clearfix breadcrumb-container"> 734 <div class="container"> 735 736 <ol class="breadcrumb"> 737 @RenderNavigation(new {Template = "breadcrumb.xslt", StartLevel = 1, EndLevel = 3}) 738 @{ 739 var productId = System.Web.HttpContext.Current.Request.QueryString["ProductID"]; 740 } 741 @*@if (productId != null) 742 { 743 var product = Product.GetProductById(productId); 744 if (product != null) 745 { 746 <li><span class="disabled">@(product.Name)</span></li> 747 } 748 }*@ 749 </ol> 750 751 </div> 752 </nav> 753 } 754 } 755 } 756 @helper RenderHeader() 757 { 758 if (Model.Item.GetValue<ListViewModel>("TitleStyle").SelectedValue != "hidden") 759 { 760 var TitleStyle = Model.Item.GetValue<ListViewModel>("TitleStyle").SelectedValue; 761 <header> 762 <h1 class="@TitleStyle"> 763 @Model.Item.GetString("Title") 764 </h1> 765 </header> 766 } 767 } 768 769 @helper RenderPageText() 770 { 771 if (!String.IsNullOrEmpty(Model.Item.GetString("Text"))) 772 { 773 <div class="pagetext"> 774 @Model.Item.GetString("Text") 775 if (!String.IsNullOrEmpty(Model.Item.GetString("Link")) && !String.IsNullOrEmpty(Model.Item.GetString("LinkText"))) 776 { 777 <p> 778 <a class="btn btn-primary" href="@Model.Item.GetString("Link")"> 779 @Model.Item.GetString("LinkText") 780 </a> 781 </p> 782 } 783 <hr /> 784 </div> 785 } 786 } 787 788 @RenderItemList(new 789 { 790 ItemType = "Footer", 791 ListSourceType = "SelfArea", 792 ItemFieldsList = "*", 793 IncludeParagraphItems = true, 794 IncludeAllChildItems = true, 795 ListOrderBy = "Sort", 796 ListTemplate = "ItemPublisher/List/Footer.cshtml", 797 ListPageSize = "100", 798 }) 799 800 <script append="true"> 801 require(['standardwebshop/areas/user/login'], function (AsyncLogin) { 802 var login = new AsyncLogin({ 803 $loginForm: $("#loginForm"), 804 $username: $("#Username"), 805 $password: $("#Password") 806 }); 807 login.init(); 808 809 }); 810 @if(!Dynamicweb.Environment.CookieManager.CookieOptInLevelExists){ 811 <text> 812 var cookieText = "@Model.Area.Item.GetString("CookieText").Replace("\"", "'").Replace(Environment.NewLine,"")"; 813 </text> 814 } 815 </script> 816 817 @if (!true) 818 { 819 <script src="/scripts/require.js"></script> 820 @StandardWebshop.CustomCode.Razor.TimestampSource.GetJavaScriptWithTimestamp("/scripts/standardwebshop/main.js") 821 } 822 else 823 { 824 @StandardWebshop.CustomCode.Razor.TimestampSource.GetJavaScriptWithTimestamp("/scripts/standardwebshop/main.min.js") 825 } 826 <script> 827 //Loads master along with the localized validation messages (read from the template tag "lang"). 828 829 @* Loading the datepicker localizations via the aliasses in main.js failed and caused them to be loaded from the original files instead of from the minified file. *@ 830 require(['jQueryUI.localization/jquery.ui.datepicker-en-GB', 'jQueryUI.localization/jquery.ui.datepicker-da'], function () { }); 831 require(['standardwebshop/areas/master'], function (master) { master.init(); }); 832 833 @* Fool the minifier to include all validation localizations, but only trigger the one actually needed. *@ 834 require([], 835 function () { 836 @if (String.Equals(Pageview.Area.Culture.Split('-').First(), "da", StringComparison.OrdinalIgnoreCase)) 837 { 838 <text> 839 require(["jquery.validation-1.13.1/localization/messages_da"], function () { }); 840 require(["additional-methods.min"], function () { }); 841 </text> 842 } else if (String.Equals(Pageview.Area.Culture.Split('-').First(), "en", StringComparison.OrdinalIgnoreCase)) 843 { 844 <text> 845 require(["jquery.validation-1.13.1/localization/messages_en"], function () { }); 846 require(["additional-methods.min"], function () { }); 847 </text> 848 } 849 }); 850 </script> 851 852 <script append="replace"></script> 853 @*@if (!String.IsNullOrEmpty(Model.Area.Item.GetString("Google"))) 854 { 855 <script> 856 (function (i, s, o, g, r, a, m) { 857 i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () { 858 (i[r].q = i[r].q || []).push(arguments) 859 }, i[r].l = 1 * new Date(); a = s.createElement(o), 860 m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m) 861 })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga'); 862 863 ga('create', '@Model.Area.Item.GetString("Google")', 'auto'); 864 ga('send', 'pageview'); 865 </script> 866 }*@ 867 <div class="modal fade" tabindex="-1" role="dialog" id="languages"> 868 <div class="modal-dialog modal-sm" role="document"> 869 <div class="modal-content"> 870 <div class="modal-header"> 871 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> 872 <h4 class="modal-title">@Translate("Change language", "Change language")</h4> 873 </div> 874 <div class="modal-body"> 875 @if (Model.Languages.Any()) 876 { 877 var areaService = NLWI.Core.Factory.ObjectFactory.GetInstance<Dynamicweb.Content.AreaService>(); 878 879 foreach (var lang in Model.Languages) 880 { 881 var area = areaService.GetArea(lang.ID); 882 var Domain = lang.PrimaryDomain; 883 if (string.IsNullOrEmpty(Domain)) 884 { 885 Domain = area.Domain.Split(new char[0]).First(); 886 } 887 888 var Flag = "flag_" + lang.Culture.Split('-').Last() + ".png"; 889 890 <a href='//@Domain'> 891 <img src="/Admin/Images/Flags/@Flag" alt="@lang.Culture.Split('-').Last()-Flag" class="img-responsive lang-select" /> 892 </a> 893 } 894 } 895 </div> 896 </div> 897 </div> 898 </div> 899 900 </body> 901 </html>