Exception in template (Designs/Outwell/_parsed/ModulePageItem.parsed.cshtml): System.NullReferenceException: Object reference not set to an instance of an object.
   at OaseOutdoors.Core.Extensions.GroupExtenstion.GetAncestors(Group group, List`1 ancestors) in C:\projects\oase\src\Core\Extensions\GroupExtenstion.cs:line 26
   at OaseOutdoors.Core.Extensions.GroupExtenstion.GetAncestors(Group group) in C:\projects\oase\src\Core\Extensions\GroupExtenstion.cs:line 12
   at OaseOutdoors.Services.NavigationService.NavigationService.GetGroupStatus(String groupId) in C:\projects\oase\src\Services\NavigationService\NavigationService.cs:line 171
   at OaseOutdoors.Services.NavigationService.NavigationService.GetNavigationForGroups(IEnumerable`1 groups, Int32 level) in C:\projects\oase\src\Services\NavigationService\NavigationService.cs:line 109
   at OaseOutdoors.Services.NavigationService.NavigationService.GetNavigationLevel(IEnumerable`1 pages) in C:\projects\oase\src\Services\NavigationService\NavigationService.cs:line 80
   at OaseOutdoors.Components.Shared.Layout.Master.ModelBuilders.MasterViewModelBuilder.GetViewModel(Int32 areaId) in C:\projects\oase\src\Components\Shared\Layout\Master\ModelBuilders\MasterModelBuilder.cs:line 79
   at CompiledRazorTemplates.Dynamic.bbfadcca.Execute()
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context) in c:\Users\abbottm\Documents\GitHub\RazorEngine\src\Core\RazorEngine.Core\Templating\TemplateBase.cs:line 126
   at RazorEngine.Templating.TemplateService.Run(ITemplate template, DynamicViewBag viewBag) in c:\Users\abbottm\Documents\GitHub\RazorEngine\src\Core\RazorEngine.Core\Templating\TemplateService.cs:line 608
   at RazorEngine.Templating.TemplateService.Parse(String razorTemplate, Object model, DynamicViewBag viewBag, String cacheName) in c:\Users\abbottm\Documents\GitHub\RazorEngine\src\Core\RazorEngine.Core\Templating\TemplateService.cs:line 439
   at RazorEngine.Razor.Parse[T](String razorTemplate, T model, DynamicViewBag viewBag, String cacheName) in c:\Users\abbottm\Documents\GitHub\RazorEngine\src\Core\RazorEngine.Core\Razor.cs:line 290
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()
@using System.Linq @using System.Web @using System.Web.Hosting @using Dynamicweb.Extensibility @using Dynamicweb.Frontend @using Dynamicweb.Security.UserManagement @using OaseOutdoors.Components.Shared.Layout.Master.ModelBuilders @using OaseOutdoors.Services.StaticResourceService.Initialization @using OaseOutdoors.Components.Shared.Layout.Master.Models @using OaseOutdoors.Components.Shared.Modules.Ecom.ModelBuilders @using OaseOutdoors.Core.Extensions @using OaseOutdoors.Services.MiniCartService.Initialization @using OaseOutdoors.Services.NavigationService.Models @using OaseOutdoors.Services.StaticResourceService.Interfaces @using OaseOutdoors.Services.ImageService.Enums @using OaseOutdoors.Services.EcomUrlService.Initialization @using OaseOutdoors.Services.UrlParserService.Initialization; @inherits Dynamicweb.Rendering.ViewModelTemplate<PageViewModel> @{ var area = PageView.Current().Area; var areas = Dynamicweb.Services.Areas.GetAreas().Where(x => x.Active && x.Item["ShopPublished"] != null && (bool)x.Item["ShopPublished"] && x.Name.ToLower().Contains(area.Name.Split(':')[0].Trim().ToLower())).ToList(); var masterStaticResourceService = ServiceLocator.Current.GetStaticResourceService(); var masterViewModelService = new MasterViewModelBuilder(); var masterViewModel = masterViewModelService.GetViewModel(area.ID); var productViewModelService = new ProductViewModelBuilder(); var urlService = ServiceLocator.Current.GetEcomUrlService(); var urlParserService = ServiceLocator.Current.GetUrlParserService(); var miniCartService = ServiceLocator.Current.GetMiniCartService(); var miniCartProductsCount = miniCartService.GetProductsCount(area); var valutaSelector = HttpContext.Current.Request.Cookies["currencySelector"]; var userId = HttpContext.Current.Request["userid"] != null ? HttpContext.Current.Request["userid"] : ""; var currentDatetime = DateTime.Now; var googleId = area.Item["GoogleManagerId"]; var currentUser = User.GetCurrentUser(PagePermissionLevels.Frontend); masterStaticResourceService.ActivityId = masterViewModel.NewsletterPopup.ActivityId; } @helper RenderChildren(NavigationViewModel entity, string gotoTranslation, IStaticResourceService masterStaticResourceService) { var currentDatetime = DateTime.Now; if (entity.Children == null || !entity.Children.Any()) { return; } <ul class="navigation__submenu-links"> @foreach (var child in entity.Children.Where(x => x.PublishedDateFrom <= currentDatetime && x.PublishedDateTo >= currentDatetime)) { if (child.Children != null && child.Children.Any()) { <li class="@child.LinkStatus.GetDescription() parent"> <div class="navigation__submenu-links-main"> <a href="@child.Link"> <svg aria-hidden="true"> <use xlink:href="@masterStaticResourceService.AddTimeStamp("/static/dist/svg/_bundle.svg")#arrow-right"></use> </svg><span>@child.LinkTitle @(child.IsEcommerce && child.ProductCount > 0 ? "(" + child.ProductCount + ")" : string.Empty)</span> </a> <div></div> </div> <div class="navigation__submenu"> <div class="container"> <div class="navigation__submenu-nav"> <div class="navigation__submenu-title"> <span><span class="navigation__submenu-name">@child.LinkTitle</span> @(child.IsEcommerce && child.ProductCount > 0 ? "(" + child.ProductCount + ")" : string.Empty)</span> </div> <ul class="navigation__submenu-links navigation__submenu-links--highlighted"> <li> <a href="@child.Link">@gotoTranslation @child.LinkTitle.ToLower()</a> </li> </ul> @RenderChildren(child, gotoTranslation, masterStaticResourceService) </div> </div> </div> </li> } else { <li class="@child.LinkStatus.GetDescription()"> <div class="navigation__submenu-links-main"> <a href="@child.Link"> <svg aria-hidden="true"> <use xlink:href="@masterStaticResourceService.AddTimeStamp("/static/dist/svg/_bundle.svg")#arrow-right"></use> </svg><span>@child.LinkTitle @(child.IsEcommerce && child.ProductCount > 0 ? "(" + child.ProductCount + ")" : string.Empty)</span> </a> </div> </li> } } </ul> } <!DOCTYPE html> <html lang="@masterViewModel.TwoLetterIsoLanguageName" class="no-js"> <head data-settings="disableparsing:true;"> @using Dynamicweb.Extensibility @using Dynamicweb.Frontend @using OaseOutdoors.Services.StaticResourceService.Initialization @inherits Dynamicweb.Rendering.ViewModelTemplate<PageViewModel> @{ var headStaticResourceService = ServiceLocator.Current.GetStaticResourceService(); var modernizerPath = "~/static/dist/js/modernizr.js"; var modernizerContent = headStaticResourceService.GetFileContent(modernizerPath); } @* todo: !!! REMOVE THIS LINE WHEN GOING LIVE !!! *@ @*<meta name="robots" content="noindex, nofollow">*@ <meta charset="utf-8"> @* Add to web.config *@ <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title> @if (!string.IsNullOrEmpty(PageView.Current().Page.MetaTitle)) { @PageView.Current().Page.MetaTitle } else { @(PageView.Current().Page.MenuText + " - Outwell") } </title> @* Use this format for CSS instead if you want to use preloading: <link rel="preload" href="/static/dist/css/main.min.css" as="style" onload="this.rel='stylesheet'"> Remember to *inline* polyfills for preload-format in page footer: https://github.com/filamentgroup/loadCSS *@ <link rel="stylesheet" href="@headStaticResourceService.AddTimeStamp("/static/dist/css/outwell.min.css")" type="text/css"> <meta name="description" content="@Pageview.Page.Description"> <meta name="keywords" content="@Pageview.Page.Keywords"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="format-detection" content="telephone=no"> <link rel="icon" href="@headStaticResourceService.AddTimeStamp("/static/dist/media/favicon_ow.ico")" type="image/x-icon" /> @if (!headStaticResourceService.IsProduction) { <meta name="robots" content="noindex, nofollow"> } @RenderSnippet("canonical") @if (headStaticResourceService.IsProduction) { <!-- Google Tag Manager --> <script> (function (w, d, s, l, i) { w[l] = w[l] || []; w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' }); var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f); })(window, document, 'script', 'dataLayer', '@PageView.Current().Area.Item["GoogleManagerId"]');</script> <!-- End Google Tag Manager --> <script> (function (h, o, t, j, a, r) { h.hj = h.hj || function () { (h.hj.q = h.hj.q || []).push(arguments) }; h._hjSettings = { hjid: 442799, hjsv: 6 }; a = o.getElementsByTagName('head')[0]; r = o.createElement('script'); r.async = 1; r.src = t + h._hjSettings.hjid + j + h._hjSettings.hjsv; a.appendChild(r); })(window, document, 'https://static.hotjar.com/c/hotjar-', '.js?sv='); </script> <!-- Bing --> if (Pageview.AreaID == 5) { <script> (function (w, d, t, r, u) { var f, n, i; w[u] = w[u] || [], f = function () { var o = { ti: "25049519" }; o.q = w[u], w[u] = new UET(o), w[u].push("pageLoad") }, n = d.createElement(t), n.src = r, n.async = 1, n.onload = n.onreadystatechange = function () { var s = this.readyState; s && s !== "loaded" && s !== "complete" || (f(), n.onload = n.onreadystatechange = null) }, i = d.getElementsByTagName(t)[0], i.parentNode.insertBefore(n, i) })(window, document, "script", "//bat.bing.com/bat.js", "uetq"); </script> } <!-- End Bing --> <!-- Facebook Pixel Code --> <script> !function (f, b, e, v, n, t, s) { if (f.fbq) return; n = f.fbq = function () { n.callMethod ? n.callMethod.apply(n, arguments) : n.queue.push(arguments) }; if (!f._fbq) f._fbq = n; n.push = n; n.loaded = !0; n.version = '2.0'; n.queue = []; t = b.createElement(e); t.async = !0; t.src = v; s = b.getElementsByTagName(e)[0]; s.parentNode.insertBefore(t, s) }(window, document, 'script', 'https://connect.facebook.net/en_US/fbevents.js'); fbq('init', '803092053109985'); fbq('track', 'PageView'); </script> <noscript> <img height="1" width="1" src="https://www.facebook.com/tr?id=803092053109985&ev=PageView &noscript=1" /> </noscript> <!-- End Facebook Pixel Code --> } @* You can use "prefetch" to preload all important assets if you're not using HTTP/2 push *@ <link rel="prefetch" href="@headStaticResourceService.AddTimeStamp("/static/dist/js/main.min.js")"> <script> @if (!string.IsNullOrWhiteSpace(modernizerContent)) { @modernizerContent } </script> <script type="text/javascript" src="//fast.fonts.net/jsapi/435e879a-fed1-4494-b286-69490b465a2f.js"></script> @SnippetStart("canonical") @if (PageView.Current().Page.NavigationTag != "ecommerce") { <link rel="canonical" href="@masterViewModel.Canonical" /> foreach (var hrefLang in masterViewModel.HrefLangs) { <link rel="alternate" hreflang="@hrefLang.HrefLang" href="@hrefLang.Href" /> } } @SnippetEnd("canonical") </head> <body data-area-id="@Pageview.AreaID" data-area-currencyCode="@Pageview.Area.EcomCurrencyId" data-search-see-all="@Translate("SearchSeeAll", "See all")" data-search-results="@Translate("SearchResults", "search results")"> @if (masterStaticResourceService.IsProduction) { <!-- Google Tag Manager (noscript) --> <noscript> <iframe src="https://www.googletagmanager.com/ns.html?id=@googleId" height="0" width="0" style="display:none;visibility:hidden"></iframe> </noscript> <!-- End Google Tag Manager (noscript) --> } @if (HttpContext.Current.IsDebuggingEnabled) { <script id="__bs_script__"> document.write("<script async src='http://localhost:3000/browser-sync/browser-sync-client.js?v=2.18.13'><\/script>"); </script> } <input type="checkbox" name="header__expand-search" id="header__expand-search" class="hidden" /> <div class="header" data-module="header"> <div class="header__info"> @if (masterViewModel.TopMessage != null && (!string.IsNullOrEmpty(masterViewModel.TopMessage.ShortText) || !string.IsNullOrEmpty(masterViewModel.TopMessage.LongText))) { if (valutaSelector == null || PageView.Current().AreaID != 1) { if (!string.IsNullOrEmpty(masterViewModel.TopMessage.ShortText)) { <div class="header__info-content header__info-content--short"> <p>@masterViewModel.TopMessage.ShortText</p> </div> } if (!string.IsNullOrEmpty(masterViewModel.TopMessage.LongText)) { <div class="header__info-content header__info-content--long"> <p>@masterViewModel.TopMessage.LongText</p> </div> } } } </div> <div class="header__main"> <div class="container-fluid"> <div class="header__main-content"> <div class="header__expand-menu"> <button style="font-size:8px;"><span><span></span></span></button> <div class="header__expand-menu-title">MENU</div> </div> @if (masterViewModel.FriendsIsActive) { if (currentUser != null) { <a href="/@masterViewModel.FriendsLoginPage" class="header__friends"><img src="@masterStaticResourceService.AddTimeStamp("/static/dist/img/outwell/login-icon-mobile.jpg")" alt="@Translate("Outwell Friends", "Outwell Friends")" /></a> } else { <a href="/@masterViewModel.FriendsLoginPage" class="header__friends"><img src="@masterStaticResourceService.AddTimeStamp("/static/dist/img/outwell/login-icon-mobile.jpg")" alt="@Translate("Outwell Friends", "Outwell Friends")" /></a> } } @if (!string.IsNullOrWhiteSpace(masterViewModel.CheckoutPageLink) && !string.IsNullOrWhiteSpace(masterViewModel.CartContext)) { if (valutaSelector == null || PageView.Current().AreaID != 1) { <a href="@masterViewModel.CheckoutPageLink" class="header__cart"> <svg role="img" aria-label="Kurv"><use xlink:href="@masterStaticResourceService.AddTimeStamp("/static/dist/svg/_bundle.svg")#cart"></use></svg> <div class="header__cart-amount"> <div>@miniCartProductsCount</div> </div> </a> } } <div class="header__logo"> <a href="@masterViewModel.Logo.LogoLink"> <div class="header__logo-icon header__logo-icon--detailed"> <svg aria-hidden="true"><use xlink:href="@masterStaticResourceService.AddTimeStamp("/static/dist/svg/_bundle.svg")#outwell-logo"></use></svg> </div> <div class="header__logo-icon header__logo-icon--simple"> <img src="/static/dist/img/outwell.png" alt="Outwell - tents, awnings, camping accessories" /> </div> </a> </div> </div> </div> </div> <div class="header__search"> <button><span><svg role="img" aria-label="Søg"><use xlink:href="@masterStaticResourceService.AddTimeStamp("/static/dist/svg/_bundle.svg")#search"></use></svg></span></button> </div> <div class="header__menus"> <div class="header__menus-inside"> <div class="navigation"> <div class="container"> <button class="navigation__back"> <svg aria-hidden="true"><use xlink:href="@masterStaticResourceService.AddTimeStamp("/static/dist/svg/_bundle.svg")#arrow-left"></use></svg> <span>@Translate("MainMenu", "Main menu")</span> </button> @if (masterViewModel.Navigation.Any()) { <ul class="navigation__mainmenu"> @foreach (var item in masterViewModel.Navigation.Where(x => x.PublishedDateFrom <= currentDatetime && x.PublishedDateTo >= currentDatetime)) { if (item.Children.Any()) { <li class="navigation__mainmenu-item @item.LinkStatus.GetDescription() parent"> <div class="navigation__mainmenu-link"> <a href="@item.Link">@item.LinkTitle</a> <div></div> </div> <div class="navigation__submenu @(item.IsEcommerce && item.CallToAction != null ? string.Empty : "navigation__submenu--no-detail")"> <div class="container"> <div class="navigation__submenu-nav"> <div class="navigation__submenu-title"> <span><span class="navigation__submenu-name">@item.LinkTitle</span> @(item.IsEcommerce && item.ProductCount > 0 ? "(" + item.ProductCount + ")" : string.Empty)</span> </div> <ul class="navigation__submenu-links navigation__submenu-links--highlighted"> <li> <a href="@item.Link">@Translate("NavigationGoToTranslation", "Go to") @item.LinkTitle.ToLower()</a> </li> @if (item.CollectionLink != null && !string.IsNullOrWhiteSpace(item.CollectionLink.Link) && !string.IsNullOrWhiteSpace(item.CollectionLink.LinkTitle)) { <li> <a href="@item.CollectionLink.Link">@item.CollectionLink.LinkTitle</a> </li> } </ul> @RenderChildren(item, Translate("NavigationGoToTranslation", "Go to"), masterStaticResourceService) </div> @if (item.IsEcommerce && item.CallToAction != null) { <article class="navigation__submenu-detail"> @if (!string.IsNullOrWhiteSpace(item.CallToAction.Image) && !string.IsNullOrWhiteSpace(item.CallToAction.ImageAlt)) { <figure> <img src="@item.CallToAction.Image" alt="@item.CallToAction.ImageAlt" /> </figure> } <div> <div> @if (!string.IsNullOrWhiteSpace(item.CallToAction.Heading)) { <h1>@item.CallToAction.Heading</h1> } @if (!string.IsNullOrWhiteSpace(item.CallToAction.Text)) { <p>@item.CallToAction.Text</p> } </div> <div> @if (!string.IsNullOrWhiteSpace(item.CallToAction.Link) && !string.IsNullOrWhiteSpace(item.CallToAction.LinkTitle)) { <a class="btn btn--filled" href="@item.CallToAction.Link"> <span class="btn__icon"> <svg aria-hidden="true"> <use xlink:href="@masterStaticResourceService.AddTimeStamp("/static/dist/svg/_bundle.svg")#arrow-right"></use> </svg> </span> <span class="btn__text">@item.CallToAction.LinkTitle</span> </a> } </div> </div> </article> } </div> </div> </li> } else { <li class="navigation__mainmenu-item @item.LinkStatus.GetDescription()"> <div class="navigation__mainmenu-link @item.LinkStatus.GetDescription()"> <a href="@item.Link">@item.LinkTitle</a> </div> </li> } } </ul> } </div> @if (masterViewModel.Languages.Any()) { <div class="country-picker"> <header> <div class="container"> <span>@Translate("ChooseAnotherCountry", "Choose another country")</span> <button class="country-picker__close"> <svg aria-hidden="true"> <use xlink:href="@masterStaticResourceService.AddTimeStamp("/static/dist/svg/_bundle.svg")#close"></use> </svg> </button> </div> </header> <div class="container"> <div class="country-picker__list"> <h3><span>@Translate("ChooseCountry", "Choose country")</span></h3> @RenderSnippet("languageSelector") @SnippetStart("languageSelector") @if (PageView.Current().Page.NavigationTag != "ecommerce") { <ul> @foreach (var languageArea in areas) { var hrefLang = masterViewModel.HrefLangs.FirstOrDefault(x => x.HrefAreaId == languageArea.ID); if (hrefLang == null || hrefLang.Href.ToLower().Contains("page-not-found")) { hrefLang = new HrefLangViewModel(); hrefLang.HrefName = languageArea.Item["ShopLanguageName"].ToString() ?? string.Empty; hrefLang.HrefLang = languageArea.CultureInfo.Name; hrefLang.Href = "/Default.aspx?areaid=" + languageArea.ID; hrefLang.HrefAreaId = languageArea.ID; } if (hrefLang != null && hrefLang.HrefLang != "x-default") { <li class="country-picker__item @(hrefLang.HrefAreaId == Pageview.AreaID ? "country-picker__item--current" : string.Empty)"> <a href="@hrefLang.Href"> <svg aria-hidden="true"> <use xlink:href="@masterStaticResourceService.AddTimeStamp("/static/dist/svg/_bundle.svg")#arrow-right"></use> </svg> <span>@hrefLang.HrefName</span> </a> </li> } } </ul> } @SnippetEnd("languageSelector") </div> </div> </div> } </div> @{ var noBasket = "service-menu--no-basket"; if (!string.IsNullOrWhiteSpace(masterViewModel.CheckoutPageLink) && !string.IsNullOrWhiteSpace(masterViewModel.CartContext)) { if (valutaSelector == null || Pageview.AreaID != 1) { noBasket = ""; } } } <div class="service-menu @noBasket"> <div class="container"> <ul class="service-menu__navigation"> @foreach (PageLinkItem linkItem in masterViewModel.ServiceMenu.MenuItems) { <li> <a href="@linkItem.PageLink">@linkItem.PageLinkTitle</a> </li> } @if (masterViewModel.FriendsIsActive) { <li> @if (currentUser != null) { <button onclick="javascript:window.location='/@masterViewModel.FriendsLoginPage'" class="service-menu__friends"><img src="@masterStaticResourceService.AddTimeStamp("/static/dist/img/outwell/login-icon-known.jpg")" alt="@Translate("Outwell Friends", "Outwell Friends")" /><span>@Translate("Go to", "Go to")</span></button> } else { <button class="service-menu__friends"><img src="@masterStaticResourceService.AddTimeStamp("/static/dist/img/outwell/login-icon-unknown.jpg")" alt="@Translate("Outwell Friends", "Outwell Friends")" /><span>@Translate("Login", "Login")</span></button> } </li> } @if (masterViewModel.Languages.Any()) { <li> <div class="service-menu__language"> <span class="service-menu__language-flag"><svg aria-hidden="true"><use xlink:href="@masterStaticResourceService.AddTimeStamp("/static/dist/svg/_bundle.svg")#flag-@masterViewModel.Languages.First(x => x.IsCurrent).ISOCode"></use></svg></span> <span class="service-menu__language-title">@Translate("Language", "Language")</span> <span class="service-menu__language-value">@masterViewModel.Languages.First(x => x.IsCurrent).Name</span> </div> </li> } </ul> <div class="service-menu__info"> <div class="service-menu__logo"> <svg aria-hidden="true"><use xlink:href="@masterStaticResourceService.AddTimeStamp("/static/dist/svg/_bundle.svg")#outwell-logo-simple"></use></svg> </div> @if (!string.IsNullOrEmpty(masterViewModel.Footer.ContactUsPhone)) { <a href="tel:@masterViewModel.Footer.ContactUsPhone">@masterViewModel.Footer.ContactUsPhone</a> } <dl class="service-menu__opening-hours"> @foreach (var hoursItem in masterViewModel.Footer.OpeningHours) { <dt>@hoursItem.DaysLocalized</dt> <dd class="opening__hours">@hoursItem.StartTime-@hoursItem.EndTime</dd> } </dl> </div> </div> </div> </div> </div> <div class="search-overlay" data-search-url="@masterViewModel.SearchResultsPageLink" data-no-results="@Translate("SearchNoResults", "Sorry no results were found")" data-products-title="@Translate("SearchProducts", "Products")" data-categories-title="@Translate("SearchCategories", "Categories")"> <div class="container-fluid"> <div class="search-overlay__container"> <div class="search-overlay__input"> <input type="search" name="search" id="search" /> <label for="search"> <svg aria-hidden="true"> <use xlink:href="@masterStaticResourceService.AddTimeStamp("/static/dist/svg/_bundle.svg")#search-simple"></use> </svg> @Translate("SearchFindLabel", "Find what you are looking for") </label> <button class="search-overlay__close"> <svg aria-hidden="true"> <use xlink:href="@masterStaticResourceService.AddTimeStamp("/static/dist/svg/_bundle.svg")#close"></use> </svg> </button> </div> <div class="container"> <div class="search-overlay__results"></div> </div> </div> </div> </div> </div> <main> @using Dynamicweb.Frontend; @using Dynamicweb.Rendering; @using OaseOutdoors.Components.Shared.Layout.Master.ModelBuilders; @inherits ViewModelTemplate<PageViewModel> @Title("Content page template") @{ var masterService = new MasterViewModelBuilder(); var masterModel = masterService.GetViewModel(PageView.Current().Area.ID); } @Model.Placeholder("Body", "Body", "items-allowed:EcomRibbonItem;unwrap:true") @RenderParagraphContent(masterModel.NewsletterAndConsentSubscriptionPargraphId) @if (masterViewModel.FriendsIsActive && currentUser == null) { if (masterViewModel.FriendsLoginParagraphId > 0 && masterViewModel.FriendsSignupParagraphId > 0) { <div id="LoginPopupModal" class="login-popup" data-module="loginPopup"> <div class="modal-content-html"> <span class="login-popup-modal__close">&times;</span> <section class="login-popup-modal__content"> <ul class="login-popup-modal__headers"> <li class="login-popup-modal__login-button active">@Translate("Login", "Login")</li> <li class="login-popup-modal__signup-button">@Translate("I want to join the club", "I want to join the club")</li> </ul> <div class="login-popup-modal__login-area active">@RenderParagraphContent(masterViewModel.FriendsLoginParagraphId)</div> <div class="login-popup-modal__signup-area">@RenderParagraphContent(masterViewModel.FriendsSignupParagraphId)</div> </section> </div> </div> } } @*News letter popup*@ @if (masterStaticResourceService.ShowConsent(PageView.Current().Area.Item["SettingsNewsletterGroupId"].ToString()) && !string.IsNullOrEmpty(@masterViewModel.NewsletterPopup.ActivityId)) { <div id="popupModal" class="popup-modal" data-module="consentPopup"> <input type="hidden" value="@userId" id="userid" /> @if (!string.IsNullOrEmpty(@masterViewModel.NewsletterPopup.ActivityId)) { <input type="hidden" value="@masterViewModel.NewsletterPopup.ActivityId" id="ActivityID" /> } <div class="modal-content"> <span class="popup-modal__close">&times;</span> <section class="permission-data"> <div class="container1"> <div class="permission-data__content"> <article> <div class="text__body"> <div class="text__body-left"> @if (masterViewModel.NewsletterPopup.Image != null && !string.IsNullOrWhiteSpace(masterViewModel.NewsletterPopup.ImageAltText)) { <img src="@masterStaticResourceService.GetAbsoluteUrl(masterViewModel.NewsletterPopup.Image.SetWidth(312).SetHeight(380).SetCompression(80).SetCrop(CropType.KeepAspectRatio).GetCrop())" alt="@masterViewModel.NewsletterPopup.ImageAltText" border="0" style="vertical-align:bottom;" /> } </div> <div class="text__body-right"> <div class="permission-data__heading"> @if (!string.IsNullOrEmpty(masterViewModel.NewsletterPopup.Headline)) { <span>@masterViewModel.NewsletterPopup.Headline</span> } </div> <div class="permission-data__confirm-newsletter"> @if (!string.IsNullOrEmpty(masterViewModel.NewsletterPopup.SubHeadline)) { <span>@masterViewModel.NewsletterPopup.SubHeadline</span> } </div> <div class="permission-data__modulewrap"> <div style="margin-bottom:10px;height:40px;"> <button class="btn consent-submit-button" id="Submitform" name="Submitform" value="Submitform" type="button" disabled> <span class="btn__icon"> <svg role="img"> <use xlink:href="/static/dist/svg/_bundle.svg?ts=636555677940000000#checkmark"></use> </svg> </span> <span class="btn__text"> @if (!string.IsNullOrEmpty(masterViewModel.NewsletterPopup.ButtonText)) { @masterViewModel.NewsletterPopup.ButtonText } </span> </button> <input type="submit" id="dw-form-3-submit" name="submit" value="submit"> </div> <div class="form__field-group1"> <table> <tr> <td> <input type="checkbox" id="Acceptterms" required /> <div id="Acceptterms-error" class="error"></div> </td> <td class="permission-data__description"> @if (!string.IsNullOrEmpty(masterViewModel.NewsletterPopup.CheckboxText)) { @masterViewModel.NewsletterPopup.CheckboxText } </td> </tr> </table> </div> </div> <div class="permission-data__text"> @if (!string.IsNullOrEmpty(masterViewModel.NewsletterPopup.Text)) { <span>@masterViewModel.NewsletterPopup.Text</span> } </div> </div> </div> </article> </div> </div> </section> </div> </div> } @*end News letter popup*@ </main> <footer class="footer container-fluid"> <div class="footer__logo--container"> <svg aria-hidden="true" class="footer__logo--icon"> <use xlink:href="@masterStaticResourceService.AddTimeStamp("/static/dist/svg/_bundle.svg")#outwell-logo-simple"></use> </svg> </div> <div class="container"> <div class="footer__content"> <input type="checkbox" id="footer-toggle" checked> <div class="footer__navigation"> @if (!string.IsNullOrEmpty(masterViewModel.Footer.CallToActionLink) && !string.IsNullOrEmpty(masterViewModel.Footer.CallToActionLinkTitle)) { <a href="@masterViewModel.Footer.CallToActionLink" class="btn btn--filled"> <span class="btn__text">@masterViewModel.Footer.CallToActionLinkTitle</span> </a> } <br /> @if (!string.IsNullOrEmpty(masterViewModel.Footer.FindDealerLinkTitle) && !string.IsNullOrEmpty(masterViewModel.Footer.FindDealerLink)) { <a href="@masterViewModel.Footer.FindDealerLink" class="btn btn--filled"> <span class="btn__text">@masterViewModel.Footer.FindDealerLinkTitle</span> </a> } @if (!string.IsNullOrEmpty(masterViewModel.Footer.ContactUsMobileButtonText)) { <label for="footer-toggle" class="btn btn--filled footer-toggle-btn"> <span class="btn__icon"> <svg role="img"> <use xlink:href="@masterStaticResourceService.AddTimeStamp("/static/dist/svg/_bundle.svg")#arrow-right"></use> </svg> </span> <span class="btn__text">@masterViewModel.Footer.ContactUsMobileButtonText</span> </label> } </div> <div class="footer__information"> <div class="footer__information-inner"> <div class="footer__information-column footer__information-column--desktop"> @if (!string.IsNullOrEmpty(masterViewModel.Footer.CustomerServiceLink) && !string.IsNullOrEmpty(masterViewModel.Footer.CustomerServiceLinkTitle)) { <h3> <a href="@masterViewModel.Footer.CustomerServiceLink"> <span class="footer__heading-icon"> <svg role="img"> <use xlink:href="@masterStaticResourceService.AddTimeStamp("/static/dist/svg/_bundle.svg")#arrow-right"></use> </svg> </span> <span class="footer__heading-text">@masterViewModel.Footer.CustomerServiceLinkTitle</span> </a> </h3> } @if (!string.IsNullOrEmpty(masterViewModel.Footer.CallToActionLink) && !string.IsNullOrEmpty(masterViewModel.Footer.CallToActionLinkTitle)) { <a href="@masterViewModel.Footer.CallToActionLink" class="btn btn--filled footer-toggle-btn footer__information-btn"> <span class="btn__icon"> <svg role="img"> <use xlink:href="@masterStaticResourceService.AddTimeStamp("/static/dist/svg/_bundle.svg")#arrow-right"></use> </svg> </span> <span class="btn__text">@masterViewModel.Footer.CallToActionLinkTitle</span> </a> } </div> <div class="footer__information-column" itemscope itemtype="http://schema.org/LocalBusiness"> <div> @if (!string.IsNullOrEmpty(masterViewModel.Footer.AddressTitle)) { <h3>@masterViewModel.Footer.AddressTitle</h3> } <link itemprop="image" content="@masterStaticResourceService.GetAbsoluteUrl("~/static/dist/svg/outwell-logo.svg")"> <div itemprop="name">@masterViewModel.Footer.AddressCompany</div> <ul itemprop="address" itemscope itemtype="http://schema.org/PostalAddress"> <li itemprop="streetAddress">@masterViewModel.Footer.AddressStreet</li> <li> <span itemprop="postalCode">@masterViewModel.Footer.AddressPostcode</span> <span itemprop="addressLocality">@masterViewModel.Footer.AddressCity</span></li> <li itemprop="addressCountry">Denmark@* TODO: add country to viewmodel @masterViewModel.Footer.AddressCountry*@</li> </ul> <ul> <li><a href="mailto:@masterViewModel.Footer.ContactUsEmail" itemprop="email">@masterViewModel.Footer.ContactUsEmail</a></li> @if (!string.IsNullOrEmpty(masterViewModel.Footer.ContactUsFax)) { <li itemprop="faxNumber">Fax: @masterViewModel.Footer.ContactUsFax</li> } </ul> <meta itemprop="telephone" name="phone" content="@masterViewModel.Footer.ContactUsPhone"> </div> <div> @if (!string.IsNullOrEmpty(masterViewModel.Footer.OpeningHoursTitle)) { <h3>@masterViewModel.Footer.OpeningHoursTitle</h3> } <ul> @foreach (var hoursItem in masterViewModel.Footer.OpeningHours) { <li><span class="opening-days">@hoursItem.DaysLocalized</span> <span class="opening-hours">@hoursItem.StartTime-@hoursItem.EndTime</span></li> } @if (!string.IsNullOrEmpty(masterViewModel.Footer.ContactUsPhone)) { <li class="opening-hours">@masterViewModel.Footer.ContactUsPhone</li> } </ul> @foreach (var hoursViewModel in masterViewModel.Footer.OpeningHours) { <meta itemprop="openingHours" content="@hoursViewModel.StartDay-@hoursViewModel.EndDay @hoursViewModel.StartTime-@hoursViewModel.EndTime" /> } </div> </div> <div class="footer__information-column"> @if (!string.IsNullOrEmpty(masterViewModel.Footer.AboutLinkTitle) && !string.IsNullOrEmpty(masterViewModel.Footer.AboutLink)) { <h3> <a href="@masterViewModel.Footer.AboutLink"> <span class="footer__heading-icon"> <svg role="img"> <use xlink:href="@masterStaticResourceService.AddTimeStamp("/static/dist/svg/_bundle.svg")#arrow-right"></use> </svg> </span> <span class="footer__heading-text">@masterViewModel.Footer.AboutLinkTitle</span> </a> </h3> } @if (masterViewModel.Footer.AboutLinks.Any()) { <ul> @foreach (var link in masterViewModel.Footer.AboutLinks) { <li><a href="@link.PageLink">@link.PageLinkTitle</a></li> } </ul> } @if (!string.IsNullOrEmpty(masterViewModel.Footer.FindDealerLinkTitle) && !string.IsNullOrEmpty(masterViewModel.Footer.FindDealerLink)) { <h3 class="footer__information-column-dealerlink"> <a href="@masterViewModel.Footer.FindDealerLink"> <span class="footer__heading-icon"> <svg role="img"> <use xlink:href="@masterStaticResourceService.AddTimeStamp("/static/dist/svg/_bundle.svg")#arrow-right"></use> </svg> </span> <span class="footer__heading-text">@masterViewModel.Footer.FindDealerLinkTitle</span> </a> </h3> } </div> <div class="footer__information-column"> @if (!string.IsNullOrEmpty(masterViewModel.Footer.ShippingTitle)) { <h3>@masterViewModel.Footer.ShippingTitle</h3> } @if (!string.IsNullOrEmpty(masterViewModel.Footer.ShippingBodyText)) { @masterViewModel.Footer.ShippingBodyText } @if (masterViewModel.Footer.ShippingLinks.Any()) { <ul> @foreach (var link in masterViewModel.Footer.ShippingLinks) { <li><a href="@link.PageLink">@link.PageLinkTitle</a></li> } </ul> } </div> </div> </div> <div class="footer__social"> @if (!string.IsNullOrEmpty(masterViewModel.Footer.SocialMediaTitle)) { <h3>@masterViewModel.Footer.SocialMediaTitle</h3> } @if (!string.IsNullOrEmpty(masterViewModel.Footer.SocialMediaFacebookLink)) { <a href="@Translate("SoMeFacebookLink", "https://www.facebook.com/outwell/")" class="footer__social-icon" title="@masterViewModel.Footer.SocialMediaFacebookLinkTitle"> <span> <svg aria-hidden="true"> <use xlink:href="@masterStaticResourceService.AddTimeStamp("/static/dist/svg/_bundle.svg")#some-facebook"></use> </svg> </span> </a> } @if (!string.IsNullOrEmpty(masterViewModel.Footer.SocialMediaInstagramLink)) { <a href="@Translate("SoMeInstagramLink", "https://www.instagram.com/outwelltents/")" class="footer__social-icon" title="@masterViewModel.Footer.SocialMediaInstagramLinkTitle"> <span> <svg aria-hidden="true"> <use xlink:href="@masterStaticResourceService.AddTimeStamp("/static/dist/svg/_bundle.svg")#some-instagram"></use> </svg> </span> </a> } @if (!string.IsNullOrEmpty(masterViewModel.Footer.SocialMediaTwitterLink)) { <a href="@Translate("SoMeTwitterLink", "https://twitter.com/Outwelltents")" class="footer__social-icon" title="@masterViewModel.Footer.SocialMediaTwitterLinkTitle"> <span> <svg aria-hidden="true"> <use xlink:href="@masterStaticResourceService.AddTimeStamp("/static/dist/svg/_bundle.svg")#some-twitter"></use> </svg> </span> </a> } @if (!string.IsNullOrEmpty(masterViewModel.Footer.SocialMediaYoutubeLink)) { <a href="@Translate("SoMeYoutubeLink", "https://www.youtube.com/user/Outwelltents")" class="footer__social-icon" title="@masterViewModel.Footer.SocialMediaYoutubeLinkTitle"> <span> <svg aria-hidden="true"> <use xlink:href="@masterStaticResourceService.AddTimeStamp("/static/dist/svg/_bundle.svg")#some-youtube"></use> </svg> </span> </a> } </div> </div> </div> <div class="footer__bottom"> @if (!string.IsNullOrEmpty(masterViewModel.Footer.BottomDesignText)) { <div class="footer__bottom-column"> <span class="outwell-flag"> <svg aria-hidden="true"> <use xlink:href="@masterStaticResourceService.AddTimeStamp("/static/dist/svg/_bundle.svg")#flag-da"></use> </svg> </span> <span>@masterViewModel.Footer.BottomDesignText</span> </div> } @if (masterViewModel.Footer.BottomPaymentLogos != null && masterViewModel.Footer.BottomPaymentLogos.Any()) { <div class="footer__bottom-column"> @foreach (var paymentName in masterViewModel.Footer.BottomPaymentLogos) { <span class="footer__payment-icon"> <svg aria-hidden="true"> <use xlink:href="@masterStaticResourceService.AddTimeStamp("/static/dist/svg/_bundle.svg")#pay-@paymentName.ToLower()"></use> </svg> </span> } </div> } <div class="footer__bottom-column"> <p> @if (!string.IsNullOrEmpty(masterViewModel.Footer.BottomPolicyLink) && !string.IsNullOrEmpty(masterViewModel.Footer.BottomPolicyLinkTitle)) { <a href="@masterViewModel.Footer.BottomPolicyLink">@masterViewModel.Footer.BottomPolicyLinkTitle</a> } @if (!string.IsNullOrEmpty(masterViewModel.Footer.BottomCopyrightText)) { @masterViewModel.Footer.BottomCopyrightText } </p> </div> </div> </footer> @SnippetStart("jarvis") @{ var raptorArea = PageView.Current().Area; var settingsRaptorApiKey = raptorArea.Item["SettingsRaptorApiKey"]; } @if (settingsRaptorApiKey != null) { if (PageView.Current().Page.NavigationTag != "ecommerce" && PageView.Current().Device == Dynamicweb.Frontend.Devices.DeviceType.Desktop && !string.IsNullOrEmpty(settingsRaptorApiKey.ToString())) { var jarvis = (HttpContext.Current.Request.Cookies["jarvis"] != null) ? HttpContext.Current.Request.Cookies["jarvis"].Value : "1"; var jarvisBoxStatus = (jarvis == "1") ? "jarvis--open" : string.Empty; var jarvisBtnStatus = (jarvis == "1") ? "" : "jarvis-btn--open"; var raptorAreaId = raptorArea.ID; var raptorBrandId = (raptorArea.Item["SettingsRaptorUserId"] != null) ? raptorArea.Item["SettingsRaptorUserId"].ToString() : string.Empty; var raptorCookieId = (HttpContext.Current.Request.Cookies[raptorBrandId + "rsa"] != null) ? HttpContext.Current.Request.Cookies[raptorBrandId + "rsa"].Value : ""; var raptorContent1 = masterViewModel.JarvisHistory; var raptorContent2 = masterViewModel.JarvisRecommendations; var settingsShopId = raptorArea.Item["SettingsShopId"].ToString(); var ecomPageId = urlParserService.GetPageId(settingsShopId); if (!string.IsNullOrEmpty(raptorCookieId)) { <div data-module="jarvis"> <div class="jarvis @jarvisBoxStatus"> <div class="jarvis__header"> <span class="your">@Translate("Your", "Your")</span> <span class="guide">@Translate("Guide", "Guide")</span> <span class="logo"></span> </div> <div class="jarvis__guide"> <button class="jarvis__close"><span class="round"><svg viewBox="0 0 100 100"><path d="M 10,50 L 60,100 L 70,90 L 30,50 L 70,10 L 60,0 Z" class="arrow"></path></svg></span> @Translate("Hide the wizard", "Hide the wizard")</button> <div class="jarvis__text"> <p> @Translate("The guide follows you around and finds new recommendations based on what you're looking at.", "The guide follows you around and finds new recommendations based on what you're looking at.") </p> </div> </div> <div id="GetCookieRecommendations" class="jarvis__alternatives"> <section class="featured-products container-ribbon ribbon"> <h3>@Translate("Good alternatives", "Good alternatives")</h3> <div class="featured-products__container" data-url="/webservices/jarvis.ashx?areaId=@raptorAreaId&raptorFunction=GetCookieRecommendations"> @foreach (var raptorProduct in raptorContent2) { var raptorProductView = productViewModelService.GetViewModel(raptorProduct); if (raptorProductView.MainImage != null) { raptorProductView.RaptorImage = raptorProductView.MainImage.SetWidth(500).SetHeight(300).SetCrop(CropType.KeepAspectRatio).SetCompression(50).GetCrop(); } raptorProductView.RaptorUrl = urlService.GetUrl(raptorProductView.GroupId, raptorProductView.Id, ecomPageId.GetValueOrDefault()); <article itemscope itemtype="http://schema.org/Product\" class="product-item"> <a itemprop="url" href="@raptorProductView.RaptorUrl" data-raptorrecommendation="productId:@raptorProductView.ProductNumber"> <div class="product-item__header"> <figure> <img src="@raptorProductView.RaptorImage" itemprop="image" content="OaseOutdoors.Services.ImageService.ImageService" alt="@raptorProductView.Name"> </figure> </div> <div class="product-item__body"> <div class="product-item__headline"> <h3 itemprop="name" class="h-1">@raptorProductView.Name</h3> </div> <div itemprop="offers" itemscope itemtype="http://schema.org/Offer" class="product-item__price"> <div class="price"><span itemprop=\"priceCurrency\" content="@raptorProductView.Currency">@raptorProductView.CurrencySymbol</span> <span itemprop="price" content="@raptorProductView.UnformatedPrice">@raptorProductView.Price</span></div> </div> </div> </a> </article> } </div> </section> </div> <div id="GetCookieHistory" class="jarvis__suggest"> <section class="featured-products container-ribbon ribbon"> <h3>@Translate("You have previously looked at", "You have previously looked at")</h3> <div class="featured-products__container" data-url="/webservices/jarvis.ashx?areaId=@raptorAreaId&raptorFunction=GetCookieHistory"> @foreach (var raptorProduct in raptorContent1) { var raptorProductView = productViewModelService.GetViewModel(raptorProduct); if (raptorProductView.MainImage != null) { raptorProductView.RaptorImage = raptorProductView.MainImage.SetWidth(500).SetHeight(300).SetCrop(CropType.KeepAspectRatio).SetCompression(50).GetCrop(); } raptorProductView.RaptorUrl = urlService.GetUrl(raptorProductView.GroupId, raptorProductView.Id, ecomPageId.GetValueOrDefault()); <article itemscope itemtype="http://schema.org/Product\" class="product-item"> <a itemprop="url" href="@raptorProductView.RaptorUrl" data-raptorrecommendation="productId:@raptorProductView.ProductNumber"> <div class="product-item__header"> <figure> <img src="@raptorProductView.RaptorImage" itemprop="image" content="OaseOutdoors.Services.ImageService.ImageService" alt="@raptorProductView.Name"> </figure> </div> <div class="product-item__body"> <div class="product-item__headline"> <h3 itemprop="name" class="h-1">@raptorProductView.Name</h3> </div> <div itemprop="offers" itemscope itemtype="http://schema.org/Offer" class="product-item__price"> <div class="price"><span itemprop=\"priceCurrency\" content="@raptorProductView.Currency">@raptorProductView.CurrencySymbol</span> <span itemprop="price" content="@raptorProductView.UnformatedPrice">@raptorProductView.Price</span></div> </div> </div> </a> </article> } </div> </section> </div> </div> <div class="jarvis-btn @jarvisBtnStatus"> <img src="/static/dist/img/jarvis/jarvis-small.png"> </div> </div> } } } @SnippetEnd("jarvis") @RenderSnippet("jarvis") <script> var scriptLoaderSettings = { mainScriptSrc: [ '/static/dist/js/main.min.js' ], polyfills: 'default-3.6,fetch' }; var loadMainScript = function () { function a(a) { var b = document.createElement("script"); b.async = !0, b.src = a, document.body.appendChild(b) } if ("object" == typeof scriptLoaderSettings.mainScriptSrc) for (var b = 0; b < scriptLoaderSettings.mainScriptSrc.length; b++)a(scriptLoaderSettings.mainScriptSrc[b]); else a(scriptLoaderSettings.mainScriptSrc) }; !function (a, b) { var c, d = [/^(.+)(\[.+MessengerForiOS.+\][ ]*)/, /^(.+)(\[.+FBIOS.+\][ ]*)/, /^(.+)( Twitter for iPhone)/]; for (c = 0; c < d.length; ++c) { var e = d[c], f = a.match(e); if (f) { b = b + "&ua=" + encodeURIComponent(f[1] + " Safari"); break } } var g = document.createElement("script"); g.src = b, document.body.appendChild(g) }(navigator.userAgent, "https://cdn.polyfill.io/v2/polyfill.min.js?features=" + scriptLoaderSettings.polyfills + "&callback=loadMainScript"); </script> </body> </html>