public ActionResult NewsPromoSection() { var repo = new SitecoreNewsModelRepository(Repository, context); var model = repo.GetNewsPromos(); return(View("RelatedArticles", model)); }
public ActionResult PagedNewsList(PagedNewsListRequestModel request) { var repo = new SitecoreNewsModelRepository(Repository, context); var model = repo.GetNewsList(request.ParentPage, request.Page, request.PageSize, request.Tags, request.VideosOnly); model.HideContainer = true; return(View("NewsLandingPage", model)); }
public ActionResult NewsLandingPage() { var repo = new SitecoreNewsModelRepository(Repository, context); var item = RenderingContext.Current.Rendering.Item; int pageSize; if (!Int32.TryParse(item[Templates.NewsFolder.Fields.PageSize], out pageSize)) { pageSize = 2; } var q = string.IsNullOrEmpty(Request.QueryString[News.Constants.TopicQueryString]) ? string.Empty : Regex.Replace(Request.QueryString[News.Constants.TopicQueryString], @"[^\w\-\!\$\'\(\)\=\@\d_]+", "-"); var model = repo.GetNewsList(item.ID.ToString(), 1, pageSize, null, false, q); return(View(model)); }