public ActionResult RenderBlog() { HomeHelper homeHelper = new HomeHelper(CurrentPage, new UmbracoHelper(UmbracoContext.Current)); LatestBlogPosts model = homeHelper.GetLatestBlogPosts(); return(PartialView(GetViewPath("_Blog"), model)); }
public ActionResult RenderBlog() { var homePage = Umbraco.TypedContentAtRoot().First(); var model = new LatestBlogPosts() { Title = homePage.GetPropertyValue <string>("latestBlogPostsTitle"), Introduction = homePage.GetPropertyValue <string>("latestBlogPostsIntroduction") }; return(PartialView(PartialViewFolder + "_Blog.cshtml", model)); }
public LatestBlogPosts GetLatestBlogPosts() { IPublishedContent homePage = _currentPage.AncestorOrSelf(_homeDocTypeAlias); string title = homePage.GetPropertyValue <string>("latestBlogPostsTitle"); string introduction = homePage.GetPropertyValue("latestBlogPostsintroduction").ToString(); LatestBlogPosts model = new LatestBlogPosts(title, introduction); return(model); }