Example #1
0
        public IActionResult OnGet(string Slug, int?pageIndex)
        {
            MetaTags metaTags = new MetaTags(ioptions);

            if (!string.IsNullOrEmpty(Slug))
            {
                if (pageIndex == null || pageIndex == 0)
                {
                    pageIndex = 1;
                }


                metaTags.Title       = Slug + " page " + pageIndex.ToString();
                metaTags.FeaturedImg = "";
                metaTags.Web_Url     = ioptions.Value.BaseUrl + "/Category/" + Slug;
                metaTags.Description = "Category " + Slug;

                categories      = new Categories();
                categories.Slug = Slug;

                prev_no = Convert.ToInt32(pageIndex) - 1;
                next_no = Convert.ToInt32(pageIndex) + 1;

                PostList = repositoryData.GetPost_BySlugType("CATEGORY", Slug, (int)pageIndex, 9);

                if (PostList.Count() == 0)
                {
                    no_more_record = "YES";
                }
            }
            else
            {
                categories_List      = repositoryData.GetAllCategories();
                metaTags.Title       = "List of Categories";
                metaTags.FeaturedImg = "";
                metaTags.Web_Url     = ioptions.Value.BaseUrl + "/Category/";
                metaTags.Description = "Categories";
            }

            MyMetaTags = metaTags;
            return(Page());
        }