1
Vote

Orchard 1.7 - Pager Showing when only 1 Page (fix included)

description

I checked back to 1.6 and it doesn't show the pager when there is only 1 page (though I am not sure where that was controlled in code).

Repro steps:
  1. Create a new blog or a new projection with 1 or 2 items
  2. Enable the Show Pager
  3. View the page showing this list and you will see a pager showing a single page
Again, there might be a better place to fix but here is how I did it:

File: Orchard.Core.Shapes.CoreShapes
Method: Pager_Links
Added to Code:
// CHANGE - start
var totalPageCount = (int)Math.Ceiling(TotalItemCount / pageSize);

// CHANGE - start
//  I don't want a single page showing
if (totalPageCount <= 1) {
    return null;                
}
// CHANGE - end

comments