Exception in template (Designs/BS/_parsed/Catalog.parsed.cshtml): System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.fbdeafdfdea.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(); 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/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 } } @{ if (Pageview.Area.ID == 1) { // BS @Styles.Render("~/bundles/plugins/styles/BS") } else if (Pageview.Area.ID == 2) { // 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") } else if (Pageview.Area.ID == 3) { // BSU @Styles.Render("~/bundles/plugins/styles/BSU") } } <style> @if (Pageview.Area.ID == 1 || Pageview.Area.ID == 3) { <text> body { background: #fff; margin: 0; padding: 0; font-family: 'Calibri', sans-serif; font-size: 14px; } </text> } else { } </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 == 1 || Pageview.Area.ID == 3) // BS & BSU DESIGN { <div class="row row-offcanvas row-offcanvas-left"> <nav class="sidrbar_visibility sidebar-offcanvas" id="sidebar"> @helper RenderNavigation_Offcanvas(System.Collections.Hashtable pageCollection, int parent = 0) { var pages = pageCollection.Values.Cast<Dynamicweb.Frontend.Page>() .Where(p => (int)p.AreaID == Dynamicweb.Frontend.PageView.Current().Area.ID && (bool)p.Values["pageactive"] && (int)p.Values["pageparentpageid"] == parent && !(bool)p.Values["pagehidden"] && (DateTime)p.Values["pageactivefrom"] < DateTime.Now && (DateTime)p.Values["pageactiveto"] > DateTime.Now && (bool)Dynamicweb.Security.IsCurrentUserAllowed(p)) .OrderBy(p => (int)p.Values["pagesort"]); foreach (Dynamicweb.Frontend.Page page in pages) { if (!Base.ChkBoolean(page.Values["pageactive"])) { continue; } int lvl = (int)page.Values["pagelevel"]; string li_class = string.Format("lvl{0}", lvl.ToString()); string link = string.Format("/Default.aspx?id={0}", page.Values["pageid"].ToString()); if (page.Children.Count > 0 || page.Values["pagenavigation_useecomgroups"].ToString() == "True") { link = "#"; } if (page.Values["pagemenutext"].ToString() != "System") { <li class="@li_class"> <a href="@link" class="@li_class">@page.Values["pagemenutext"]</a> </li> if (page.Children.Count > 0) { string ul_class = string.Format("lvl{0}", (lvl + 1).ToString()); <ul class="@ul_class"> @RenderNavigation_Offcanvas(pageCollection, page.ID) </ul> } else if (page.Values["pagenavigation_useecomgroups"].ToString() == "True") { string ul_class = string.Format("lvl{0}", (lvl + 1).ToString()); <ul class="@ul_class"> @RenderNavigation_ECOM_Offcanvas(null, lvl + 1, page.ID) </ul> } } } } @helper RenderNavigation_ECOM_Offcanvas(Dynamicweb.eCommerce.Products.GroupCollection groupCollection, int lvl, int productPageID) { groupCollection = (groupCollection == null) ? new Dynamicweb.eCommerce.Shops.Shop((string)Dynamicweb.Frontend.PageView.Current() .Area.get_Value("AreaEcomShopID")) .get_TopLevelGroups((string)Dynamicweb.Frontend.PageView.Current() .Area.get_Value("AreaEcomLanguageID")) : groupCollection; foreach (var group in groupCollection) { if (!group.NavigationShowInMenu) { continue; } string li_class = string.Format("lvl{0}", lvl.ToString()); <li class="@li_class"> @{ string link = string.Format("/Default.aspx?id={0}&GroupID={1}", productPageID.ToString(), group.ID); link = string.IsNullOrEmpty(group.Meta.Url) ? link : group.Meta.Url; string link2 = link; if (group.Subgroups.Count > 0) { link = "#"; } } <a href="@link" class="@li_class">@group.Name</a> @if (group.Subgroups.Count > 0) { string ul_class = string.Format("lvl{0}", (lvl + 1).ToString()); <ul class="@ul_class"><a href="@link2"><span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span></a> @RenderNavigation_ECOM_Offcanvas(group.Subgroups, lvl+1, productPageID) </ul> } </li> } } @functions { // Add code here. } <div class="offcan_col1 offcan_col"> </div> <div class="offcan_col2 offcan_col"> </div> <div class="offcan_col3 offcan_col text-right"> <a href="#" class="close_offset" data-toggle="offcanvas"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></a> </div> <div class="offcan_col_clear"> </div> <div class="offsetshadow"></div> @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @using System.Text.RegularExpressions @using BS.Common @using Dynamicweb @{ var sidebar_minicart_GlobalSolution_ConfigReader = new GlobalSolution_ConfigReader(); int __areaID = Pageview.Area.ID; int __login_loginPageID = sidebar_minicart_GlobalSolution_ConfigReader.getPageID_ByArea("LoginPageID", string.Format("Area_{0}", __areaID.ToString())); string __loggoutUrl = "/admin/public/ExtranetLogoff.aspx?ID=" + __login_loginPageID.ToString(); } <ul id="BSMenu_mobile" class="lvl1"> @{ 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)); } @foreach (var i in _header_areas.Children) { if (!Base.ChkBoolean(i.Values["pageactive"])) { continue; } var href = i.Values["pagepathurl"]; var menuText = i.Values["pagemenutext"]; if (menuText.ToString().ToLower() == "logg inn") { if (user == null) { <li role="presentation" class="lvl1"><a class="lvl1" href="#" onclick="showLoginModal() ">@menuText</a></li> } else { <li role="presentation" class="lvl1"><a class="lvl1" href="@__loggoutUrl">@Translate("Logg ut") @GetGlobalValue("Global:Extranet.UserName")</a></li> } } else if (menuText.ToString().ToLower() == "min side" && user != null) { <li role="presentation" class="lvl1"><a class="lvl1" href="@href">@menuText</a></li> } else if (menuText.ToString().ToLower() != "logg inn" && menuText.ToString().ToLower() != "min side") { <li role="presentation" class="lvl1"><a class="lvl1" href="@href">@menuText</a></li> } } @RenderNavigation_Offcanvas(Dynamicweb.Frontend.PageView.Current().PageCollection) </ul> </nav> <div class="tophead"> <div class="tophead_container"> <div class="row"> <div class="col-sm-4 col-xs-6"> @{ if (Pageview.Area.ID == 1) { // BS <a href="/" style="visibility: hidden"><img src="/Files/Templates/Designs/BS/img/bslogo.png" alt="bibleoteksentralen" border="0" class="biglogo"></a> } else if (Pageview.Area.ID == 3) { //BSU <a href="/" style="visibility: hidden"><img src="/Files/Templates/Designs/BS/img/bsulogo.png" alt="bibleoteksentralen" border="0" class="biglogo"></a> } } </div> <div class="col-sm-4 col-sm-push-4 col-xs-6 col-md-4 col-lg-4 "> <div class="cartLogin pull-right"> <a href="#" class="btn btn-default loginLink cartLogin_button" aria-label="Left Align" style="display:none;"> <span class="glyphicon glyphicon-user" aria-hidden="true"> <span style="font-family: 'Open Sans', sans-serif;">@Translate("Logg inn")</span> </span> </a> @if (Pageview.Area.ID != 1) { <text> @using BS.Common @{ int minicart_areaID = Pageview.Area.ID; var minicart_GlobalSolution_ConfigReader = new GlobalSolution_ConfigReader(); } <div class="minicart"> @{ var noProductsInCart = Translate("Ingen produkter i handlevognen"); int ajaxCartPageID = minicart_GlobalSolution_ConfigReader.getPageID_ByArea("Ajax_CartPageID", string.Format("Area_{0}", minicart_areaID.ToString())); int CartPageID = minicart_GlobalSolution_ConfigReader.getPageID_ByArea("CartPageID", string.Format("Area_{0}", minicart_areaID.ToString())); //string EmptyCartUrl = string.Format("/Default.aspx?id={0}&cartcmd=emptycart", ajaxCartPageID.ToString()); string CartUrl = string.Format("/Default.aspx?id={0}", CartPageID.ToString()); string ajaxcartId = Dynamicweb.Frontend.PageView.Current().Area.Item["Ajax_CartPageID"].ToString(); string emptyLink = string.Format("/Default.aspx?id={0}&cartcmd=emptycart", ajaxcartId); if (Dynamicweb.Input.FormatBoolean(GetValue("Ecom:Order.IsEmpty"))) { <div class="btn-group"> <a class="btn btn-default kasse_indikator_button minicart_hover_fix" href="#" ajaxcartpageid="@ajaxCartPageID"><i class="fa fa-shopping-cart fa-fw"></i><span class="kasse_indikator_button_text">&nbsp;&nbsp;</span></a> <a class="btn btn-default kasse_button minicart_hover_fix" href="#" ajaxcartpageid="@ajaxCartPageID">@Translate("Kasse")</a> </div> } else { <div class="btn-group"> <a class="btn btn-primary kasse_indikator_button minicart_hover_fix " href="#" ajaxcartpageid="@ajaxCartPageID"><i class="fa fa-shopping-cart fa-fw"></i><span class="kasse_indikator_button_text">&nbsp;@GetValue("Ecom:Order.OrderLines.TotalQuantity")</span></a> <a class="btn btn-primary kasse_button minicart_hover_fix" href="#" ajaxcartpageid="@ajaxCartPageID">@Translate("Kasse")</a> </div> } <div class="minicartExpand"> <img src="/Files/Templates/Designs/BS/img/PopupArrow.png" class="popupArrow"> <button type="button" class="close close_minicartExpand" onclick="closeAjaxCart()">&times;</button> <span class="miniPopupHeading">@Translate("Handlevogn")</span> <ul id="mini_orderLineList"></ul> if (Pageview.Area.ID != 3) { //not BSU <div class="minicart_left_control"> <a href="@emptyLink" class="btn btn-default clearBasket btn-xs">@Translate("Tom")</a> </div> } <div class="minicart_right_control"> <a href="@CartUrl" class="btn btn-primary btn-xs">@Translate("Til Handlevogn")</a> </div> <div style="clear:both;display:none;"> </div> </div> } </div><!-- /minicart --> </text> } @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"); 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-passord.aspx?LoginAction=Recovery"; if (areaID == 1) { 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"><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="visibility: hidden;"> <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-primary btn-block button_margin_15 logginButton" 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">Problemer med tilgang eller ny bruker? Ta kontakt via vårt <a href="http://skjema.bsundervisning.no/" target="_blank">kontaktskjema</a> eller på tlf. 23&nbsp;24&nbsp;20&nbsp;50</p> } </div> </div> </div> </div> } </div><!-- /cartLogin --> </div> <div class="col-sm-4 col-sm-pull-4 col-xs-12 col-md-4 col-lg-4 searchFormContainer"> <div class="formwrapper"> <!--<input type="text" placeholder="Disabled..." class="" id="" autocomplete="off" />--> </div><!-- /searchFormContainer --> </div> </div><!-- /tophead_container --> </div><!-- /tophead --> <!-- Navigation --> <div class="mainnavigation_container"> <div class="MainNavigation_wrapper" style=""> <!-- new header test --> @if (Pageview.Area.ID == 1 || Pageview.Area.ID == 3) { // BS <div> @using System.Text.RegularExpressions @using BS.Common @using BS.Common.CustomModules.BS_MessageCenter @using BS.Common.CustomModules.BS_MessageCenter.MessageAdapter @using BS_CustomCodes.CustomModules.UserManagementHelper @using Dynamicweb @using Dynamicweb.Backend @using Dynamicweb.Modules.UserManagement @using User = Dynamicweb.Modules.UserManagement.User @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @{ Dynamicweb.Modules.UserManagement.User header_user = Dynamicweb.Modules.UserManagement.User.get_Current(PagePermissionLevels.Frontend); var handlekurvUrl = Base.ChkString(Dynamicweb.Frontend.PageView.Current().Area.Item["CartPageID"]); var pageCollection = Dynamicweb.Frontend.PageView.Current().PageCollection; var bs_minicart_tobasket = Translate("bs_minicart_tobasket", "Til Handlevogn"); var bs_minicart_empty = Translate("bs_minicart_empty", "Tom"); //var search = Translate("", "Søk"); int header_minicart_areaID = Pageview.Area.ID; var header_minicart_GlobalSolution_ConfigReader = new GlobalSolution_ConfigReader(); int header_ajaxCartPageID = header_minicart_GlobalSolution_ConfigReader.getPageID_ByArea("Ajax_CartPageID", string.Format("Area_{0}", header_minicart_areaID.ToString())); int header_CartPageID = header_minicart_GlobalSolution_ConfigReader.getPageID_ByArea("CartPageID", string.Format("Area_{0}", header_minicart_areaID.ToString())); int _areaID = Pageview.Area.ID; //int _login_loginPageID = header_minicart_GlobalSolution_ConfigReader.getPageID_ByArea("LoginPageID", string.Format("Area_{0}", _areaID.ToString())); //string _login_loginPageID = Dynamicweb.Frontend.PageView.Current().Area.Item["LoginPageID"].ToString(); string _loggoutUrl = "/admin/public/ExtranetLogoff.aspx"; //?ID=" + _login_loginPageID.ToString(); int ajaxCartPageID = header_minicart_GlobalSolution_ConfigReader.getPageID_ByArea("Ajax_CartPageID", string.Format("Area_{0}", _areaID.ToString())); int CartPageID = header_minicart_GlobalSolution_ConfigReader.getPageID_ByArea("CartPageID", string.Format("Area_{0}", _areaID.ToString())); string EmptyCartUrl = string.Format("/Default.aspx?id={0}&cartcmd=emptycart", ajaxCartPageID.ToString()); string CartUrl = string.Format("/Default.aspx?id={0}", CartPageID.ToString()); var messageCenterLink = Base.ChkString(Dynamicweb.Frontend.PageView.Current().Area.Item["MessageCenterPage"]); User customer = null; if (user != null) { string CustomerGroupID = Dynamicweb.Frontend.PageView.Current().Area.Item["CustomerGroupID"].ToString(); customer = Dynamicweb.Modules.UserManagement.User.GetUserBySql(string.Format("select * from AccessUser where AccessUserCustomerNumber = '{0}' and AccessUserGroups = '@{1}@'", user.CustomerNumber, CustomerGroupID)); } } <div id="MegaMenu_Shadow"> </div> <div class="navbar navbar-default navbar-fixed-top" style="display: block;"> <div id="user-navigation-bar" class="container"> <div class="row"> <div class="col-lg-5 col-md-4 col-sm-5 col-xs-5 header-image"> @{ string LOGO_src = Dynamicweb.Frontend.PageView.Current().Area.Item["Logo"].ToString(); if (Pageview.Area.ID == 1) { // BS <a href="/"><img src="@LOGO_src"></a> } else { <a href="/"><img src="@LOGO_src" id="MainLogoImage"></a> } } </div> <div class="col-lg-7 col-md-8 col-sm-7 col-xs-7 header-user-nav"> <ul class="nav nav-pills pull-right"> @{ // Use AREA ID instead. if (header_user != null && (Pageview.Area.ID == 1 || Pageview.Area.ID == 3)) // BS || BSU { User thisUser = Dynamicweb.Modules.UserManagement.User.GetUserByID(header_user.ID); string ibx_hook = thisUser.CustomFieldValues.Find(x => x.CustomField.SystemName.Equals("AccessUser_IbxHookUrl")).Value.ToString(); string ibx_userid = ""; if (System.Web.HttpContext.Current.Session["ibx-userid"] != null) { ibx_userid = (string)System.Web.HttpContext.Current.Session["ibx-userid"]; } if (!String.IsNullOrEmpty(ibx_hook)) { string ibxCartPageUrl = Dynamicweb.Frontend.PageView.Current().Area.Item["IBX_Submit_Page"].ToString(); <li role="presentation" title="Kundenummer: @user.CustomerNumber"> <a href="@ibxCartPageUrl">@Translate("navbar-back-to-ibx")</a> </li> } } } @{ 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)); } @foreach (var i in header_areas.Children) { if (Base.ChkString(i.Values["pageactive"]) != "True") { continue; } var href = i.Values["pagepathurl"]; var menuText = i.Values["pagemenutext"]; if (menuText.ToString().ToLower() == "logg inn") { if (user == null) { <li role="presentation" class=""><a href="#" onclick="showLoginModal() ">@menuText</a></li> } else { var addresses = UserHelperClass.getCompanyAdresses(user, customer); string show_text_for_logout = string.Format("({0})", (customer != null) ? (!string.IsNullOrEmpty(customer.Name)) ? addresses.Any() ? addresses.FirstOrDefault().Company : customer.Company : user.Name : user.Name); <li role="presentation" class="" title="Kundenummer: @user.CustomerNumber"><a href="@_loggoutUrl">@Translate("Logg ut") @show_text_for_logout</a></li> } } else if (menuText.ToString().ToLower() == "min side" && user != null) { <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">@menuText <span class="caret"></span></a> <ul class="dropdown-menu"> <li role="presentation" class=""><a href="@href">Brukerprofil</a></li> @{ string login_pageurl = Dynamicweb.Frontend.PageView.Current().Area.Item["LoginPageID"].ToString(); var _split = login_pageurl.Split('?'); string _id = _split[1].Replace("ID=", string.Empty); string show_text_for_logout = string.Format("({0})", user.Name); int pageID = Convert.ToInt32(_id); var currPage = Dynamicweb.Frontend.Page.FindPage(pageID); foreach (var p in currPage.Children) { if (Base.ChkString(p.Values["pageactive"]) != "True") { continue; } string child_p_url = string.Format("/Default.aspx?Id={0}", p.ID.ToString()); <li><a href="@child_p_url">@p.Values["pagemenutext"]</a></li> } <li role="separator" class="divider"></li> <li role="presentation" class=""><a href="@_loggoutUrl">@Translate("Logg ut") @show_text_for_logout</a></li> } </ul> </li> } else if (menuText.ToString().ToLower() != "logg inn" && menuText.ToString().ToLower() != "min side") { <li role="presentation" class=""><a href="@href">@menuText</a></li> } } </ul> </div> <div class="col-lg-1 col-md-1 col-sm-1 col-xs-2 MainNavigation_smallscreen" role="navigation" style=""> <button type="button" class="btn btn-default offcanvasMenuButton " data-toggle="offcanvas"><span class="glyphicon glyphicon-menu-hamburger" aria-hidden="true"></span></button> </div> <div class="col-lg-4 col-lg-offset-0 col-md-5 col-md-offset-0 col-sm-6 col-sm-offset-3 col-xs-6 col-xs-offset-0 header-search"> @using BS.Common.CustomModules.ProductList @using Dynamicweb @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @{ var urlProdSearch = Dynamicweb.Frontend.PageView.Current().Area.Item["Ajax_ProdSearch_Main"].ToString(); var transShow = Translate("trans_show"); var transMoreResults = Translate("trans_moreresults"); var urlCatalogHref = Dynamicweb.Frontend.PageView.Current().Area.Item["ProdCatalog"].ToString(); var search = Translate("bs_search_plaseholder", "Søk"); } <div class="formwrapper"> @if (Pageview.Area.ID == 1) { <span class="mainSearch_spinner bs-spinner"><i class="fa fa-pulse fa-spinner "></i></span> } else { <span class="mainSearch_spinner"><i class="fa fa-pulse fa-spinner "></i></span> } <div class="input-group"> <div class="shadow_searchfield shadow_bg_trigger"> </div> <input type="text" class="form-control mainSearch" id="mainSearch" url="@urlProdSearch" placeholder="@search" url_catalog_href="@urlCatalogHref" trans_show="@transShow" trans_moreresults="@transMoreResults" aria-describedby="search-button"> @if (Pageview.Area.ID == 1) { <span class="search-filter-select"> <select class=""> @SaveSearchFilter.getOptions() </select> </span> } <span class="input-group-addon" id="search-button"> <i class="fa fa-search"></i> </span> </div> <div id="noresults"> <span>@Translate("bs_search_no_results", "Ingen treff")</span> </div> <div class="searchResultsWrapper"> <div class="j_ProductList col-md-8 col-sm-8 col-xs-12"> <span class="searchresultHeader">@Translate("bs-search-dropdown-products", "Produkter")</span> <div class="results"> </div> </div> @if (Pageview.Area.ID == 1) { <div class="j_Authors hidden-xs col-md-4 col-sm-4" facet="Author"> <span class="searchresultHeader">@Translate("bs-search-dropdown-author", "Forfatter")</span> <div class="results"> </div> </div> <!-- <div class="j_Emne hidden-xs col-md-4 col-sm-4" facet="Subject" style="display: none;"> <span class="searchresultHeader">@Translate("bs-search-dropdown-subject", "Emne")</span> <div class="results"> </div> </div> --> <div class="j_Format hidden-xs col-md-4 col-sm-4" facet="Format"> <span class="searchresultHeader">@Translate("bs-search-dropdown-format")</span> <div class="results"> </div> </div> <div class="j_Serie hidden-xs col-md-4 col-sm-4" facet="Series"> <span class="searchresultHeader">@Translate("bs-search-dropdown-series", "Serie")</span> <div class="results"> </div> </div> <!-- <div class="j_Litteraturtype hidden-xs col-md-4 col-sm-4" facet="Litteraturtype"> <span class="searchresultHeader">@Translate("bs-search-dropdown-producttype", "Litteraturtype")</span> <div class="results"> </div> </div> --> } else if (Pageview.Area.ID == 3) { <!-- <div class="j_Format hidden-xs col-md-4 col-sm-4" facet="Forlagsinnbinding"> <span class="searchresultHeader">@Translate("bs-search-dropdown-format", "Format")</span> <div class="results"> </div> </div>--> <div class="j_Fag hidden-xs col-md-4 col-sm-4" facet="Fag"> <span class="searchresultHeader">@Translate("bs-search-dropdown-class", "Fag")</span> <div class="results"> </div> </div> <div class="j_Klassetrinn hidden-xs col-md-4 col-sm-4" facet="Klassetrinn"> <span class="searchresultHeader">@Translate("bs-search-dropdown-classstep", "Klassetrinn")</span> <div class="results"> </div> </div> <div class="j_Varegruppe hidden-xs col-md-4 col-sm-4" facet="Varegruppe"> <span class="searchresultHeader">@Translate("bs-search-dropdown-varegruppe", "Varegruppe")</span> <div class="results"> </div> </div> <div class="j_Format hidden-xs col-md-4 col-sm-4" facet="Format"> <span class="searchresultHeader">@Translate("bs-search-dropdown-innbinding", "Innbinding")</span> <div class="results"> </div> </div> } <div class="j_Content hidden-xs col-md-4 col-sm-4" facet="Content"> <span class="searchresultHeader">@Translate("bs-search-dropdown-content", "Innhold")</span> <div class="results"> </div> </div> <div style="clear:both;"> </div> </div> </div> <!--<input type="text" class="form-control" placeholder="@search" aria-describedby="search-button" /> <span class="input-group-addon" id="search-button"> <i class="fa fa-search"></i> </span>--> </div> <div class="col-lg-3 col-md-3 col-sm-3 col-xs-4 header-cart"> @if (header_user != null) { var productQuantity = GetInteger("Ecom:Order.OrderLines.TotalQuantity"); <div id="minicart" class="btn-group minicart_hover_fix"> <div class="minicart_shadow_fix shadow_bg_trigger"></div> @if (Pageview.Area.ID == 1 && !string.IsNullOrEmpty(messageCenterLink)) { var messageCenter = new BS_MessageCenter(new DatabaseMessageAdapter(Dynamicweb.Frontend.PageView.Current().User.UserID)); <a style="" href="@messageCenterLink"> <div class="btn btn-cart bs_minicart_messagecenter_messagecounter"> <i class="fa fa-envelope-o" aria-hidden="true"></i> @if (messageCenter.UserHasNewMessage()) { <span class="badge"> @string.Format("({0})", messageCenter.GetNewMessages().Count()) </span> } </div> </a> } else if (Pageview.Area.ID == 3 && !string.IsNullOrEmpty(messageCenterLink)) { var messageCenter = new BS_MessageCenter(new DatabaseMessageAdapter(Dynamicweb.Frontend.PageView.Current().User.UserID)); var count = messageCenter.GetNewMessages().Count(); // > 9 ? 9 : messageCenter.GetNewMessages().Count(); var left = messageCenter.GetNewMessages().Count() < 9 ? "left: -3px;" : ""; <a style="" href="@messageCenterLink"> <div class="btn btn-cart bsu_minicart_messagecenter_messagecounter"> <i class="fa fa-envelope-o" aria-hidden="true"></i> @if (messageCenter.UserHasNewMessage()) { <div class="messagecenter-circle-hover"> <i class="fa fa-circle" aria-hidden="true"></i> <span style="@left" class="badge"> @string.Format("{0}", count) </span> </div> } </div> </a> } <a href="@CartUrl"> <div class="btn btn-cart kasse_indikator_button" ajaxcartpageid="@header_ajaxCartPageID"> <i class="fa fa-shopping-cart fa-fw"></i> <span class="badge">(@productQuantity)</span> </div> <div class="btn btn-shop hidden-xs" type="button"> @Translate("BS_Kasse", "Kasse") </div> </a> </div> <div class="minicart_header_expand"> <img src="/Files/Templates/Designs/BS/img/PopupArrow.png" class="popupArrow"> <button type="button" class="close close_minicartExpand" onclick="closeAjaxCart()">&times;</button> <span class="miniPopupHeading">@Translate("Handlevogn")</span> <ul id="minicart_header_orderLineList"></ul> @if (Pageview.Area.ID != 3) { string ajaxcartId = Dynamicweb.Frontend.PageView.Current().Area.Item["Ajax_CartPageID"].ToString(); string emptyLink = string.Format("/Default.aspx?id={0}&cartcmd=emptycart", ajaxcartId); //not BSU <div class="minicart_left_control"> <a href="@emptyLink" class="btn btn-default clearBasket btn-xs">@bs_minicart_empty</a> </div> } <div class="minicart_right_control"> <a href="@CartUrl" class="btn btn-shop btn-xs">@bs_minicart_tobasket</a> </div> <div style="clear:both;display:none;"> </div> </div> } else { <div class="btn-group group-default"> <button class="btn btn-cart-default"> <i class="fa fa-shopping-cart fa-fw"></i> <span class="badge"></span> </button> <button class="btn btn-shop-default hidden-xs" type="button"> @Translate("BS_Kasse", "Kasse") </button> </div> } </div> </div> </div> <div class="header_background"></div> <div class="megamenu_shadow_fix shadow_bg_trigger"> <div class="megamenu_shadow_fix_border shadow_bg_trigger"> </div> </div> <div id="page-navigation-bar" class="container"> <div class="navbar-header"> <a href="/" class="navbar-brand" href="#"> <i class="fa fa-home"></i> </a> </div> <!--<div class="megamenu_shadow_topSection "> </div>--> <div id="navbar" class="navbar-collapse collapse"> <div class="left_shadow_fix shadow_bg_trigger"> </div> <div class="right_shadow_fix shadow_bg_trigger"> </div> <ul class="nav navbar-nav"> @{ var temp_pageList = new List<Dynamicweb.Frontend.Page>(); var topgroups = new List<Dynamicweb.eCommerce.Products.Group>(); var bsu_catalogPageID = 1010; // I guess this will not change - so why not keep it simple? string request_GroupID = System.Web.HttpContext.Current.Request.QueryString["GroupID"]; List<string> inpathIDs = new List<string>(); if (!string.IsNullOrEmpty(request_GroupID)) { Dynamicweb.eCommerce.Products.Group currGroup = Dynamicweb.eCommerce.Products.Group.GetGroupByID(request_GroupID); if (currGroup != null) { inpathIDs = fillInpathGroupList(currGroup); } } var current_group = ""; if (Pageview.Area.ID == 3) { topgroups = new Dynamicweb.eCommerce.Shops.Shop((string)Dynamicweb.Frontend.PageView.Current() .Area.get_Value("AreaEcomShopID")) .get_TopLevelGroups((string)Dynamicweb.Frontend.PageView.Current() .Area.get_Value("AreaEcomLanguageID")).ToList(); } foreach (Dynamicweb.Frontend.Page i in pageCollection.Values) { temp_pageList.Add(i); } if (Pageview.Area.ID == 1) { var pageCollectionValues = temp_pageList.OrderBy(o => o.Values["pagesort"]).ToList(); //var pageCollectionValues = pageCollection.Values. //hashtable.Cast<DictionaryEntry>().OrderBy(entry => entry.Value).ToList() foreach (Dynamicweb.Frontend.Page i in pageCollectionValues) { //var sortedList = yourList.OrderBy(x => x.Score); 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 = i.Values["pagemenutext"]; foreach (System.Collections.DictionaryEntry val in i.Values) { //<div>@val.Key</div> //<div>: @val.Value</div> } var active = ""; var currentId = Base.ChkInteger(GetGlobalValue("Global:Page.ID")); if (hasActiveChild(i.ID, currentId)) { active = "active"; } /*if (request_GroupID == "GROUP102" || inpathIDs.Contains("GROUP102")) { active = "active"; }*/ if (menuText.ToString().ToLower() == "bøker & medier" || menuText.ToString().ToLower() == "produkter") { <li onclick="show_Megamenu('GROUP102')" megamenu_rel="GROUP102" class="header-pointer @active"><a>@menuText</a></li> } else if (menuText.ToString().ToLower() == "tjenester") { <li onclick="show_Megamenu('PAGE_1026')" megamenu_rel="PAGE_1026" class="header-pointer @active"><a>@menuText</a></li> } else if (menuText.ToString().ToLower() == "selvbetjening") { <li onclick="show_Megamenu('PAGE_1025')" megamenu_rel="PAGE_1025" class="header-pointer @active"><a>@menuText</a></li> } else if (menuText.ToString().ToLower() == "kataloger") { <li onclick="show_Megamenu('PAGE_2649')" megamenu_rel="PAGE_2649" class="header-pointer @active"><a>@menuText</a></li> } else { <li class="header-pointer @active"><a href="@href">@menuText</a></li> } } } } else if (Pageview.Area.ID == 3) { foreach (Dynamicweb.eCommerce.Products.Group topGroup in topgroups) { var active = ""; //var currentId = GetGlobalValue("Global:Page.ID"); if (inpathIDs.Contains(topGroup.ID)) { active = "active"; } else { active = ""; } if (topGroup.NavigationShowInMenu) { var metaUrl = topGroup.Meta.Url; if (string.IsNullOrEmpty(metaUrl)) { <li onclick="show_Megamenu('@topGroup.ID')" class="header-pointer @active" megamenu_rel="@topGroup.ID"><a>@topGroup.Name</a></li> //bs_header_megamenu } else { <li class="header-pointer @active" megamenu_rel="@topGroup.ID"><a href="@metaUrl">@topGroup.Name</a></li> } } } } } </ul> <ul class="nav navbar-nav navbar-right"> <!-- <li><a>d</a></li> <li><a>e</a></li> <li><a>f</a></li> --> </ul> @{ if (Pageview.Area.ID == 1) { var booksandmedia = Dynamicweb.eCommerce.Products.Group.GetGroupByID("GROUP102"); var booksandmediaPage = temp_pageList.SingleOrDefault(x => x.Values["pagemenutext"].ToString().ToLower() == "bøker & medier"); //var tjenesterPage = temp_pageList.SingleOrDefault(x => x.Values["pagemenutext"].ToString().ToLower() == "tjenester"); var lvl = 1; Dynamicweb.Content.Page tjenestePage = Dynamicweb.Content.Page.GetPageById(1026); Dynamicweb.Content.Page selvbetjeningPage = Dynamicweb.Content.Page.GetPageById(1025); Dynamicweb.Content.Page katalogerPage = Dynamicweb.Content.Page.GetPageById(2649); <div id="bs_header_megamenu" class="bs_header_megamenu" megamenu_rel="GROUP102"> <table cellpadding="0" cellspacing="0"> <tr> <td valign="top" class="lvl2cell"> <ul class="lvl2" rel="@booksandmedia.Name"> @{ //lvl = lvl + 1; var groupCollection = (booksandmedia.Subgroups == null) ? new Dynamicweb.eCommerce.Shops.Shop((string)Dynamicweb.Frontend.PageView.Current() .Area.get_Value("AreaEcomShopID")) .get_TopLevelGroups((string)Dynamicweb.Frontend.PageView.Current() .Area.get_Value("AreaEcomLanguageID")) : booksandmedia.Subgroups; var showActive = false; string a_activeClass = ""; foreach (var _group in groupCollection) { string li_class = string.Format("lvl{0}", lvl.ToString()); if (_group.PrimaryParentGroupID == null) { if (showActive == false) { li_class = li_class + " active"; showActive = true; } if (inpathIDs.Contains(_group.ID)) { a_activeClass = "active_a"; } else { a_activeClass = ""; } /*string debug = ""; foreach (string s in inpathIDs) { debug = debug + "|" + s; }*/ if (_group.NavigationShowInMenu) { <li class="@li_class group-item"> <a href="#" class="@li_class @a_activeClass" boxrel="@_group.ID">@_group.Name</a> </li> } } } } </ul> </td> <td valign="top" class="lvl3cell"> @RenderEcomNavigation_BS_BigBoxGroups__(booksandmedia.Subgroups, 2, booksandmediaPage.ID, inpathIDs) </td> </tr> </table> </div> <div id="bs_header_megamenu" class="bs_header_megamenu" megamenu_rel="PAGE_1025"> <!-- Tjeneste group MegaMenu --> <table cellpadding="0" cellspacing="0"> <tr> <td valign="top" class="lvl3cell"> @Render_Article_Subgroups(selvbetjeningPage) </td> </tr> </table> </div> <div id="bs_header_megamenu" class="bs_header_megamenu" megamenu_rel="PAGE_1026"> <!-- Tjeneste group MegaMenu --> <table cellpadding="0" cellspacing="0"> <tr> <td valign="top" class="lvl3cell"> @Render_Article_Subgroups(tjenestePage) </td> </tr> </table> </div> <div id="bs_header_megamenu" class="bs_header_megamenu" megamenu_rel="PAGE_2649"> <!-- Kataloger group MegaMenu --> <table cellpadding="0" cellspacing="0"> <tr> <td valign="top" class="lvl3cell"> @Render_Article_Subgroups(katalogerPage) </td> </tr> </table> </div> } else if (Pageview.Area.ID == 3) { foreach (var tg in topgroups) { //var booksandmediaPage = temp_pageList.SingleOrDefault(x => x.Values["pagemenutext"].ToString().ToLower() == "bøker & medier"); var lvl = 1; <div id="bs_header_megamenu" class="bs_header_megamenu" megamenu_rel="@tg.ID"> <table cellpadding="0" cellspacing="0"> <tr> <td valign="top" class="lvl2cell"> <ul class="lvl2" rel="@tg.Name"> @{ //lvl = lvl + 1; string a_activeClass = ""; var showActive = false; foreach (var _group in tg.Subgroups) { string li_class = string.Format("lvl{0}", lvl.ToString()); if (showActive == false) { li_class = li_class + " active"; showActive = true; } if (inpathIDs.Contains(_group.ID)) { a_activeClass = "active_a"; } else { a_activeClass = ""; } if (_group.NavigationShowInMenu) { <li class="@li_class group-item"> <a href="#" class="@li_class @a_activeClass" boxrel="@_group.ID">@_group.Name </a> </li> } } } </ul> </td> <td valign="top" class="lvl3cell"> @RenderEcomNavigation_BS_BigBoxGroups__(tg.Subgroups, 2, 1010, inpathIDs) </td> </tr> </table> </div> } } } </div> </div> </div> @helper RenderEcomNavigation_BS_BigBoxGroups__(Dynamicweb.eCommerce.Products.GroupCollection groupCollection, int lvl, int prodPageID, List<string> inpathList) { groupCollection = (groupCollection == null) ? new Dynamicweb.eCommerce.Shops.Shop((string)Dynamicweb.Frontend.PageView.Current() .Area.get_Value("AreaEcomShopID")) .get_TopLevelGroups((string)Dynamicweb.Frontend.PageView.Current() .Area.get_Value("AreaEcomLanguageID")) : groupCollection; var active_shown = false; foreach (var group in groupCollection) { //string li_class = string.Format("lvl{0}", lvl.ToString()); if (lvl == 2) { string megabox_class = "megabox"; // add class = active if (active_shown == false) { megabox_class = megabox_class + " active"; active_shown = true; } if (inpathList.Contains(group.ID)) { if (!active_shown) { megabox_class = megabox_class + " active"; active_shown = true; } } <div class="@megabox_class" boxrel="@group.ID" lvl="@lvl" subgroups_count="@group.Subgroups.Where(x => x.NavigationShowInMenu).ToList().Count"> @if (group.Subgroups.Count > 0) { <text> @RenderEcomNavigation_BS_BigBoxGroups_(group.Subgroups, lvl + 1, prodPageID, inpathList) </text> } @if (lvl == 2) { if (group.Subgroups.Where(x => x.NavigationShowInMenu).ToList().Count < 5) { <text>@Generate_imageCells(5 - group.Subgroups.Where(x => x.NavigationShowInMenu).ToList().Count, group)</text> } } <div style="clear:both;display:none;"></div> </div><!--/megabox--> } } } @helper RenderEcomNavigation_BS_BigBoxGroups_(Dynamicweb.eCommerce.Products.GroupCollection groupCollection, int lvl, int prodPageID, List<string> inpathList) { groupCollection = (groupCollection == null) ? new Dynamicweb.eCommerce.Shops.Shop((string)Dynamicweb.Frontend.PageView.Current() .Area.get_Value("AreaEcomShopID")) .get_TopLevelGroups((string)Dynamicweb.Frontend.PageView.Current() .Area.get_Value("AreaEcomLanguageID")) : groupCollection; var active_shown = false; foreach (var group in groupCollection) { string li_class = string.Format("lvl{0}", lvl.ToString()); if (lvl == 2) { string megabox_class = "megabox"; // add class = active if (active_shown == false) { megabox_class = megabox_class + " active"; active_shown = true; } if (inpathList.Contains(group.ID)) { if (!active_shown) { megabox_class = megabox_class + " active"; active_shown = true; } } <div class="@megabox_class" boxrel="@group.ID" lvl="@lvl"> @if (group.Subgroups.Count > 0) { <text> @RenderEcomNavigation_BS_BigBoxGroups_(group.Subgroups, lvl + 1, prodPageID, inpathList) </text> } <div style="clear:both;display:none;"></div> </div><!--/megabox--> } else if (lvl == 3) { string spanHeadingClass = string.Format("lvl{0}_heading", lvl.ToString()); string listUlClass = string.Format("lvl{0}", lvl.ToString()); string link = string.Format("/Default.aspx?id={0}&GroupID={1}", prodPageID.ToString(), group.ID); link = string.IsNullOrEmpty(group.Meta.Url) ? link : group.Meta.Url; if (inpathList.Contains(group.ID)) { spanHeadingClass = spanHeadingClass + " active"; } if (group.NavigationShowInMenu) { var clickable = group.NavigationClickable; <div class="megacell"> @if (clickable) { <a href="@link" class="@spanHeadingClass">@group.Name</a> } else { <a href="javascript: void(0)" style="cursor:default;" class="@spanHeadingClass">@group.Name</a> } @if (group.Subgroups.Count > 0) { <ul class="@listUlClass"> @RenderEcomNavigation_BS_BigBoxGroups_(group.Subgroups, lvl + 1, prodPageID, inpathList) </ul> } </div> } } else if (lvl == 4 && group.NavigationShowInMenu) { string link = string.Format("/Default.aspx?id={0}&GroupID={1}", prodPageID.ToString(), group.ID); if (!string.IsNullOrEmpty(group.Meta.Url)) { link = group.Meta.Url; } string lvlClass = string.Format("lvl{0}", (lvl - 1).ToString()); if (inpathList.Contains(group.ID)) { lvlClass = lvlClass + " active"; } <li class="@lvlClass"> <a href="@link" class="@lvlClass">@group.Name</a> </li> } } } @helper Generate_imageCells(int cellCount_blank, Dynamicweb.eCommerce.Products.Group group) { if (cellCount_blank > 2) { /*//int cellCount_blank - 2; for (int i = 0; i < cellCount_blank - 2; i++) { <div class="megacell imagemegacell" style="background-size:orange;"> <div></div> </div> } cellCount_blank = 2;*/ } int cell_width = 185 * cellCount_blank; cell_width = 100; //string imgSrc = group.; //GetString("Ecom:Group:Field.GroupMainImage.Value.Clean"); string css_class = string.Format("megacell_image_wrapper imgCells_{0}", cellCount_blank.ToString()); string imgSrc = group.SmallImage; string widthParam = string.Format("width:{0};", cell_width.ToString()); int left_position = 792; if (cellCount_blank == 1) { left_position = left_position + 185; } imgSrc = string.Format("/admin/public/getimage.ashx?Image={0}&width={1}", imgSrc, "500"); string background_style = string.Format("background-image:url('{0}');display:block;position:absolute;top:10px;right:10px;bottom:10px;left:{1}px;background-repeat:no-repeat;background-size: 100%;", imgSrc, left_position.ToString()); string imagemegacell_style = string.Format("width:{0}px;", cell_width.ToString()); <text> <div class="megacell imagemegacell" style="@imagemegacell_style"> <div class="@css_class" style="@background_style"> </div> </div> </text> } @helper Render_Tjeneste_Subgroups(Dynamicweb.eCommerce.Products.GroupCollection groupCollection, int lvl, int prodPageID, List<string> inpathList) { groupCollection = (groupCollection == null) ? new Dynamicweb.eCommerce.Shops.Shop((string)Dynamicweb.Frontend.PageView.Current() .Area.get_Value("AreaEcomShopID")) .get_TopLevelGroups((string)Dynamicweb.Frontend.PageView.Current() .Area.get_Value("AreaEcomLanguageID")) : groupCollection; var active_shown = false; <div class="megabox tjenesteMegabox" boxrel="TJENESTE" lvl="2"> @{ foreach (var subgroup in groupCollection) { string link = string.Format("/Default.aspx?id={0}&GroupID={1}", prodPageID.ToString(), subgroup.ID); if (!string.IsNullOrEmpty(subgroup.Meta.Url)) { link = subgroup.Meta.Url; } string img_src = subgroup.SmallImage; img_src = img_src.Length > 0 ? string.Format("/admin/public/getimage.ashx?Image={0}&width=350&height=116", img_src) : ""; string active_class = ""; if (inpathList.Contains(subgroup.ID)) { if (!active_shown) { active_class = "active_class"; active_shown = true; } } <div class="megacell tjeneste_megacell @active_class"> <div class="tjeneste_image_holder"> <a href="@link"> <img src="@img_src"> </a> </div> <a href="@link" class="lvl3_heading">@subgroup.Name</a> </div> } } </div> } @helper Render_Article_Subgroups(Dynamicweb.Content.Page page = null) { if (page != null) { var boxrel = string.Format("PAGE_{0}", page.ID.ToString()); <div class="megabox tjenesteMegabox" boxrel="@boxrel" lvl="2"> @{ var page_subpages = page.Subpages.OrderBy(x => x.Sort).ToList(); if (page.Subpages.Any()) { foreach (var lvl3_page in page_subpages) { if (lvl3_page.Active) { var lvl3_page_url = string.Format("/Default.aspx?ID={0}", lvl3_page.ID.ToString()); var lvl3_page_item = Dynamicweb.Content.Items.ItemManager.Storage.GetById("Article", lvl3_page.ItemId); //string lvl3_page_image = "https://placeholdit.imgix.net/~text?txtsize=50&txt=350×116&w=350&h=116&txtpad=1"; string lvl3_page_image = ""; if (lvl3_page_item["MenuImage"] != null && lvl3_page_item["MenuImage"].ToString().Length > 0) { lvl3_page_image = string.Format("/admin/public/getimage.ashx?Image={0}&amp;width=350&amp;height=116", lvl3_page_item["MenuImage"]); } <div class="megacell tjeneste_megacell "> <div class="tjeneste_image_holder"> <a href="@lvl3_page_url"> <img src="@lvl3_page_image" data-pin-nopin="true"> </a> </div> <a href="@lvl3_page_url" class="lvl3_heading">@lvl3_page.MenuText</a> <ul class="lvl3"> @{ if (lvl3_page != null && lvl3_page.Subpages != null) { var lvl3_page_subpages = lvl3_page.Subpages.OrderBy(x => x.Sort).ToList(); if (lvl3_page.Subpages.Any()) { foreach (var lvl4_page in lvl3_page_subpages) { var lvl4_page_url = string.Format("/Default.aspx?ID={0}", lvl4_page.ID.ToString()); <li class="lvl3"> <a href="@lvl4_page_url" class="lvl3">@lvl4_page.MenuText</a> </li> } } } } </ul> </div> } } } } </div> } } @functions { public List<string> fillInpathGroupList(Dynamicweb.eCommerce.Products.Group group) { List<string> inpathList = new List<string>(); iterate_groups(group, inpathList); return inpathList; } public void iterate_groups(Dynamicweb.eCommerce.Products.Group group, List<string> inpathList) { if (group.ParentGroupsDefaultLanguage != null && group.ParentGroupsDefaultLanguage.Count > 0) { string parent_id = group.ParentGroupsDefaultLanguage[0].ID; Dynamicweb.eCommerce.Products.Group parent = Dynamicweb.eCommerce.Products.Group.GetGroupByID(parent_id); if (parent != null) { iterate_groups(parent, inpathList); } else { // hit the root... } } inpathList.Add(group.ID); } } @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; } } </div> } @if (Pageview.Area.ID != 1 && Pageview.Area.ID != 3) { <div class="MainNavigation_smallscreen" role="navigation" style=""> <button type="button" class="btn btn-default offcanvasMenuButton " data-toggle="offcanvas"><span class="glyphicon glyphicon-menu-hamburger" aria-hidden="true"></span></button> </div> } <nav class="MainNavigation_bigscreen" role="navigation" style=""> <div class="row"> <div class="col-md-12"> @{ if (Pageview.Area.ID == 1) { //BS //IncludeFile("Navigation/BS_Megamenu_live.cshtml") (DEPRECATED) } else if (Pageview.Area.ID == 3) { //BSU //IncludeFile("Navigation/BSU_Megamenu_live.cshtml") (DEPRECATED) } } <!-- /.navbar-collapse --> <!-- /.container --> </div> </div> </nav> </div><!-- /MainNavigation_wrapper --> </div><!-- /mainnavigation_container --> <div class="subMegamenu_area"> <!-- <a href="#" class="kundesenter_button vertical">@Translate("Kundesenter")</a> --> @{ } </div> </div> </div> } else if (Pageview.Area.ID == 2) // BSE DESIGN { <div> [Include file 'Navigation/BSE_Header_Fixed_Navbar.cshtml' not found in 'Templates/Designs/BS/Master.cshtml'] </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"); 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-primary btn-block button_margin_15 logginButton" 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> } </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"> @using System.Web @using Dynamicweb @using Dynamicweb.Content @using Dynamicweb.eCommerce.Products @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @{ string fullUrl = ""; string PageID = ""; string GroupID = ""; string ProductID = ""; List<string> breadcrumb = new List<string>(); bool breadcrumb_generate = true; Dynamicweb.eCommerce.Products.Group group = null; try { fullUrl = System.Web.HttpContext.Current.Request.Url.ToString(); PageID = extractQuery(fullUrl, "ID"); GroupID = extractQuery(fullUrl, "GroupID"); ProductID = extractQuery(fullUrl, "ProductID"); try { if(GroupID != "") { group = Dynamicweb.eCommerce.Products.Group.GetGroupByID(GroupID); } } catch (Exception exc) { } } catch(Exception e) { breadcrumb_generate = false; } } @functions { string extractQuery(string fullUrl, string param) { var rturnval = ""; try { var br_query = fullUrl.Split('?')[1]; rturnval = br_query.Split('&') .Single(s => s.StartsWith(string.Format("{0}=", param))) .Substring(param.Length + 1); }catch (Exception e){ string s = e.ToString(); rturnval = s; rturnval = ""; } return rturnval; } } @{ <style> #navigation-breadcrump { margin: 0; padding: 10px 0 20px 0; background: #fff; } </style> <div class="col-lg-12"> <ol id="navigation-breadcrump" class="breadcrumb"> @{ try { var page = Dynamicweb.Content.Page.GetPageById(Convert.ToInt32(PageID)); @RenderParentNavigation(page) if (GroupID != "") { //Do not forget to include parent page ID!!! <text>@RenderParentEcomNav(group, page.ID.ToString())</text> } if (ProductID != "") { var product = Product.GetProductByID(ProductID); <li>@product.Name</li> } } catch (Exception error) { <text></text> } } </ol> </div> } @helper RenderParentNavigation(Dynamicweb.Content.Page page) { var parent = page.Parent; if (page.Parent != null) { <text>@RenderParentNavigation(parent)</text> } else { <text><li><i class="fa fa-home"></i> <a href="/">@Translate("Breadcrumb.Root")</a></li></text> } string bread_pageHref = string.Format("/Default.aspx?id={0}", page.ID.ToString()); /*if ((bool)page.Values["PageShowInLegend"]) { <li><a href="@bread_pageHref">@page.MenuText</a></li> }*/ if (Dynamicweb.Input.FormatBoolean(Dynamicweb.Frontend.Page.FindPage(page.ID).get_Value("PageShowInLegend"))) { <li><a href="@bread_pageHref">@page.MenuText</a></li> } /*<li><a href="@bread_pageHref">@page.MenuText</a></li>*/ } @helper RenderParentEcomNav(Dynamicweb.eCommerce.Products.Group group, string catalogPageID) { if (group.ParentGroupsDefaultLanguage != null && group.ParentGroupsDefaultLanguage.Count > 0) { string parent_id = group.ParentGroupsDefaultLanguage[0].ID; Dynamicweb.eCommerce.Products.Group parent = Dynamicweb.eCommerce.Products.Group.GetGroupByID(parent_id); if (parent != null) { <text>@RenderParentEcomNav(parent, catalogPageID)</text> } else { <text><li>Shop-root</li></text> } } if (Pageview.Area.ID == 1) { string groupHref = string.Format("/Default.aspx?id={0}&GroupID={1}", catalogPageID, group.ID); <li><a href="@groupHref">@group.Name</a></li> } else if (Pageview.Area.ID == 3) { <li><span>@group.Name</span></li> } } </div> <div> </div> </div> } else if (Pageview.Area.ID == 2) { <text> [Include file 'Navigation/breadcrumb_BSE.cshtml' not found in 'Templates/Designs/BS/Catalog.cshtml'] </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"> <p class="mailbox_text">@SignUp</p> </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> --> @{ if (Pageview.Area.ID == 1) { //<text><!--@Global:Paragraph.Content(1232)--></text> <text><p class="mailbox_text"><a href="http://us5.campaign-archive1.com/home/?u=67fefc8f70678c388263ea8dd&id=e1fed53476" target="_blank">Meld deg på her</a> for å få BS-katalogen på e-post!</p></text> } else if (Pageview.Area.ID == 3) { <text><!--@Global:Paragraph.Content(1076)--></text> } else { string newsletterService = ""; try { newsletterService = Dynamicweb.Frontend.PageView.Current().Area.Item["Ajax_NewsletterSubscription"].ToString(); }catch { } <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> </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.min.js"></script> @Scripts.Render("~/bundles/plugins/scripts/base") <script src="http://getbootstrap.com/examples/offcanvas/offcanvas.js"></script> @{ if (Pageview.Area.ID == 2) { // 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 PageviewAreaId = parseInt(@Pageview.Area.ID); 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(); }); </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 == 1) { @Styles.Render("~/bundles/plugins/styles/modal") } @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>