public void SetsNavigationRootAsHomeItem() { var item = _db.GetItem("/sitecore/content/Home/Child1"); var linkManager = new Mock <BaseLinkManager>(); var headerBuilder = new HeaderBuilder(linkManager.Object, _rootResolver); var header = headerBuilder.GetHeader(item); var expectedItem = _rootResolver.GetNavigationRoot(item); Assert.Equal(expectedItem, header.HomeItem); }
public override object ResolveContents(Rendering rendering, IRenderingConfiguration renderingConfig) { var root = RootResolver.GetNavigationRoot(this.GetContextItem(rendering, renderingConfig)); return(new { FooterText = root[Templates.NavigationRoot.Fields.FooterCopyright] }); }
public Header GetHeader(Item contextItem) { Debug.Assert(contextItem != null); var navigationRoot = RootResolver.GetNavigationRoot(contextItem); if (navigationRoot == null) { return(new Header()); } return(new Header { HomeItem = navigationRoot, HomeUrl = LinkManager.GetItemUrl(navigationRoot), NavigationItems = GetNavigationItems(navigationRoot, contextItem) }); }
public ActionResult Footer() { var root = RootResolver.GetNavigationRoot(RenderingContext.Current.ContextItem); return(View(root)); }