Exception in template (Designs/BSE/_parsed/Catalog.parsed.cshtml): System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.ccacaf.Execute()
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context)
   at RazorEngine.Razor.Parse[T](String razorTemplate, T model, String cacheName)
   at Dynamicweb.Rendering.Template.Output()
@using System.Text.RegularExpressions @using Dynamicweb @using Dynamicweb.Modules.UserManagement @using System.Web.Optimization <!DOCTYPE html> <html lang="en"> @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @{ Dynamicweb.Modules.UserManagement.User user = Dynamicweb.Modules.UserManagement.User.get_Current(PagePermissionLevels.Frontend); #region custom fields //user custom fields validation string digitalCustomer = ""; string digitalDistributer = ""; string t_NoProductsFound = Translate("t_NoProductsFound"); string googleAnalytics = Dynamicweb.Frontend.PageView.Current().Area.Item["GoogleAnalyticsID"].ToString(); var cartPage = Base.ChkString(Dynamicweb.Frontend.PageView.Current().Area.Item["Ajax_CartPageID"]); var cartPageId = Regex.Match(cartPage, @"\d+").Value; try { if (user != null) { digitalCustomer = user.CustomFieldValues.Find(p => p.CustomField.SystemName.Equals("AccessUser_EGDivibibCustomer")).Value.ToString(); digitalDistributer = user.CustomFieldValues.Find(p => p.CustomField.SystemName.Equals("AccessUser_EGEmediaVendId")).Value.ToString(); } } catch { } if (digitalCustomer == null || digitalCustomer.Equals("")) { digitalCustomer = "False"; } if (digitalDistributer == null || digitalDistributer.Equals("")) { digitalDistributer = "False"; } #endregion string favico = Dynamicweb.Frontend.PageView.Current().Area.Item["FavIco"].ToString(); } <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="author" content=""> <title>@GetValue("Title")</title> @GetValue("MetaTags") @GetValue("CopyRightNotice") <link rel="SHORTCUT ICON" href="@favico"> <!-- Bootstrap Core CSS --> <link href="/Files/Templates/Designs/BS/css/bootstrap.min.css" rel="stylesheet"> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> <![endif]--> @Styles.Render("~/bundles/plugins/styles/bse_base") <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> <link href="http://getbootstrap.com/examples/offcanvas/offcanvas.css" rel="stylesheet" media="screen"> <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> @{ if (Dynamicweb.Frontend.PageView.Current().Device == Dynamicweb.Frontend.PageView.DeviceType.Desktop) { //Bot //Desktop //Mobile //Tablet } } @{ // Trizzy BSE @Styles.Render("~/bundles/plugins/styles/Trizzy_BSE_Base") @Styles.Render("~/bundles/plugins/styles/Trizzy_BSE_PurpleColor") // BSE @Styles.Render("~/bundles/plugins/styles/BSE") } <style> </style> @RenderSnippet("HeaderStyles") <!-- Google Analytics --> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); ga('create', '@googleAnalytics', 'auto'); ga('send', 'pageview'); </script> <!-- End Google Analytics --> @GetValue("Stylesheets") @GetValue("Javascripts") </head> <body class="fullwidth" data-menu-position="closed"> @{ if (System.Web.HttpContext.Current.Items["ibx-feedback"] != null) { string IBX_feedback = (string)System.Web.HttpContext.Current.Items["ibx-feedback"]; <div class="ibx_feedback_container"> @{ if (IBX_feedback.Substring(0, 2) == "OK") { // all is OK var username = IBX_feedback.Remove(0, 3); <div class="alert alert-success fade in ibx_feedback_message"> <a href="#" class="close " data-dismiss="alert" aria-label="close">&times;</a> <strong>@Translate("Innlogging vellykket"). </strong>@Translate("Autentisert som") @username! </div> } else { // error happened string[] ibx_error_data = IBX_feedback.Split('|'); if (ibx_error_data.Any() && ibx_error_data.Count() > 1) { <div class="alert alert-warning fade in ibx_feedback_message"> <a href="#" class="close " data-dismiss="alert" aria-label="close">&times;</a> <strong>@Translate("Innlogging feilet").</strong> @ibx_error_data[0] <div>@ibx_error_data[1]</div> </div> } } } </div> } <div class="ibx_debug_container"> IBX DEBUGGING @{ if (System.Web.HttpContext.Current.Session["ibx-userid"] != null) { string IBX_user = (string)System.Web.HttpContext.Current.Session["ibx-userid"]; string IBX_hookUrl = (string)System.Web.HttpContext.Current.Session["ibx-HOOK_URL"]; <div class="ibx_userstatus_container"> @{ <div> <span class="ibx_message">IBX User is active @IBX_user</span> <div class="IBX_hookUrl">IBX_hookUrl:@IBX_hookUrl</div> </div> } </div> } else { <div class="ibx_userstatus_container"> @{ <div> <span class="ibx_message">IBX User NOT ACTIVE</span> </div> } </div> } } </div> } @if (Pageview.Area.ID == 2) // BSE DESIGN { <div> @using System.Collections @using System.Diagnostics @using System.Text.RegularExpressions @using System.Web.Optimization @using Dynamicweb @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> <style> nav.top-search { position: relative; } .search-results-popup { position: absolute; top: 40px; background-color: white; z-index: 10000; right: 0; border: 1px #f4f4f4 solid; } .search-results-popup .thirteen > .columns { margin: 0; } .top-search .fa-spinner { position: absolute; right: 45px; top: 9px; font-size: 22px; } .search-results-popup .thirteen { max-height: 485px; } .search-results-popup h5 { font-size: 14px; font-weight: bold; display: inline; } .search-results-popup .results { padding: 0 0 0 10px; } .search-results-popup .results > span { float: right !important; font-size: 12px !important; } .search-results-popup .results > a { float: right !important; font-size: 12px !important; margin-left: 10px; } .search-results-popup .pages > span { float: right; font-size: 12px; } /* RESULTS */ .search-results-popup .result { cursor: pointer; margin: 10px 0 10px 0; height: 80px; border-style: solid; border-width: 1px; border-color: lightgray; padding: 1px; font-size: 24px; position: relative; } .search-results-popup .result .result-image { height: 76px; margin: 0 1% 0 0; width: 15%; display: inline; float: left; position: relative; } .search-results-popup .result .result-image img { height: initial; margin: auto !important; max-height: 100%; position: absolute; left: 0; top: 0; bottom: 0; border: solid 1px lightgray; margin: 5px !important; height: 66px !important; } .search-results-popup .result .components { width: 83%; float: right; height: 77px; } .search-results-popup .result .result-name { font-size: 12px; margin-top: 10px; } .search-results-popup .result .result-price { font-weight: bold; font-size: 16px; text-transform: uppercase; position: absolute; bottom: 0; margin-bottom: 10px; } .search-results-popup .result .result-button { position: absolute; right: 0; bottom: 0; padding: 0 5px 0 5px; font-size: 10px; margin: 1px; margin: 0 5px 5px 0; } @@media only screen and (max-width: 900px) { .search-results-popup .pages { display: none; } .search-results-popup > div { width: 317px !important; } } /* PAGES */ .search-results-popup .pages { } .search-results-popup .pages a { display: block; color: purple; } .search-results-popup .pages .page { margin-top: 10px; height: 47px; font-size: 12px; } .search-results-popup .pages .page a { height: 33px; line-height: 16px; text-decoration: none !important; } .search-results-popup .pages .page a > span { color: gray; } .search-results-popup .pages .page:hover { background-color: #f0f0f0; } .search-results-popup .pages .page-link { } .search-results-popup .pages a:hover { } #navigation .mega { width: 100%; } .mega-headline { } .mega-headline .mega-group-link { margin-left: 0; } .mega-child-categories a.sub-group-link { text-indent: 10px; } </style> @{ // ## HeaderCollection var headerAreaID = Dynamicweb.Frontend.PageView.Current().Area.Item["HeaderAreaID"].ToString(); var intHeaderAreaID = Regex.Match(headerAreaID, @"\d+").Value; var header_areas = Dynamicweb.Frontend.Page.FindPage(Int32.Parse(intHeaderAreaID)); // ## Login string _loggoutUrl = "/admin/public/ExtranetLogoff.aspx"; // ## PageCollection var pageCollection = Dynamicweb.Frontend.PageView.Current().PageCollection; var temp_pageList = new List<Dynamicweb.Frontend.Page>(); foreach (Dynamicweb.Frontend.Page i in pageCollection.Values) { temp_pageList.Add(i); } var pageCollectionValues = temp_pageList.OrderBy(o => o.Values["pagesort"]).ToList(); // ## Cart var productQuantity = GetInteger("Ecom:Order.OrderLines.TotalQuantity"); var cartTxt = Translate("BSE_Cart"); string cartPageID = Base.ChkString(Dynamicweb.Frontend.PageView.Current().Area.Item["CartPageID"]); string cartUrl = string.Format("{0}", cartPageID); } <div id="wrapper" class="bse-navigation-menu"> <div class="container"> <div class="four columns"> <div id="logo"> @{ string logo = Base.ChkString(Dynamicweb.Frontend.PageView.Current().Area.Item["Logo"]); } <h1><a href="/"><img src="@logo" alt="BS Eurobib"></a></h1> </div> </div> <div class="twelve columns"> @if (Dynamicweb.Frontend.PageView.Current().Device == Dynamicweb.Frontend.PageView.DeviceType.Desktop) { <div id="additional-menu"> <ul> @foreach (var i in header_areas.Children) { var href = i.Values["pagepathurl"]; var menuText = i.Values["pagemenutext"]; switch (menuText.ToString().ToLower()) { case "logg inn": if (user == null) { <li role="presentation" class=""><a href="#" onclick="showLoginModal()">@menuText</a></li> } else { <li role="presentation" class=""><a href="@_loggoutUrl">@Translate("Logg ut")<span> (@user.CustomerNumber)</span></a></li> } break; default: <li role="presentation" class=""><a href="@href">@menuText</a></li> break; } } </ul> </div> } </div> <div class="twelve columns"> <div id="cart"> @{ if (Dynamicweb.Frontend.PageView.Current().Device == Dynamicweb.Frontend.PageView.DeviceType.Desktop) { <div class="cart-btn"> <a href="@cartUrl" class="button adc">@string.Format("{0}", cartTxt)<span>@string.Format(" ({0})", productQuantity)</span></a> </div> } else { <div class="cart-btn"> <a href="@cartUrl" class="button adc"><span>@string.Format(" ({0})", productQuantity)</span></a> </div> } } </div> <nav class="top-search"> <form action="#" method="get"> <button id="searchButton" class=""><i class="fa fa-search"></i></button> <input class="search-field" type="text" placeholder="Søk" value="" style="line-height: initial;"> <i class="fa fa-spinner fa-spin" aria-hidden="true" style="display: none;"></i> </form> <div class="search-results-popup" style="display: none;"> </div> </nav> </div> </div> <div style="width:100%; background-color:#606060; margin-top:10px;"> <div class="sixteen columns container"> <a href="#menu" class="menu-trigger"><i class="fa fa-bars"></i> Meny</a> <nav id="navigation"> <ul class="menu" style="margin:0;" id="responsive"> <li><a href="/" class="current homepage" id="current">Forsiden</a></li> @{ if (Dynamicweb.Frontend.PageView.Current().Device != Dynamicweb.Frontend.PageView.DeviceType.Desktop) { foreach (var i in header_areas.Children) { var href = i.Values["pagepathurl"]; var menuText = i.Values["pagemenutext"]; switch (menuText.ToString().ToLower()) { case "logg inn": if (user == null) { <li><a href="#" onclick="showLoginModal()">@menuText</a></li> } else { <li><a href="@_loggoutUrl">@Translate("Logg ut")<span> (@user.CustomerNumber)</span></a></li> } break; case "min side": break; default: <li><a href="@href">@menuText</a></li> break; } } } foreach (Dynamicweb.Frontend.Page i in pageCollectionValues) { if (i.AreaID == Dynamicweb.Frontend.PageView.Current().Area.ID && i.Parent == null && (bool)i.Values["pageactive"] && (!(bool)i.Values["pagehidden"]) && (DateTime)i.Values["pageactivefrom"] < DateTime.Now && (DateTime)i.Values["pageactiveto"] > DateTime.Now && (bool)Dynamicweb.Security.IsCurrentUserAllowed(i)) { var href = i.Values["pagepathurl"]; var menuText = Base.ChkString(i.Values["pagemenutext"]); var active = ""; var currentId = Base.ChkInteger(GetGlobalValue("Global:Page.ID")); if (hasActiveChild(i.ID, currentId)) { active = "active"; } <li class="@active"> @switch (menuText) { case "Produkter": if (Dynamicweb.Frontend.PageView.Current().Device == Dynamicweb.Frontend.PageView.DeviceType.Desktop) { <a class="menu-products-dropdown-link" href="#">@menuText</a> @renderProductMenu() } else { <a class="menu-products-dropdown-link" href="#">@menuText</a> @renderProductMenu() } break; default: <a href="@href">@menuText</a> break; } </li> } } } </ul> </nav> </div> </div> </div> @helper renderProductMenu() { var shopGroup = Dynamicweb.eCommerce.Shops.Shop.getShops().FirstOrDefault().Groups; var baseProductHref = Base.ChkString(Dynamicweb.Frontend.PageView.Current().Area.Item["ProdCatalog"]); <div class="mega"> <div class="mega-container"> <div class="one-half-column columns mega-first-category"> <ul> @foreach (var group in shopGroup) { if (!group.NavigationShowInMenu) { continue; } if (group.ParentGroups.Count == 0) { <li><span class="mega-headline mega-main-item" data-group="@group.ID">@group.Name<span class="mega-main-item-expand">&#9656;</span></span></li> } } </ul> </div> @foreach (var group in shopGroup) { if (!group.NavigationShowInMenu) { continue; } if (group.ParentGroups.Count == 0) { var topGroupLink = String.Format("{0}&GroupID={1}", baseProductHref, group.ID); var imgsrc = ""; try { var imgPath = (string)group.ProductGroupFieldValues.GetProductGroupFieldValue("GroupSecondaryImage1").Value; if (!String.IsNullOrWhiteSpace(imgPath)) { imgsrc = String.Format("/Files/Images/{0}", imgPath); } } catch { } <div class="bse four-half-column columns mega-child-categories" data-groupchildren="@group.ID"> @{ var showSmallText = group.Subgroups.Any(x => x.HasChildGroups); } @if (!showSmallText) { <div class="one-half-column columns"> <ul> <li> <span class="mega-headline"> <a class="mega-group-link" href="@topGroupLink">@group.Name</a> </span> </li> @foreach (var subGroup in group.Subgroups) { var groupLink = String.Format("{0}&GroupID={1}", baseProductHref, subGroup.ID); <li> <a class="sub-group-link" href="@groupLink">@subGroup.Name</a> </li> } </ul> </div> } else { foreach (var subgroup in group.Subgroups) { var subTopGroupLink = String.Format("{0}&GroupID={1}", baseProductHref, subgroup.ID); <div class="one-half-column columns"> <ul> <li> @{ var isMegaHead = showSmallText ? "mega-headline" : ""; var isMegaLink = showSmallText ? "mega-group-link" : ""; } <span class="@isMegaHead"> <a class="@isMegaLink" href="@subTopGroupLink">@subgroup.Name</a> </span> </li> @foreach (var subSubGroup in subgroup.Subgroups) { var groupLink = String.Format("{0}&GroupID={1}", baseProductHref, subSubGroup.ID); <li> <a class="sub-group-link" href="@groupLink">@subSubGroup.Name</a> </li> } </ul> </div> } } <div class="one-half-column columns mega-group-image-container"> @if (!String.IsNullOrWhiteSpace(imgsrc)) { imgsrc = string.Format("/admin/public/getimage.ashx?Image={0}&height=380&width=240", imgsrc); <img class="mega-group-image" style="width:auto;" src="@imgsrc"> } </div> </div> } } <div class="clearfix"></div> </div> </div> } @functions { public bool hasActiveChild(int navigationID, int currentPageId) { if (navigationID == currentPageId) { return true; } var currentPage = Dynamicweb.Frontend.Page.FindPage(currentPageId); if (currentPage.Parent == null) { return false; } var iteratingPageID = currentPage.Parent.ID; var tooLarge = 0; while (iteratingPageID != 0 && iteratingPageID > 0 && tooLarge < 10) { var page = Dynamicweb.Frontend.Page.FindPage(iteratingPageID); iteratingPageID = page != null ? page.ID : 0; if (navigationID == iteratingPageID) { return true; } if (page.Parent == null) { return false; } iteratingPageID = page.Parent.ID; tooLarge++; } return false; } } @Scripts.Render("~/bundles/plugins/scripts/logic/BSE_Header_Fixed_Navbar") <script> </script> </div> <div> @using BS.Common @{ string bs_loginbox_username = Translate("bs_loginbox_username","Brukernavn"); string bs_loginbox_password = Translate("bs_loginbox_password","Passord"); string bs_loginbox_logout = Translate("bs_loginbox_logout","Logg Ut"); string bs_loginbox_login_title = Translate("bs_loginbox_login_title","Logg inn"); string bs_loginbox_login_btn = Translate("bs_loginbox_login_btn","Logg inn"); string bs_loginbox_remember = Translate("bs_loginbox_remember","Husk innloggingen min"); string bs_loginbox_contactinfo = Translate("bs_loginbox_contactinfo","Hvis du har problemer med å få tilgang til kontoen din, kan du kontakte"); string bs_loginbox_error_msg = Translate("bs_loginbox_error_msg"); string bs_loginbox_new_customer = Translate("bs_loginbox_new_customer"); string bs_loginbox_new_customer_link = Translate("bs_loginbox_new_customer_link"); int areaID = Pageview.Area.ID; var GlobalSolution_ConfigReader = new GlobalSolution_ConfigReader(); //var login_loginPageID = 1004; int login_loginPageID = GlobalSolution_ConfigReader.getPageID_ByArea("LoginPageID", string.Format("Area_{0}", areaID.ToString())); //var Ajax_Login = 2034; int Ajax_Login = GlobalSolution_ConfigReader.getPageID_ByArea("Ajax_LoginPageID", string.Format("Area_{0}", areaID.ToString())); string loggoutUrl = "/admin/public/ExtranetLogoff.aspx?ID=" + login_loginPageID.ToString(); var grantAccess = false; grantAccess = (GetGlobalValue("Global:Page.IsCurrentUserAllowed") == "True") ? true : false; int huskelister_PageID = GlobalSolution_ConfigReader.getPageID_ByArea("Huskelister", string.Format("Area_{0}", areaID.ToString())); string huskelister_url = string.Format("/Default.aspx?id={0}", huskelister_PageID.ToString()); string bs_razorlogin_forgotpass = Translate("bs_razorlogin_forgotpass"); string forgotPasswordLink = "/Glemt%20passord.aspx?LoginAction=Recovery"; } @if (!string.IsNullOrWhiteSpace(GetGlobalValue("Global:Extranet.UserName")) && grantAccess) { string user_Name = GetGlobalValue("Global:Extranet.Name"); string user_Detail = ""; string t_Minside = Translate("t_Minside"); string t_Huskelister = Translate("t_Huskelister"); string minside_url = Dynamicweb.Frontend.PageView.Current().Area.Item["MinSide"].ToString(); <a href="#" class="btn btn-large btn-primary loginButtonLarge" style="display: none;"><i class="fa fa-user fa-fw"></i><span class="hidelogintext_fix">@Translate("Bruker")</span></a> <div class="UserMenuExpand"> <img src="/Files/Templates/Designs/BS/img/PopupArrow.png" class="popupArrow"> <button type="button" class="close close_UserMenuExpand">&times;</button> <span class="auth_Name">@user_Name</span> <span class="auth_status">@user_Detail</span> <p><a href="@minside_url">@t_Minside</a>&nbsp;|&nbsp;<a href="@huskelister_url">@t_Huskelister</a></p> <a href="@loggoutUrl" class="logout_ButtonLarge btn btn-default btn-xs">@bs_loginbox_logout @GetGlobalValue("Global:Extranet.UserName")</a> </div> } else { string bs_loginbox_username_input = Translate("bs_loginbox_username_input"); string bs_loginbox_password_input = Translate("bs_loginbox_password_input"); <a href="#ModalLogin" role="button" class="btn btn-large btn-default loginLink" data-toggle="modal" style="display: none;"><i class="fa fa-user fa-fw"></i><span class="hidelogintext_fix">@Translate("Logg inn")</span></a> <div id="ModalLogin" class="modal fade"> <div class="modal-dialog LoginModal"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> <h2 class="form-signin-heading">@bs_loginbox_login_title</h2> </div> <div class="modal-body"> <p style="display: none;">@Translate("bs-login-before-add-to-cart", "bs-login-before-add-to-cart")</p> <div id="login-error-box" style="display: none;" class="alert alert-danger">@bs_loginbox_error_msg</div> <div class="row"> <label for="inputEmail" class="">@bs_loginbox_username</label> <div class="inner-addon left-addon button_margin_15"> <i class="glyphicon glyphicon-user login_UserName_glyph"></i> <input type="text" id="inputEmail" class="form-control input-lg " placeholder="@bs_loginbox_username_input" required="" autofocus=""> </div> <label for="inputPassword" class=" ">@bs_loginbox_password</label> <div class="inner-addon left-addon"> <i class="glyphicon glyphicon-lock login_Password_glyph"></i> <input type="password" id="inputPassword" onkeypress="passwordEnterInput(event, @Ajax_Login)" class="form-control input-lg" placeholder="@bs_loginbox_password_input" required=""> </div> <div class="checkbox"> <label> <input class="rememberme_controlcheckbox" type="checkbox" checked=""> @bs_loginbox_remember </label> <div style="display:none;"> <input name="DWExtranetUsernameRemember" type="hidden" value="True"> <input name="DWExtranetPasswordRemember" type="hidden" value="True"> <input name="Autologin" type="checkbox" checked="checked" value="True"> </div> <span class="forgot-password-wrapper pull-right"><a href="@forgotPasswordLink">@bs_razorlogin_forgotpass</a></span> </div> <button class="btn btn-lg btn-success btn-block button_margin_15 loginOK" type="submit" onclick="OKLoggin()">@Translate("Logg inn success knapp")</button> <button class="btn btn-lg btn-block button_margin_15 logginButton" style="color:#fff" type="submit" onclick="jsonLoggin(@Ajax_Login)">@bs_loginbox_login_btn</button> <div class="loginBusy"> <div style="clear: both;" class="busyspinner_fix"><i class="fa fa-spinner fa-pulse"></i> </div> </div> @if(areaID != 3 && areaID != 1){ <a href="#" class="feideLoginButton"></a> } </div><!--/row--> </div> <div class="modal-footer text_center"> @if (areaID == 1) { <p class="Login_InfoHelp_text">@bs_loginbox_contactinfo <a href="mailto:kundeservice@bibsent.no">kundeservice@bibsent.no</a> eller ring 22 08 39 00.</p> } else if (areaID == 3) { <p class="Login_InfoHelp_text">Hvis du har problemer med å få tilgang til kontoen din, kan du kontakte oss via vårt <a href="http://skjema.bsundervisning.no/" target="_blank">kontaktskjema</a> eller ring oss på 23242050</p> } <p class="Login_InfoHelp_text"><a href="@bs_loginbox_new_customer_link">@bs_loginbox_new_customer</a></p> </div> </div> </div> </div> } </div> } @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @if (Pageview.Area.ID == 1 || Pageview.Area.ID == 3) { <div class="Breadcrumb_wrapper "> <div class="row"> [Include file 'Navigation/breadcrumb.cshtml' not found in 'Templates/Designs/BSE/Catalog.cshtml'] </div> <div> </div> </div> } else if (Pageview.Area.ID == 2) { <text> @using System.Collections @using System.Runtime.Remoting.Messaging @using System.Text.RegularExpressions @using Dynamicweb @using Dynamicweb.eCommerce.Products @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @{ // ## Headertext var breadcrumbList = new Dictionary<string, string>(); var breaccrumbLinkList = new Dictionary<string, string>(); var headerText = ""; var breadcrumbRootText = ""; // ## Homepage var homepageId = Base.ChkString(Dynamicweb.Frontend.PageView.Current().Area.Item["HomepageID"]); if (!string.IsNullOrEmpty(homepageId)) { var intHeaderAreaID = Regex.Match(homepageId, @"\d+").Value; var homepage = Dynamicweb.Frontend.Page.FindPage(Int32.Parse(intHeaderAreaID)); if (Base.ChkBoolean(homepage.Values["pageshowinlegend"])) { breadcrumbRootText = Base.ChkString(homepage.Values["pagemenutext"]); headerText = breadcrumbRootText; } } // ## Page var pageId = Base.ChkInteger(Base.Request("ID")); var page = new Dynamicweb.Frontend.Page(); if (!string.IsNullOrEmpty(pageId.ToString())) { page = Dynamicweb.Frontend.Page.FindPage(pageId); if (Base.ChkBoolean(page.Values["pageshowinlegend"])) { headerText = Base.ChkString(page.Values["pagemenutext"]); } } // ## Group var group = new Dynamicweb.eCommerce.Products.Group(); var groupIndex = 0; var groupId = Base.ChkString(Base.Request("GroupID")); if (!string.IsNullOrEmpty(groupId)) { group = Dynamicweb.eCommerce.Products.Group.GetGroupByID(groupId); headerText = group.Name; var parentGroup = group; var url = CreateGroupLinkTemplate(group); var parentUrl = ""; breadcrumbList.Add(parentGroup.Name, url); while (parentGroup.ParentGroups.Any()) { try { parentGroup = parentGroup.ParentGroups.FirstOrDefault(); parentUrl = CreateGroupLinkTemplate(parentGroup); breadcrumbList.Add(parentGroup.Name, parentUrl); } catch (Exception e) {} } } // ## TopPage var topPageName = GetString("DwTopPageName"); var topPageText = ""; var topPageLink = ""; var topPage = new Dynamicweb.Frontend.Page(); if (!string.IsNullOrEmpty(topPageName) && Base.ChkString(page.Values["pagemenutext"]).ToLower() != topPageName.ToLower()) { topPage = Dynamicweb.Frontend.Page.FindPage(Base.ChkInteger(GetString("DwTopPageID"))); if (Base.ChkBoolean(topPage.Values["pageshowinlegend"])) { topPageLink = string.Format("/{0}.aspx", topPageName); topPageText = topPageName; } } // ## Tope Page Childpages var childBreadrumbList = new Dictionary<string, string>(); if (page.Parent != null && page.Parent != topPage) { //breadcrumbList.Add(Base.ChkString(page.Parent.Values["pagemenutext"]), "URLLOL"); Dynamicweb.Frontend.Page parent = page.Parent; var i = 0; // Loop-safety while (parent != null && parent != topPage && i < 10) { if (Base.ChkBoolean(parent.Values["pageshowinlegend"])) { childBreadrumbList.Add(Base.ChkString(parent.Values["pagemenutext"]), Base.ChkString(parent.Values["pagepathurl"])); } parent = parent.Parent; i++; } } // ## Product var product = new Dynamicweb.eCommerce.Products.Product(); var productId = Base.ChkString(Base.Request("ProductID")); if (!string.IsNullOrEmpty(productId)) { product = Dynamicweb.eCommerce.Products.Product.GetProductByID(productId); headerText = product.Name; } } <section class="titlebar"> <div class="container"> <div class="sixteen columns"> <h2>@headerText</h2> <nav id="breadcrumbs"> <ul> <li><a href="/">@breadcrumbRootText</a></li> @if (!string.IsNullOrEmpty(topPageText) && !string.IsNullOrEmpty(topPageLink)) { <li><a href="@topPageLink">@topPageText</a></li> } @{ // This line makes makes strange html errors, so keep it like this. You're welcome to change it back to html if you want to try. } @foreach (var child in childBreadrumbList.Reverse()) { <li><a href="@child.Value">@child.Key</a></li> } @string.Format("<li><a href='{0}'>{1}</a></li>", Base.ChkString(page.Values["pagepathurl"]), Base.ChkString(page.Values["pagemenutext"])) @foreach (var crumb in breadcrumbList.Reverse()) { if (groupIndex == breadcrumbList.Count) { <li>@crumb.Key</li> } else { <li><a href="@crumb.Value">@crumb.Key</a></li> } groupIndex++; } @if (!string.IsNullOrEmpty(product.ID)) { <li>@product.Name</li> } </ul> </nav> </div> </div> </section> @functions { public static string CreateGroupLinkTemplate(Dynamicweb.eCommerce.Products.Group group) { var prodCatalogId = Base.ChkString(Dynamicweb.Frontend.PageView.Current().Area.Item["ProdCatalog"]); var number = int.Parse(Regex.Match(prodCatalogId, @"\d+").Value); var page = Dynamicweb.Frontend.Page.FindPage(number); var pagename = page.Values["pagemenutext"]; return string.Format("{0}.aspx?GroupID={1}", Base.ChkString(pagename), Base.ChkString(group.ID)); } } </text> } <div class="container-full" id="MainContent">@GetValue("DwContent(MainContent)")</div> @*Script removes the breadcrumb links that have not created yet*@ <script> document.addEventListener("DOMContentLoaded", function (event) { //$('div.Breadcrumb_wrapper > div.row > div > ol li:not(:first):not(:last)').remove(); /*$('div.Breadcrumb_wrapper > div.row > div > ol li:not(:first):not(:last)').each(function (index, item) { var mySpan = document.createElement("span"); console.log($(item)); mySpan.innerHTML = $(item).find("a").html(); $(item).find("a").html("") $(item).append(mySpan); });*/ }); </script> <div class="row"> <div class="col-md-12"> </div> </div> <!-- Footer --> <footer> @{ var footerAreaID = Dynamicweb.Frontend.PageView.Current().Area.Item["FooterAreaID"].ToString(); var intFooterAreaID = Regex.Match(footerAreaID, @"\d+").Value; var footer_areas = Dynamicweb.Frontend.Page.FindPage(Int32.Parse(intFooterAreaID)); var collaborators = Translate("footer_collaborators", "SAMARBEIDSPARTNERE"); var SignUp = Translate("footer_subscribe_text", "MELD DEG PÅ VÅRT NYHETSBREV"); var subscribe = Translate("footer_submit_btn", "ABONNER"); var mail_placeholder = Translate("footer_mail_placeholder", "din@epost.no"); } <div class="footer_wrapper"> <div class="row list-rows"> @foreach (var area in footer_areas.Children) { <div class="col-xs-12 col-sm-6 col-md-3 col-centered col-fixed"> <div class="item"> <div> <span class="Footer_ListHead">@area.Values["pagemenutext"]</span> <ul class="footerlist"> @foreach (var subPage in area.Children) { var href = subPage.Values["pagepathurl"]; var menuText = subPage.Values["pagemenutext"]; <li><a href="@href">@menuText</a></li> } </ul> </div> </div> </div> } <div class="col-xs-12 col-sm-4 col-md-4 col-lg-4 col-centered col-fixed" style="display:none;"> <div class="item"> <div class="socialResponsiveBox"> <a class="socialLink" href="javascript:void(0);" target="_blank"><i class="fa fa-facebook-official fa-2x"></i></a> <a class="socialLink" href="javascript:void(0);" target="_blank"><i class="fa fa-youtube-square fa-2x"></i></a> <a class="socialLink" href="javascript:void(0);" target="_blank"><i class="fa fa-twitter-square fa-2x"></i></a> <a class="socialLink" href="javascript:void(0);" target="_blank"><i class="fa fa-instagram fa-2x"></i></a> </div> </div> </div> </div> <hr> <div class="row footer-social-row"> <div class="col-xs-offset-0 col-sm-offset-0 col-md-offset-0 col-lg-offset-0 col-xs-5 col-sm-4 col-md-3 col-lg-3 col-centered col-fixed"> @{ string FacebookLink = (string)Dynamicweb.Frontend.PageView.Current().Area.Item["FacebookLink"]; string TwitterLink = (string)Dynamicweb.Frontend.PageView.Current().Area.Item["TwitterLink"]; string InstagramLink = (string)Dynamicweb.Frontend.PageView.Current().Area.Item["InstagramLink"]; string GooglePlusLink = (string)Dynamicweb.Frontend.PageView.Current().Area.Item["GooglePlusLink"]; string MiljofyrtarnImage = "/admin/public/getimage.ashx?Image=/Files/Templates/Designs/BS/img/Miljofyrtarn.png&width=60"; string bs_master_social_miljo = Translate("bs_master_social_miljo"); if (!string.IsNullOrEmpty(FacebookLink)) { <text><a href="@FacebookLink" target="_blank" class="socialButton"><i class="fa fa-facebook"></i></a></text> } if (!string.IsNullOrEmpty(TwitterLink)) { <text><a href="@TwitterLink" target="_blank" class="socialButton"><i class="fa fa-twitter"></i></a></text> } if (!string.IsNullOrEmpty(InstagramLink)) { <text><a href="@InstagramLink" target="_blank" class="socialButton"><i class="fa fa-instagram"></i></a></text> } if (!string.IsNullOrEmpty(GooglePlusLink)) { <text><a href="@GooglePlusLink" target="_blank" class="socialButton"><i class="fa fa-google-plus"></i></a></text> } if (!string.IsNullOrEmpty(MiljofyrtarnImage)) { <text><a href="@bs_master_social_miljo" target="_blank" class="socialButton Miljofyrtarn"><img src="@MiljofyrtarnImage" boder="0"></a></text> } } </div> <div class="col-xs-offset-0 col-sm-offset-0 col-md-offset-0 col-lg-offset-0 col-xs-7 col-sm-4 col-md-3 col-lg-3 col-centered col-fixed"> </div> <div class="col-xs-12 col-sm-4 col-md-6 col-lg-6 col-centered col-fixed"> <div class="item"> <div class="mailbox_wrapper"> <!-- <span class="Footer_ListHead mailbox_head">Nyhetsbrev</span> --> <!-- <p class="mailbox_text">@SignUp</p> --> @{ string newsletterService = ""; try { newsletterService = Dynamicweb.Frontend.PageView.Current().Area.Item["Ajax_NewsletterSubscription"].ToString(); }catch { } if (false) { <div class="mailbox_input"> <input type="text" id="newsletterSubscribeEmail" name="email" placeholder="@mail_placeholder" required="" class="form-control"> <input type="submit" value="@subscribe" onclick="subscribeToNewsletterFromFooter('@newsletterService')" class="btn btn-sm mail_subscribe"> </div> } } <div style="text-align:right;"><input type="button" value="@SignUp" onclick="window.location = '/nyhetsbrev'" class="btn btn-sm mail_subscribe"></div> </div> </div> </div> </div> </div> <div class="left_background_color_filler"></div> <div class="right_background_color_filler"></div> <div class="footer_information_wrapper"> <div class="row"> <div class="col-xs-offset-0 col-sm-offset-0 col-xs-12 col-sm-12 col-md-12 col-lg-12 bottomRow footerText centerSocials"> @{ List<string> footerText = new List<string>(); string companyName = Dynamicweb.Frontend.PageView.Current().Area.Item["CompanyName"].ToString(); string companyAddress = Dynamicweb.Frontend.PageView.Current().Area.Item["CompanyAddress"].ToString(); string companyZip = Dynamicweb.Frontend.PageView.Current().Area.Item["CompanyZip"].ToString(); string companyCity = Dynamicweb.Frontend.PageView.Current().Area.Item["CompanyCity"].ToString(); string companyPhone = Base.ChkString(Dynamicweb.Frontend.PageView.Current().Area.Item["CompanyPhone"]); string companyTelephone = Base.ChkString(Dynamicweb.Frontend.PageView.Current().Area.Item["CompanyTelephone"]); string companyFax = Dynamicweb.Frontend.PageView.Current().Area.Item["CompanyFax"].ToString(); string companyEmail = Dynamicweb.Frontend.PageView.Current().Area.Item["CompanyEmail"].ToString(); string bs_footer_phone = Translate("bs_footer_phone", "Tlf"); string bs_footer_fax = Translate("bs_footer_fax", "Fax"); string bs_footer_customerservice = Translate("bs_footer_customerservice", "Kundeservice"); string bs_footer_email = Translate("bs_footer_email", "E-post"); string bs_footer_editors = Translate("bs_footer_editors"); if (!string.IsNullOrEmpty(companyName)) { footerText.Add(companyName); } if (!string.IsNullOrEmpty(companyAddress)) { footerText.Add(companyAddress); } if (!string.IsNullOrEmpty(companyZip + companyCity)) { footerText.Add(string.Format("{0} {1}", companyZip, companyCity)); } if (!string.IsNullOrEmpty(companyPhone)) { footerText.Add(string.Format("{0}: {1}", bs_footer_phone, companyPhone)); } if (string.IsNullOrEmpty(companyPhone) && !string.IsNullOrEmpty(companyTelephone)) { footerText.Add(string.Format("{0}: {1}", bs_footer_phone, companyTelephone)); } if (!string.IsNullOrEmpty(companyFax)) { footerText.Add(string.Format("{0}: {1}", bs_footer_fax, companyFax)); } if (!string.IsNullOrEmpty(companyEmail)) { string mailLink = string.Format("mailto:{0}", companyEmail); footerText.Add(string.Format("<a href='{0}'>{1}</a>", mailLink, bs_footer_email)); } string formatString = ""; bool first = true; foreach (string s in footerText) { if (!first) { formatString = string.Format("{0} • {1}", formatString, s); } else { first = false; formatString = s; } } } <p>@formatString<br>@bs_footer_editors</p> </div> </div> <i onclick="scrollToTop('fast')" class="fa fa-chevron-up" style="cursor: pointer;"></i> </div> </footer> <div id="addprod_feedback" style="display:none; cursor: default"> <h1>Product was added to favList</h1> <input type="button" id="ok" value="OK"> </div> <input type="hidden" id="productsNotFoundTranslation" value="@t_NoProductsFound"> <script src="/Files/Templates/Designs/BS/js/jquery-2.1.4.min.js"></script> <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script> @Scripts.Render("~/bundles/plugins/scripts/bse_base") <script src="http://getbootstrap.com/examples/offcanvas/offcanvas.js"></script> <script type="text/javascript" src="/Files/Templates/Designs/BS/fancybox/source/helpers/jquery.fancybox-media.js"></script> @{ // BSE @Scripts.Render("~/bundles/plugins/scripts/bse_menu") @Scripts.Render("~/bundles/plugins/scripts/Trizzy/js_base") @Scripts.Render("~/bundles/plugins/scripts/Trizzy/js_custom") } <script type="text/javascript"> window.isDigitalCustomer = @digitalCustomer.ToLower(); window.isDigitalDistributer = @digitalDistributer.ToLower(); var mediaChoiceTranslate = '@Translate("bs_mediachoice_confirmString")'; var subscriptionTranslate = '@Translate("bs_subcription_confirmString")'; var enterWishlistName = '@Translate("bse_wishlist_enter_name")'; var PageviewAreaId = parseInt(@Pageview.Area.ID); var ajaxCartHelper = {}; jQuery(document).ready(function () { // Disable cache for Ajax Calls $.ajaxSetup({ cache: false }); $("#mainSearch, .mainSearch_submit").hover(function () { $(".mainSearch_submit").stop().animate({ opacity: 1 }); }, function () { $(".mainSearch_submit").stop().animate({ opacity: 0.5 }); }); $('.fancybox').fancybox({ 'titlePosition': 'inside', 'type': 'image', helpers: { media: {} } }); // Initialize javascript logic. if (typeof init == 'function') { init(); } @{ if (user != null) { <text>window.loggedOn = true;</text> } } var ajaxListenerHelper = new AjaxListenerHelper(); ajaxCartHelper = new AjaxCartHelper('@cartPageId'); }); </script> @{ var key = Base.ChkString(Dynamicweb.Frontend.PageView.Current().Area.Item["PublicRaKey"]); // <!-- Go to www.addthis.com/dashboard to customize your tools --> var src = string.Format("//s7.addthis.com/js/300/addthis_widget.js#pubid={0}", key); //ra-57c6821194591ee5 BSE //ra-56162dea59531323 Other } <script type="text/javascript" src="@src"></script> @RenderSnippet("FooterScripts") <div class="debug"> <div class="json_debug_ajaxUrl"></div> <div class="json_debug"> </div> </div> <input type="hidden" id="t_binding_h" value="@Translate(" h")"=""> @if (Pageview.Area.ID == 2) { @Styles.Render("~/bundles/plugins/styles/bse_modal") } <div class="modal fade" id="productAddedModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <h4 class="modal-title" id="productAddedModalLabel">Modal title</h4> </div> <div class="modal-body"> ... </div> <div class="modal-footer"> <a href="/Handlekurv.aspx" type="button" class="btn btn-default button">@Translate("bs_modal_showcart")</a> <a type="button" class="btn btn-default button" data-dismiss="modal">@Translate("bs_modal_close")</a> </div> </div> </div> </div> @if (Pageview.Area.ID == 2) { <div class="modal fade" id="newsletter-subscribe-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <h4 class="modal-title" id="newsletter-subscribe-modal-title">@Translate("bse_model_email_subscribed")</h4> </div> <div class="modal-footer"> <a type="button" class="btn btn-default button" data-dismiss="modal">@Translate("bs_modal_email_close")</a> </div> </div> </div> </div> } </body> </html>