public ActionResult Category(int listId, string pathInfo)
        {
            var    segments  = pathInfo.Split(new[] { "/" }, StringSplitOptions.RemoveEmptyEntries);
            var    pageIndex = 1;
            string slug;

            if (segments.Length > 1)
            {
                if (int.TryParse(segments[segments.Length - 1], out pageIndex))
                {
                    slug = string.Join("/", segments, 0, segments.Length - 1);
                }
                else
                {
                    slug      = string.Join("/", segments);
                    pageIndex = 1;
                }
            }
            else
            {
                slug = segments[0];
            }

            int categoryId;

            if (listCategoryPathConstraint.Match(listId, slug, out categoryId))
            {
                var category = listCategoryService.GetById(categoryId);
                if (category == null)
                {
                    return(new HttpNotFoundResult());
                }

                var list = listService.GetById(category.ListId);
                if (list == null)
                {
                    return(new HttpNotFoundResult());
                }

                int totals;
                var items = listItemService.GetListItemsByCategoryId(listId, categoryId, list.Sorting, pageIndex, list.PageSize, out totals);

                var sb = new StringBuilder();

                if (!string.IsNullOrEmpty(list.CssClass))
                {
                    sb.AppendFormat("<div class=\"{0}\">", list.CssClass);
                }

                if (items.Count > 0 && !string.IsNullOrEmpty(list.SummaryTemplate))
                {
                    var fields = listFieldService.GetFields(list.Id);
                    TemplateHelper.BuildContent(list, fields, items, list.SummaryTemplate, sb, Url);
                }

                if (totals > 0)
                {
                    TemplateHelper.BuildPagination(sb, Url, RouteData.Values, totals, pageIndex, list.PageSize);
                }

                if (!string.IsNullOrEmpty(list.CssClass))
                {
                    sb.Append("</div>");
                }

                return(new ControlContentResult(sb.ToString())
                {
                    Title = list.Name + " - " + category.Name
                });
            }

            return(Item(listId, slug));
        }