diff --git a/src/Orchard.Web/Modules/Orchard.Taxonomies/Drivers/TermPartDriver.cs b/src/Orchard.Web/Modules/Orchard.Taxonomies/Drivers/TermPartDriver.cs index 1f57334c7..359afad17 100644 --- a/src/Orchard.Web/Modules/Orchard.Taxonomies/Drivers/TermPartDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Taxonomies/Drivers/TermPartDriver.cs @@ -59,6 +59,10 @@ namespace Orchard.Taxonomies.Drivers { var totalItemCount = _taxonomyService.GetContentItemsCount(part); var partSettings = part.Settings.GetModel(); + if (partSettings != null && partSettings.OverrideDefaultPagination) { + pager.PageSize = partSettings.PageSize; + } + var childDisplayType = partSettings != null && !String.IsNullOrWhiteSpace(partSettings.ChildDisplayType) ? partSettings.ChildDisplayType @@ -72,7 +76,9 @@ namespace Orchard.Taxonomies.Drivers { list.AddRange(termContentItems); - var pagerShape = shapeHelper.Pager(pager) + var pagerShape = pager.PageSize == 0 + ? null + : shapeHelper.Pager(pager) .TotalItemCount(totalItemCount) .Taxonomy(taxonomy) .Term(part); diff --git a/src/Orchard.Web/Modules/Orchard.Taxonomies/Settings/TermPartEditorEvents.cs b/src/Orchard.Web/Modules/Orchard.Taxonomies/Settings/TermPartEditorEvents.cs index b3fdd3801..5dc08118d 100644 --- a/src/Orchard.Web/Modules/Orchard.Taxonomies/Settings/TermPartEditorEvents.cs +++ b/src/Orchard.Web/Modules/Orchard.Taxonomies/Settings/TermPartEditorEvents.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Globalization; using Orchard.ContentManagement; using Orchard.ContentManagement.MetaData; using Orchard.ContentManagement.MetaData.Builders; @@ -23,7 +24,9 @@ namespace Orchard.Taxonomies.Settings { if (updateModel.TryUpdateModel(model, "TermPartSettings", null, null)) { builder - .WithSetting("TermPartSettings.ChildDisplayType", model.ChildDisplayType); + .WithSetting("TermPartSettings.ChildDisplayType", model.ChildDisplayType) + .WithSetting("TermPartSettings.OverrideDefaultPagination", model.OverrideDefaultPagination.ToString()) + .WithSetting("TermPartSettings.PageSize", model.PageSize.ToString(CultureInfo.InvariantCulture)); } yield return DefinitionTemplate(model); diff --git a/src/Orchard.Web/Modules/Orchard.Taxonomies/Settings/TermPartSettings.cs b/src/Orchard.Web/Modules/Orchard.Taxonomies/Settings/TermPartSettings.cs index f56d45a6d..65b91c38f 100644 --- a/src/Orchard.Web/Modules/Orchard.Taxonomies/Settings/TermPartSettings.cs +++ b/src/Orchard.Web/Modules/Orchard.Taxonomies/Settings/TermPartSettings.cs @@ -4,5 +4,15 @@ /// The display type to use for the child items of the term. /// public string ChildDisplayType { get; set; } + + /// + /// If true, overrides default pagination settings with the PageSize value. + /// + public bool OverrideDefaultPagination { get; set; } + + /// + /// The page size, if OverrideDefaultPagination is set to true. + /// + public int PageSize { get; set; } } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Taxonomies/Views/DefinitionTemplates/TermPartSettings.cshtml b/src/Orchard.Web/Modules/Orchard.Taxonomies/Views/DefinitionTemplates/TermPartSettings.cshtml index 85bf95200..f9753364e 100644 --- a/src/Orchard.Web/Modules/Orchard.Taxonomies/Views/DefinitionTemplates/TermPartSettings.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Taxonomies/Views/DefinitionTemplates/TermPartSettings.cshtml @@ -4,4 +4,16 @@ @Html.TextBoxFor(m => m.ChildDisplayType, new { @class = "text medium" }) @T("The display type to apply to child items when displaying the details of this taxonomy term.") @Html.ValidationMessageFor(m => m.ChildDisplayType) - \ No newline at end of file + +
+ +
+ @Html.CheckBoxFor(m => m.OverrideDefaultPagination) + +
+
+ + @Html.TextBoxFor(m => m.PageSize, new { @class = "text small" }) + @T("Determines the number of items that are shown per page.") +
+