Ejemplo n.º 1
0
        public ActionResult NewsPromoSection()
        {
            var repo  = new SitecoreNewsModelRepository(Repository, context);
            var model = repo.GetNewsPromos();

            return(View("RelatedArticles", model));
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
        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));
        }